keeper

package
v0.10.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 12, 2021 License: MIT Imports: 24 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

Functions

func ValidatedKeeperSpec

func ValidatedKeeperSpec(tomlString string) (job.Job, error)

Types

type Delegate

type Delegate struct {
	// contains filtered or unexported fields
}

func NewDelegate

func NewDelegate(
	db *gorm.DB,
	ethClient eth.Client,
	headBroadcaster *services.HeadBroadcaster,
	logBroadcaster log.Broadcaster,
	config *orm.Config,
) *Delegate

func (*Delegate) JobType

func (d *Delegate) JobType() job.Type

func (*Delegate) ServicesForSpec

func (d *Delegate) ServicesForSpec(spec job.Job) (services []job.Service, err error)

type MailRoom added in v0.10.4

type MailRoom struct {
	// contains filtered or unexported fields
}

MailRoom holds the log mailboxes for all the log types that keeper cares about

type ORM

type ORM struct {
	DB *gorm.DB
}

func NewORM

func NewORM(db *gorm.DB) ORM

func (ORM) BatchDeleteUpkeepsForJob added in v0.10.4

func (korm ORM) BatchDeleteUpkeepsForJob(ctx context.Context, jobID int32, upkeedIDs []int64) error

func (ORM) CreateEthTransactionForUpkeep

func (korm ORM) CreateEthTransactionForUpkeep(ctx context.Context, upkeep UpkeepRegistration, payload []byte) error

func (ORM) EligibleUpkeeps

func (korm ORM) EligibleUpkeeps(
	ctx context.Context,
	blockNumber int64,
	gracePeriod int64,
) (upkeeps []UpkeepRegistration, _ error)

func (ORM) LowestUnsyncedID

func (korm ORM) LowestUnsyncedID(ctx context.Context, reg Registry) (nextID int64, err error)

LowestUnsyncedID returns the largest upkeepID + 1, indicating the expected next upkeepID to sync from the contract

func (ORM) Registries

func (korm ORM) Registries(ctx context.Context) (registries []Registry, _ error)

func (ORM) RegistryForJob added in v0.10.4

func (korm ORM) RegistryForJob(ctx context.Context, jobID int32) (registry Registry, _ error)

func (ORM) SetLastRunHeightForUpkeepOnJob added in v0.10.4

func (korm ORM) SetLastRunHeightForUpkeepOnJob(ctx context.Context, jobID int32, upkeepID int64, height int64) error

func (ORM) UpsertRegistry

func (korm ORM) UpsertRegistry(ctx context.Context, registry *Registry) error

func (ORM) UpsertUpkeep

func (korm ORM) UpsertUpkeep(ctx context.Context, registration *UpkeepRegistration) error

type Registry

type Registry struct {
	ID                int32 `gorm:"primary_key"`
	BlockCountPerTurn int32
	CheckGas          int32
	ContractAddress   models.EIP55Address
	FromAddress       models.EIP55Address
	JobID             int32
	KeeperIndex       int32
	NumKeepers        int32
}

func NewRegistry

func NewRegistry(address models.EIP55Address, from models.EIP55Address, jobID int32) Registry

func (Registry) TableName

func (Registry) TableName() string

type RegistrySynchronizer

type RegistrySynchronizer struct {
	utils.StartStopOnce
	// contains filtered or unexported fields
}

func NewRegistrySynchronizer

func NewRegistrySynchronizer(
	job job.Job,
	contract *keeper_registry_wrapper.KeeperRegistry,
	db *gorm.DB,
	headBroadcaster *services.HeadBroadcaster,
	logBroadcaster log.Broadcaster,
	syncInterval time.Duration,
	minConfirmations uint64,
) *RegistrySynchronizer

func (*RegistrySynchronizer) Close

func (rs *RegistrySynchronizer) Close() error

func (*RegistrySynchronizer) HandleLog added in v0.10.4

func (rs *RegistrySynchronizer) HandleLog(broadcast log.Broadcast)

func (*RegistrySynchronizer) IsV2Job added in v0.10.4

func (rs *RegistrySynchronizer) IsV2Job() bool

func (*RegistrySynchronizer) JobID added in v0.10.4

func (rs *RegistrySynchronizer) JobID() models.JobID

func (*RegistrySynchronizer) JobIDV2 added in v0.10.4

func (rs *RegistrySynchronizer) JobIDV2() int32

func (*RegistrySynchronizer) OnConnect added in v0.10.4

func (rs *RegistrySynchronizer) OnConnect()

func (*RegistrySynchronizer) OnDisconnect added in v0.10.4

func (rs *RegistrySynchronizer) OnDisconnect()

func (*RegistrySynchronizer) OnNewLongestChain added in v0.10.4

func (rs *RegistrySynchronizer) OnNewLongestChain(ctx context.Context, head models.Head)

func (*RegistrySynchronizer) Start

func (rs *RegistrySynchronizer) Start() error

type UpkeepExecutor

type UpkeepExecutor struct {
	utils.StartStopOnce
	// contains filtered or unexported fields
}

func NewUpkeepExecutor

func NewUpkeepExecutor(
	job job.Job,
	db *gorm.DB,
	ethClient eth.Client,
	headBroadcaster *services.HeadBroadcaster,
	maxGracePeriod int64,
) *UpkeepExecutor

func (*UpkeepExecutor) Close

func (executor *UpkeepExecutor) Close() error

func (*UpkeepExecutor) OnNewLongestChain

func (executor *UpkeepExecutor) OnNewLongestChain(ctx context.Context, head models.Head)

func (*UpkeepExecutor) Start

func (executor *UpkeepExecutor) Start() error

type UpkeepRegistration

type UpkeepRegistration struct {
	ID                  int32 `gorm:"primary_key"`
	CheckData           []byte
	ExecuteGas          int32
	LastRunBlockHeight  int64
	RegistryID          int32
	Registry            Registry
	UpkeepID            int64
	PositioningConstant int32
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL