Documentation ¶
Index ¶
- Variables
- func EVMChainForBootstrapJob(job *Job, set evm.ChainSet) (evm.Chain, error)
- func EVMChainForJob(job *Job, set evm.ChainSet) (evm.Chain, error)
- func ExternalJobIDEncodeBytesToTopic(id uuid.UUID) common.Hash
- func ExternalJobIDEncodeStringToTopic(id uuid.UUID) common.Hash
- func LoadAllJobTypes(tx pg.Queryer, job *Job) error
- func LoadAllJobsTypes(tx pg.Queryer, jobs []Job) error
- func NewORM(db *sqlx.DB, chainSet evm.ChainSet, pipelineORM pipeline.ORM, ...) *orm
- func NewSpawner(orm ORM, config Config, jobTypeDelegates map[Type]Delegate, db *sqlx.DB, ...) *spawner
- func SendingKeysForJob(job *Job) ([]string, error)
- type BlockHeaderFeederSpec
- type BlockhashStoreSpec
- type BootstrapSpec
- type Config
- type CronSpec
- type DRSpecConfig
- type Delegate
- type DirectRequestSpec
- type ExternalInitiatorWebhookSpec
- type FluxMonitorSpec
- type GatewaySpec
- type JSONConfig
- type Job
- type KeeperSpec
- type LegacyGasStationServerSpec
- type LegacyGasStationSidecarSpec
- type NullDelegate
- func (n *NullDelegate) AfterJobCreated(spec Job)
- func (n *NullDelegate) BeforeJobCreated(spec Job)
- func (n *NullDelegate) BeforeJobDeleted(spec Job)
- func (n *NullDelegate) JobType() Type
- func (n *NullDelegate) OnDeleteJob(spec Job, q pg.Queryer) error
- func (n *NullDelegate) ServicesForSpec(spec Job) (s []ServiceCtx, err error)
- type OCR2OracleSpec
- type OCR2PluginType
- type OCRConfig
- type OCROracleSpec
- type ORM
- type ORMConfig
- type PipelineRun
- type Service
- type ServiceAdapter
- type ServiceCtx
- type Spawner
- type SpecError
- type Type
- type VRFSpec
- type WebhookSpec
Constants ¶
This section is empty.
Variables ¶
var ( ErrNoSuchKeyBundle = errors.New("no such key bundle exists") ErrNoSuchTransmitterKey = errors.New("no such transmitter key exists") ErrNoSuchPublicKey = errors.New("no such public key exists") )
var ( ErrNoChainFromSpec = fmt.Errorf("could not get chain from spec") ErrNoSendingKeysFromSpec = fmt.Errorf("could not get sending keys from spec") )
var ( ErrNoPipelineSpec = errors.New("pipeline spec not specified") ErrInvalidJobType = errors.New("invalid job type") ErrInvalidSchemaVersion = errors.New("invalid schema version") )
var ForwardersSupportedPlugins = []OCR2PluginType{Median, DKG, OCR2VRF, OCR2Keeper, OCR2Functions}
Functions ¶
func EVMChainForBootstrapJob ¶
EVMChainForJob parses the job spec and retrieves the evm chain found.
func EVMChainForJob ¶
EVMChainForJob parses the job spec and retrieves the evm chain found.
func LoadAllJobsTypes ¶
NOTE: N+1 query, be careful of performance This is not easily fixable without complicating the logic a lot, since we only use it in the GUI it's probably acceptable
func NewSpawner ¶
func SendingKeysForJob ¶
SendingKeysForJob parses the job spec and retrieves the sending keys found.
Types ¶
type BlockHeaderFeederSpec ¶
type BlockHeaderFeederSpec struct { ID int32 // CoordinatorV1Address is the VRF V1 coordinator to watch for unfulfilled requests. If empty, // no V1 coordinator will be watched. CoordinatorV1Address *ethkey.EIP55Address `toml:"coordinatorV1Address"` // CoordinatorV2Address is the VRF V2 coordinator to watch for unfulfilled requests. If empty, // no V2 coordinator will be watched. CoordinatorV2Address *ethkey.EIP55Address `toml:"coordinatorV2Address"` // CoordinatorV2PlusAddress is the VRF V2Plus coordinator to watch for unfulfilled requests. If empty, // no V2Plus coordinator will be watched. CoordinatorV2PlusAddress *ethkey.EIP55Address `toml:"coordinatorV2PlusAddress"` // LookbackBlocks defines the maximum age of blocks whose hashes should be stored. LookbackBlocks int32 `toml:"lookbackBlocks"` // WaitBlocks defines the minimum age of blocks whose hashes should be stored. WaitBlocks int32 `toml:"waitBlocks"` // BlockhashStoreAddress is the address of the BlockhashStore contract to store blockhashes // into. BlockhashStoreAddress ethkey.EIP55Address `toml:"blockhashStoreAddress"` // BatchBlockhashStoreAddress is the address of the BatchBlockhashStore contract to store blockhashes // into. BatchBlockhashStoreAddress ethkey.EIP55Address `toml:"batchBlockhashStoreAddress"` // PollPeriod defines how often recent blocks should be scanned for blockhash storage. PollPeriod time.Duration `toml:"pollPeriod"` // RunTimeout defines the timeout for a single run of the blockhash store feeder. RunTimeout time.Duration `toml:"runTimeout"` // EVMChainID defines the chain ID for monitoring and storing of blockhashes. EVMChainID *utils.Big `toml:"evmChainID"` // FromAddress is the sender address that should be used to store blockhashes. FromAddresses []ethkey.EIP55Address `toml:"fromAddresses"` // GetBlockHashesBatchSize is the RPC call batch size for retrieving blockhashes GetBlockhashesBatchSize uint16 `toml:"getBlockhashesBatchSize"` // StoreBlockhashesBatchSize is the RPC call batch size for storing blockhashes StoreBlockhashesBatchSize uint16 `toml:"storeBlockhashesBatchSize"` // CreatedAt is the time this job was created. CreatedAt time.Time `toml:"-"` // UpdatedAt is the time this job was last updated. UpdatedAt time.Time `toml:"-"` }
BlockHeaderFeederSpec defines the job spec for the blockhash store feeder.
type BlockhashStoreSpec ¶
type BlockhashStoreSpec struct { ID int32 // CoordinatorV1Address is the VRF V1 coordinator to watch for unfulfilled requests. If empty, // no V1 coordinator will be watched. CoordinatorV1Address *ethkey.EIP55Address `toml:"coordinatorV1Address"` // CoordinatorV2Address is the VRF V2 coordinator to watch for unfulfilled requests. If empty, // no V2 coordinator will be watched. CoordinatorV2Address *ethkey.EIP55Address `toml:"coordinatorV2Address"` // CoordinatorV2PlusAddress is the VRF V2Plus coordinator to watch for unfulfilled requests. If empty, // no V2Plus coordinator will be watched. CoordinatorV2PlusAddress *ethkey.EIP55Address `toml:"coordinatorV2PlusAddress"` // LookbackBlocks defines the maximum age of blocks whose hashes should be stored. LookbackBlocks int32 `toml:"lookbackBlocks"` // WaitBlocks defines the minimum age of blocks whose hashes should be stored. WaitBlocks int32 `toml:"waitBlocks"` // BlockhashStoreAddress is the address of the BlockhashStore contract to store blockhashes // into. BlockhashStoreAddress ethkey.EIP55Address `toml:"blockhashStoreAddress"` // PollPeriod defines how often recent blocks should be scanned for blockhash storage. PollPeriod time.Duration `toml:"pollPeriod"` // RunTimeout defines the timeout for a single run of the blockhash store feeder. RunTimeout time.Duration `toml:"runTimeout"` // EVMChainID defines the chain ID for monitoring and storing of blockhashes. EVMChainID *utils.Big `toml:"evmChainID"` // FromAddress is the sender address that should be used to store blockhashes. FromAddresses []ethkey.EIP55Address `toml:"fromAddresses"` // CreatedAt is the time this job was created. CreatedAt time.Time `toml:"-"` // UpdatedAt is the time this job was last updated. UpdatedAt time.Time `toml:"-"` }
BlockhashStoreSpec defines the job spec for the blockhash store feeder.
type BootstrapSpec ¶
type BootstrapSpec struct { ID int32 `toml:"-"` ContractID string `toml:"contractID"` FeedID *common.Hash `toml:"feedID"` Relay relay.Network `toml:"relay"` RelayConfig JSONConfig MonitoringEndpoint null.String `toml:"monitoringEndpoint"` BlockchainTimeout models.Interval `toml:"blockchainTimeout"` ContractConfigTrackerPollInterval models.Interval `toml:"contractConfigTrackerPollInterval"` ContractConfigConfirmations uint16 `toml:"contractConfigConfirmations"` CreatedAt time.Time `toml:"-"` UpdatedAt time.Time `toml:"-"` }
BootstrapSpec defines the spec to handles the node communication setup process.
func (BootstrapSpec) AsOCR2Spec ¶
func (s BootstrapSpec) AsOCR2Spec() OCR2OracleSpec
AsOCR2Spec transforms the bootstrap spec into a generic OCR2 format to enable code sharing between specs.
type CronSpec ¶
type DRSpecConfig ¶
type DRSpecConfig interface {
MinIncomingConfirmations() uint32
}
type Delegate ¶
type Delegate interface { JobType() Type // BeforeJobCreated is only called once on first time job create. BeforeJobCreated(spec Job) // ServicesForSpec returns services to be started and stopped for this // job. In case a given job type relies upon well-defined startup/shutdown // ordering for services, they are started in the order they are given // and stopped in reverse order. ServicesForSpec(spec Job) ([]ServiceCtx, error) AfterJobCreated(spec Job) BeforeJobDeleted(spec Job) // OnDeleteJob will be called from within DELETE db transaction. Any db // commands issued within OnDeleteJob() should be performed first, before any // non-db side effects. This is required in order to guarantee mutual atomicity between // all tasks intended to happen during job deletion. For the same reason, the job will // not show up in the db within OnDeleteJob(), even though it is still actively running. OnDeleteJob(spec Job, q pg.Queryer) error }
TODO(spook): I can't wait for Go generics
type DirectRequestSpec ¶
type DirectRequestSpec struct { ID int32 `toml:"-"` ContractAddress ethkey.EIP55Address `toml:"contractAddress"` MinIncomingConfirmations clnull.Uint32 `toml:"minIncomingConfirmations"` MinIncomingConfirmationsEnv bool `toml:"minIncomingConfirmationsEnv"` Requesters models.AddressCollection `toml:"requesters"` MinContractPayment *assets.Link `toml:"minContractPaymentLinkJuels"` EVMChainID *utils.Big `toml:"evmChainID"` CreatedAt time.Time `toml:"-"` UpdatedAt time.Time `toml:"-"` }
func LoadEnvConfigVarsDR ¶
func LoadEnvConfigVarsDR(cfg DRSpecConfig, drs DirectRequestSpec) *DirectRequestSpec
type ExternalInitiatorWebhookSpec ¶
type ExternalInitiatorWebhookSpec struct { ExternalInitiatorID int64 ExternalInitiator bridges.ExternalInitiator WebhookSpecID int32 WebhookSpec WebhookSpec Spec models.JSON }
type FluxMonitorSpec ¶
type FluxMonitorSpec struct { ID int32 `toml:"-"` ContractAddress ethkey.EIP55Address `toml:"contractAddress"` Threshold tomlutils.Float32 `toml:"threshold,float"` // AbsoluteThreshold is the maximum absolute change allowed in a fluxmonitored // value before a new round should be kicked off, so that the current value // can be reported on-chain. AbsoluteThreshold tomlutils.Float32 `toml:"absoluteThreshold,float"` PollTimerPeriod time.Duration PollTimerDisabled bool IdleTimerPeriod time.Duration IdleTimerDisabled bool DrumbeatSchedule string DrumbeatRandomDelay time.Duration DrumbeatEnabled bool MinPayment *assets.Link EVMChainID *utils.Big `toml:"evmChainID"` CreatedAt time.Time `toml:"-"` UpdatedAt time.Time `toml:"-"` }
type GatewaySpec ¶ added in v2.3.0
type GatewaySpec struct { ID int32 `toml:"-"` GatewayConfig JSONConfig `toml:"gatewayConfig"` CreatedAt time.Time `toml:"-"` UpdatedAt time.Time `toml:"-"` }
func (GatewaySpec) GetID ¶ added in v2.3.0
func (s GatewaySpec) GetID() string
func (*GatewaySpec) SetID ¶ added in v2.3.0
func (s *GatewaySpec) SetID(value string) error
type JSONConfig ¶
type JSONConfig map[string]interface{}
JSONConfig is a Go mapping for JSON based database properties.
func (JSONConfig) EVMChainID ¶
func (r JSONConfig) EVMChainID() (int64, error)
func (JSONConfig) MercuryCredentialName ¶ added in v2.2.0
func (r JSONConfig) MercuryCredentialName() (string, error)
func (*JSONConfig) Scan ¶
func (r *JSONConfig) Scan(value interface{}) error
Scan reads the database value and returns an instance.
type Job ¶
type Job struct { ID int32 `toml:"-"` ExternalJobID uuid.UUID `toml:"externalJobID"` OCROracleSpecID *int32 OCROracleSpec *OCROracleSpec OCR2OracleSpecID *int32 OCR2OracleSpec *OCR2OracleSpec CronSpecID *int32 CronSpec *CronSpec DirectRequestSpecID *int32 DirectRequestSpec *DirectRequestSpec FluxMonitorSpecID *int32 FluxMonitorSpec *FluxMonitorSpec KeeperSpecID *int32 KeeperSpec *KeeperSpec VRFSpecID *int32 VRFSpec *VRFSpec WebhookSpecID *int32 WebhookSpec *WebhookSpec BlockhashStoreSpecID *int32 BlockhashStoreSpec *BlockhashStoreSpec BlockHeaderFeederSpecID *int32 BlockHeaderFeederSpec *BlockHeaderFeederSpec LegacyGasStationServerSpecID *int32 LegacyGasStationServerSpec *LegacyGasStationServerSpec LegacyGasStationSidecarSpecID *int32 LegacyGasStationSidecarSpec *LegacyGasStationSidecarSpec BootstrapSpec *BootstrapSpec BootstrapSpecID *int32 GatewaySpec *GatewaySpec GatewaySpecID *int32 PipelineSpecID int32 PipelineSpec *pipeline.Spec JobSpecErrors []SpecError Type Type SchemaVersion uint32 GasLimit clnull.Uint32 `toml:"gasLimit"` ForwardingAllowed bool `toml:"forwardingAllowed"` Name null.String MaxTaskDuration models.Interval Pipeline pipeline.Pipeline `toml:"observationSource"` CreatedAt time.Time }
func (Job) ExternalIDEncodeBytesToTopic ¶
ExternalIDEncodeBytesToTopic encodes the external job ID (UUID) into a log topic (32 bytes) by taking the 16 bytes underlying the UUID and right padding it.
func (Job) ExternalIDEncodeStringToTopic ¶
ExternalIDEncodeStringToTopic encodes the external job ID (UUID) into a log topic (32 bytes) by taking the string representation of the UUID, removing the dashes so that its 32 characters long and then encoding those characters to bytes.
type KeeperSpec ¶
type KeeperSpec struct { ID int32 `toml:"-"` ContractAddress ethkey.EIP55Address `toml:"contractAddress"` MinIncomingConfirmations *uint32 `toml:"minIncomingConfirmations"` FromAddress ethkey.EIP55Address `toml:"fromAddress"` EVMChainID *utils.Big `toml:"evmChainID"` CreatedAt time.Time `toml:"-"` UpdatedAt time.Time `toml:"-"` }
type LegacyGasStationServerSpec ¶ added in v2.3.0
type LegacyGasStationServerSpec struct { ID int32 // ForwarderAddress is the address of EIP2771 forwarder that verifies signature // and forwards requests to target contracts ForwarderAddress ethkey.EIP55Address `toml:"forwarderAddress"` // EVMChainID defines the chain ID from which the meta-transaction request originates. EVMChainID *utils.Big `toml:"evmChainID"` // CCIPChainSelector is the CCIP chain selector that corresponds to EVMChainID param. // This selector is equivalent to (source) chainID specified in SendTransaction request CCIPChainSelector *utils.Big `toml:"ccipChainSelector"` // FromAddress is the sender address that should be used to send meta-transactions FromAddresses []ethkey.EIP55Address `toml:"fromAddresses"` // CreatedAt is the time this job was created. CreatedAt time.Time `toml:"-"` // UpdatedAt is the time this job was last updated. UpdatedAt time.Time `toml:"-"` }
LegacyGasStationServerSpec defines the job spec for the legacy gas station server.
type LegacyGasStationSidecarSpec ¶ added in v2.3.0
type LegacyGasStationSidecarSpec struct { ID int32 // ForwarderAddress is the address of EIP2771 forwarder that verifies signature // and forwards requests to target contracts ForwarderAddress ethkey.EIP55Address `toml:"forwarderAddress"` // OffRampAddress is the address of CCIP OffRamp for the given chainID OffRampAddress ethkey.EIP55Address `toml:"offRampAddress"` // LookbackBlocks defines the maximum number of blocks to search for on-chain events. LookbackBlocks int32 `toml:"lookbackBlocks"` // PollPeriod defines how frequently legacy gas station sidecar runs. PollPeriod time.Duration `toml:"pollPeriod"` // RunTimeout defines the timeout for a single run of the legacy gas station sidecar. RunTimeout time.Duration `toml:"runTimeout"` // EVMChainID defines the chain ID for the on-chain events tracked by sidecar EVMChainID *utils.Big `toml:"evmChainID"` // CCIPChainSelector is the CCIP chain selector that corresponds to EVMChainID param CCIPChainSelector *utils.Big `toml:"ccipChainSelector"` // CreatedAt is the time this job was created. CreatedAt time.Time `toml:"-"` // UpdatedAt is the time this job was last updated. UpdatedAt time.Time `toml:"-"` }
LegacyGasStationSidecarSpec defines the job spec for the legacy gas station sidecar.
type NullDelegate ¶
type NullDelegate struct {
Type Type
}
func (*NullDelegate) AfterJobCreated ¶
func (n *NullDelegate) AfterJobCreated(spec Job)
func (*NullDelegate) BeforeJobCreated ¶
func (n *NullDelegate) BeforeJobCreated(spec Job)
func (*NullDelegate) BeforeJobDeleted ¶
func (n *NullDelegate) BeforeJobDeleted(spec Job)
func (*NullDelegate) JobType ¶
func (n *NullDelegate) JobType() Type
func (*NullDelegate) OnDeleteJob ¶
func (n *NullDelegate) OnDeleteJob(spec Job, q pg.Queryer) error
func (*NullDelegate) ServicesForSpec ¶
func (n *NullDelegate) ServicesForSpec(spec Job) (s []ServiceCtx, err error)
ServicesForSpec does no-op.
type OCR2OracleSpec ¶
type OCR2OracleSpec struct { ID int32 `toml:"-"` ContractID string `toml:"contractID"` FeedID *common.Hash `toml:"feedID"` Relay relay.Network `toml:"relay"` RelayConfig JSONConfig `toml:"relayConfig"` P2PV2Bootstrappers pq.StringArray `toml:"p2pv2Bootstrappers"` OCRKeyBundleID null.String `toml:"ocrKeyBundleID"` MonitoringEndpoint null.String `toml:"monitoringEndpoint"` TransmitterID null.String `toml:"transmitterID"` BlockchainTimeout models.Interval `toml:"blockchainTimeout"` ContractConfigTrackerPollInterval models.Interval `toml:"contractConfigTrackerPollInterval"` ContractConfigConfirmations uint16 `toml:"contractConfigConfirmations"` PluginConfig JSONConfig `toml:"pluginConfig"` PluginType OCR2PluginType `toml:"pluginType"` CreatedAt time.Time `toml:"-"` UpdatedAt time.Time `toml:"-"` CaptureEATelemetry bool `toml:"captureEATelemetry"` CaptureAutomationCustomTelemetry bool `toml:"captureAutomationCustomTelemetry"` }
OCR2OracleSpec defines the job spec for OCR2 jobs. Relay config is chain specific config for a relay (chain adapter).
func (OCR2OracleSpec) GetID ¶
func (s OCR2OracleSpec) GetID() string
GetID is a getter function that returns the ID of the spec.
func (*OCR2OracleSpec) SetID ¶
func (s *OCR2OracleSpec) SetID(value string) error
SetID is a setter function that sets the ID of the spec.
type OCR2PluginType ¶
type OCR2PluginType string
OCR2PluginType defines supported OCR2 plugin types.
const ( // Median refers to the median.Median type Median OCR2PluginType = "median" DKG OCR2PluginType = "dkg" OCR2VRF OCR2PluginType = "ocr2vrf" // Keeper was rebranded to automation. For now the plugin type required in job spec points // to the new name (automation) but in code we refer it to keepers // TODO: sc-55296 to rename ocr2keeper to ocr2automation in code OCR2Keeper OCR2PluginType = "ocr2automation" OCR2Functions OCR2PluginType = "functions" Mercury OCR2PluginType = "mercury" )
type OCROracleSpec ¶
type OCROracleSpec struct { ID int32 `toml:"-"` ContractAddress ethkey.EIP55Address `toml:"contractAddress"` P2PBootstrapPeers pq.StringArray `toml:"p2pBootstrapPeers" db:"p2p_bootstrap_peers"` P2PV2Bootstrappers pq.StringArray `toml:"p2pv2Bootstrappers" db:"p2pv2_bootstrappers"` IsBootstrapPeer bool `toml:"isBootstrapPeer"` EncryptedOCRKeyBundleID *models.Sha256Hash `toml:"keyBundleID"` EncryptedOCRKeyBundleIDEnv bool TransmitterAddress *ethkey.EIP55Address `toml:"transmitterAddress"` TransmitterAddressEnv bool ObservationTimeout models.Interval `toml:"observationTimeout"` ObservationTimeoutEnv bool BlockchainTimeout models.Interval `toml:"blockchainTimeout"` BlockchainTimeoutEnv bool ContractConfigTrackerSubscribeInterval models.Interval `toml:"contractConfigTrackerSubscribeInterval"` ContractConfigTrackerSubscribeIntervalEnv bool ContractConfigTrackerPollInterval models.Interval `toml:"contractConfigTrackerPollInterval"` ContractConfigTrackerPollIntervalEnv bool ContractConfigConfirmations uint16 `toml:"contractConfigConfirmations"` ContractConfigConfirmationsEnv bool EVMChainID *utils.Big `toml:"evmChainID" db:"evm_chain_id"` DatabaseTimeout *models.Interval `toml:"databaseTimeout"` DatabaseTimeoutEnv bool ObservationGracePeriod *models.Interval `toml:"observationGracePeriod"` ObservationGracePeriodEnv bool ContractTransmitterTransmitTimeout *models.Interval `toml:"contractTransmitterTransmitTimeout"` ContractTransmitterTransmitTimeoutEnv bool CaptureEATelemetry bool `toml:"captureEATelemetry"` CreatedAt time.Time `toml:"-"` UpdatedAt time.Time `toml:"-"` }
OCROracleSpec defines the job spec for OCR jobs.
func LoadEnvConfigVarsLocalOCR ¶
func LoadEnvConfigVarsLocalOCR(evmOcrCfg evmconfig.OCR, os OCROracleSpec, ocrCfg OCRConfig) *OCROracleSpec
LoadEnvConfigVarsLocalOCR loads local OCR env vars into the OCROracleSpec.
func LoadEnvConfigVarsOCR ¶
func LoadEnvConfigVarsOCR(evmOcrCfg evmconfig.OCR, ocrCfg OCRConfig, os OCROracleSpec) (*OCROracleSpec, error)
LoadEnvConfigVarsOCR loads OCR env vars into the OCROracleSpec.
func (OCROracleSpec) GetID ¶
func (s OCROracleSpec) GetID() string
GetID is a getter function that returns the ID of the spec.
func (*OCROracleSpec) SetID ¶
func (s *OCROracleSpec) SetID(value string) error
SetID is a setter function that sets the ID of the spec.
type ORM ¶
type ORM interface { InsertWebhookSpec(webhookSpec *WebhookSpec, qopts ...pg.QOpt) error InsertJob(job *Job, qopts ...pg.QOpt) error CreateJob(jb *Job, qopts ...pg.QOpt) error FindJobs(offset, limit int) ([]Job, int, error) FindJobTx(id int32) (Job, error) FindJob(ctx context.Context, id int32) (Job, error) FindJobByExternalJobID(uuid uuid.UUID, qopts ...pg.QOpt) (Job, error) FindJobIDByAddress(address ethkey.EIP55Address, evmChainID *utils.Big, qopts ...pg.QOpt) (int32, error) FindOCR2JobIDByAddress(contractID string, feedID *common.Hash, qopts ...pg.QOpt) (int32, error) FindJobIDsWithBridge(name string) ([]int32, error) DeleteJob(id int32, qopts ...pg.QOpt) error RecordError(jobID int32, description string, qopts ...pg.QOpt) error // TryRecordError is a helper which calls RecordError and logs the returned error if present. TryRecordError(jobID int32, description string, qopts ...pg.QOpt) DismissError(ctx context.Context, errorID int64) error FindSpecError(id int64, qopts ...pg.QOpt) (SpecError, error) Close() error PipelineRuns(jobID *int32, offset, size int) ([]pipeline.Run, int, error) FindPipelineRunIDsByJobID(jobID int32, offset, limit int) (ids []int64, err error) FindPipelineRunsByIDs(ids []int64) (runs []pipeline.Run, err error) CountPipelineRunsByJobID(jobID int32) (count int32, err error) FindJobsByPipelineSpecIDs(ids []int32) ([]Job, error) FindPipelineRunByID(id int64) (pipeline.Run, error) FindSpecErrorsByJobIDs(ids []int32, qopts ...pg.QOpt) ([]SpecError, error) FindJobWithoutSpecErrors(id int32) (jb Job, err error) FindTaskResultByRunIDAndTaskName(runID int64, taskName string, qopts ...pg.QOpt) ([]byte, error) AssertBridgesExist(p pipeline.Pipeline) error }
type PipelineRun ¶
type PipelineRun struct {
ID int64 `json:"-"`
}
func (PipelineRun) GetID ¶
func (pr PipelineRun) GetID() string
func (*PipelineRun) SetID ¶
func (pr *PipelineRun) SetID(value string) error
type ServiceAdapter ¶
type ServiceAdapter interface { ServiceCtx }
ServiceAdapter is a helper introduced for transitioning from Service to ServiceCtx.
type ServiceCtx ¶
ServiceCtx is the same as Service, but Start method receives a context.
func NewServiceAdapter ¶
func NewServiceAdapter(service Service) ServiceCtx
NewServiceAdapter creates an adapter instance for the given Service.
type Spawner ¶
type Spawner interface { services.ServiceCtx // CreateJob creates a new job and starts services. // All services must start without errors for the job to be active. CreateJob(jb *Job, qopts ...pg.QOpt) (err error) // DeleteJob deletes a job and stops any active services. DeleteJob(jobID int32, qopts ...pg.QOpt) error // ActiveJobs returns a map of jobs with active services (started without error). ActiveJobs() map[int32]Job // StartService starts services for the given job spec. // NOTE: Prefer to use CreateJob, this is only publicly exposed for use in tests // to start a job that was previously manually inserted into DB StartService(ctx context.Context, spec Job) error }
Spawner manages the spinning up and down of the long-running services that perform the work described by job specs. Each active job spec has 1 or more of these services associated with it.
type SpecError ¶
type Type ¶
type Type string
const ( Cron Type = (Type)(pipeline.CronJobType) DirectRequest Type = (Type)(pipeline.DirectRequestJobType) FluxMonitor Type = (Type)(pipeline.FluxMonitorJobType) OffchainReporting Type = (Type)(pipeline.OffchainReportingJobType) OffchainReporting2 Type = (Type)(pipeline.OffchainReporting2JobType) Keeper Type = (Type)(pipeline.KeeperJobType) VRF Type = (Type)(pipeline.VRFJobType) BlockhashStore Type = (Type)(pipeline.BlockhashStoreJobType) BlockHeaderFeeder Type = (Type)(pipeline.BlockHeaderFeederJobType) LegacyGasStationServer Type = (Type)(pipeline.LegacyGasStationServerJobType) LegacyGasStationSidecar Type = (Type)(pipeline.LegacyGasStationSidecarJobType) Webhook Type = (Type)(pipeline.WebhookJobType) Bootstrap Type = (Type)(pipeline.BootstrapJobType) Gateway Type = (Type)(pipeline.GatewayJobType) )
func ValidateSpec ¶
ValidateSpec is the common spec validation
func (Type) RequiresPipelineSpec ¶
func (Type) SchemaVersion ¶
func (Type) SupportsAsync ¶
type VRFSpec ¶
type VRFSpec struct { ID int32 // BatchCoordinatorAddress is the address of the batch vrf coordinator to use. // This is required if batchFulfillmentEnabled is set to true in the job spec. BatchCoordinatorAddress *ethkey.EIP55Address `toml:"batchCoordinatorAddress"` // BatchFulfillmentEnabled indicates to the vrf job to use the batch vrf coordinator // for fulfilling requests. If set to true, batchCoordinatorAddress must be set in // the job spec. BatchFulfillmentEnabled bool `toml:"batchFulfillmentEnabled"` // BatchFulfillmentGasMultiplier is used to determine the final gas estimate for the batch // fulfillment. BatchFulfillmentGasMultiplier tomlutils.Float64 `toml:"batchFulfillmentGasMultiplier"` // VRFOwnerAddress is the address of the VRFOwner address to use. // // V2 only. VRFOwnerAddress *ethkey.EIP55Address `toml:"vrfOwnerAddress"` CoordinatorAddress ethkey.EIP55Address `toml:"coordinatorAddress"` PublicKey secp256k1.PublicKey `toml:"publicKey"` MinIncomingConfirmations uint32 `toml:"minIncomingConfirmations"` ConfirmationsEnv bool `toml:"-"` EVMChainID *utils.Big `toml:"evmChainID"` FromAddresses []ethkey.EIP55Address `toml:"fromAddresses"` PollPeriod time.Duration `toml:"pollPeriod"` // For v2 jobs PollPeriodEnv bool RequestedConfsDelay int64 `toml:"requestedConfsDelay"` // For v2 jobs. Optional, defaults to 0 if not provided. RequestTimeout time.Duration `toml:"requestTimeout"` // Optional, defaults to 24hr if not provided. // GasLanePrice specifies the gas lane price for this VRF job. // If the specified keys in FromAddresses do not have the provided gas price the job // will not start. // // Optional, for v2 jobs only. GasLanePrice *assets.Wei `toml:"gasLanePrice" db:"gas_lane_price"` // ChunkSize is the number of pending VRF V2 requests to process in parallel. Optional, defaults // to 20 if not provided. ChunkSize uint32 `toml:"chunkSize"` // BackoffInitialDelay is the amount of time to wait before retrying a failed request after the // first failure. V2 only. BackoffInitialDelay time.Duration `toml:"backoffInitialDelay"` // BackoffMaxDelay is the maximum amount of time to wait before retrying a failed request. V2 // only. BackoffMaxDelay time.Duration `toml:"backoffMaxDelay"` CreatedAt time.Time `toml:"-"` UpdatedAt time.Time `toml:"-"` }
func LoadEnvConfigVarsVRF ¶
func LoadEnvConfigVarsVRF(cfg DRSpecConfig, vrfs VRFSpec) *VRFSpec
type WebhookSpec ¶
type WebhookSpec struct { ID int32 `toml:"-"` ExternalInitiatorWebhookSpecs []ExternalInitiatorWebhookSpec CreatedAt time.Time `json:"createdAt" toml:"-"` UpdatedAt time.Time `json:"updatedAt" toml:"-"` }
func (WebhookSpec) GetID ¶
func (w WebhookSpec) GetID() string
func (*WebhookSpec) SetID ¶
func (w *WebhookSpec) SetID(value string) error