Documentation ¶
Index ¶
- Constants
- Variables
- func FromPluginTypeInput(pt PluginType) string
- func NewORM(ds sqlutil.DataSource) *orm
- func NewService(orm ORM, jobORM job.ORM, ds sqlutil.DataSource, jobSpawner job.Spawner, ...) *service
- type ChainConfig
- type ChainType
- type ConnectOpts
- type ConnectionsManager
- type DeleteJobArgs
- type FeedsManager
- type FluxMonitorConfig
- type GeneralConfig
- type InsecureConfig
- type JobConfig
- type JobProposal
- type JobProposalCounts
- type JobProposalSpec
- type JobProposalStatus
- type NullService
- func (ns NullService) ApproveSpec(ctx context.Context, id int64, force bool) error
- func (ns NullService) CancelSpec(ctx context.Context, id int64) error
- func (ns NullService) Close() error
- func (ns NullService) CountJobProposalsByStatus(ctx context.Context) (*JobProposalCounts, error)
- func (ns NullService) CountManagers(ctx context.Context) (int64, error)
- func (ns NullService) CreateChainConfig(ctx context.Context, cfg ChainConfig) (int64, error)
- func (ns NullService) DeleteChainConfig(ctx context.Context, id int64) (int64, error)
- func (ns NullService) DeleteJob(ctx context.Context, args *DeleteJobArgs) (int64, error)
- func (ns NullService) GetChainConfig(ctx context.Context, id int64) (*ChainConfig, error)
- func (ns NullService) GetJobProposal(ctx context.Context, id int64) (*JobProposal, error)
- func (ns NullService) GetManager(ctx context.Context, id int64) (*FeedsManager, error)
- func (ns NullService) GetSpec(ctx context.Context, id int64) (*JobProposalSpec, error)
- func (ns NullService) IsJobManaged(ctx context.Context, jobID int64) (bool, error)
- func (ns NullService) ListChainConfigsByManagerIDs(ctx context.Context, mgrIDs []int64) ([]ChainConfig, error)
- func (ns NullService) ListJobProposals(ctx context.Context) ([]JobProposal, error)
- func (ns NullService) ListJobProposalsByManagersIDs(ctx context.Context, ids []int64) ([]JobProposal, error)
- func (ns NullService) ListManagers(ctx context.Context) ([]FeedsManager, error)
- func (ns NullService) ListManagersByIDs(ctx context.Context, ids []int64) ([]FeedsManager, error)
- func (ns NullService) ListSpecsByJobProposalIDs(ctx context.Context, ids []int64) ([]JobProposalSpec, error)
- func (ns NullService) ProposeJob(ctx context.Context, args *ProposeJobArgs) (int64, error)
- func (ns NullService) RegisterManager(ctx context.Context, params RegisterManagerParams) (int64, error)
- func (ns NullService) RejectSpec(ctx context.Context, id int64) error
- func (ns NullService) RevokeJob(ctx context.Context, args *RevokeJobArgs) (int64, error)
- func (ns NullService) Start(ctx context.Context) error
- func (ns NullService) SyncNodeInfo(ctx context.Context, id int64) error
- func (ns NullService) UpdateChainConfig(ctx context.Context, cfg ChainConfig) (int64, error)
- func (ns NullService) UpdateManager(ctx context.Context, mgr FeedsManager) error
- func (ns NullService) UpdateSpecDefinition(ctx context.Context, id int64, spec string) error
- type OCR1Config
- type OCR2Config
- type OCR2ConfigModel
- type OCRConfig
- type ORM
- type PluginType
- type Plugins
- type ProposeJobArgs
- type RPCHandlers
- func (h *RPCHandlers) DeleteJob(ctx context.Context, req *pb.DeleteJobRequest) (*pb.DeleteJobResponse, error)
- func (h *RPCHandlers) ProposeJob(ctx context.Context, req *pb.ProposeJobRequest) (*pb.ProposeJobResponse, error)
- func (h *RPCHandlers) RevokeJob(ctx context.Context, req *pb.RevokeJobRequest) (*pb.RevokeJobResponse, error)
- type RegisterManagerParams
- type RevokeJobArgs
- type Service
- type SpecStatus
Constants ¶
const ( JobTypeFluxMonitor = "fluxmonitor" JobTypeOffchainReporting = "ocr" JobTypeOffchainReporting2 = "ocr2" )
Variables ¶
var ( ErrOCR2Disabled = errors.New("ocr2 is disabled") ErrOCRDisabled = errors.New("ocr is disabled") ErrSingleFeedsManager = errors.New("only a single feeds manager is supported") ErrJobAlreadyExists = errors.New("a job for this contract address already exists - please use the 'force' option to replace it") ErrFeedsManagerDisabled = errors.New("feeds manager is disabled") )
Functions ¶
func FromPluginTypeInput ¶
func FromPluginTypeInput(pt PluginType) string
func NewORM ¶
func NewORM(ds sqlutil.DataSource) *orm
func NewService ¶
func NewService( orm ORM, jobORM job.ORM, ds sqlutil.DataSource, jobSpawner job.Spawner, keyStore keystore.Master, gCfg GeneralConfig, insecureCfg InsecureConfig, jobCfg JobConfig, ocrCfg OCRConfig, ocr2Cfg OCR2Config, legacyChains legacyevm.LegacyChainContainer, lggr logger.Logger, version string, rc plugins.RegistrarConfig, ) *service
NewService constructs a new feeds service
Types ¶
type ChainConfig ¶
type ChainConfig struct { ID int64 FeedsManagerID int64 ChainID string ChainType ChainType AccountAddress string AdminAddress string FluxMonitorConfig FluxMonitorConfig OCR1Config OCR1Config OCR2Config OCR2ConfigModel CreatedAt time.Time UpdatedAt time.Time }
ChainConfig defines the chain configuration for a Feeds Manager.
type ConnectOpts ¶
type ConnectOpts struct { FeedsManagerID int64 // URI is the URI of the feeds manager URI string // Privkey defines the local CSA private key Privkey []byte // Pubkey defines the Feeds Manager Service's public key Pubkey []byte // Handlers defines the wsrpc Handlers Handlers pb.NodeServiceServer // OnConnect defines a callback for when the dial succeeds OnConnect func(pb.FeedsManagerClient) }
ConnectOpts defines the required options to connect to an FMS server
type ConnectionsManager ¶
type ConnectionsManager interface { Connect(opts ConnectOpts) Disconnect(id int64) error Close() GetClient(id int64) (pb.FeedsManagerClient, error) IsConnected(id int64) bool }
type DeleteJobArgs ¶
DeleteJobArgs are the arguments to provide to the DeleteJob method.
type FeedsManager ¶
type FeedsManager struct { ID int64 Name string URI string PublicKey crypto.PublicKey IsConnectionActive bool CreatedAt time.Time UpdatedAt time.Time }
FeedsManager defines a registered Feeds Manager Service and the connection information.
type FluxMonitorConfig ¶
type FluxMonitorConfig struct {
Enabled bool `json:"enabled"`
}
FluxMonitorConfig defines configuration for FluxMonitorJobs.
func (*FluxMonitorConfig) Scan ¶
func (c *FluxMonitorConfig) Scan(value interface{}) error
type GeneralConfig ¶ added in v2.12.0
type GeneralConfig interface { OCR() coreconfig.OCR Insecure() coreconfig.Insecure }
type InsecureConfig ¶ added in v2.3.0
type InsecureConfig interface {
OCRDevelopmentMode() bool
}
type JobConfig ¶ added in v2.3.0
type JobConfig interface {
DefaultHTTPTimeout() commonconfig.Duration
}
type JobProposal ¶
type JobProposal struct { ID int64 Name null.String RemoteUUID uuid.UUID // RemoteUUID is the uuid of the proposal in FMS. Status JobProposalStatus ExternalJobID uuid.NullUUID // ExternalJobID is the external job id in the job spec. FeedsManagerID int64 Multiaddrs pq.StringArray PendingUpdate bool CreatedAt time.Time UpdatedAt time.Time }
JobProposal represents a proposal which has been sent by a Feeds Manager.
A job proposal has multiple spec versions which are created each time the Feeds Manager sends a new proposal version.
type JobProposalCounts ¶
type JobProposalCounts struct { Pending int64 Cancelled int64 Approved int64 Rejected int64 Deleted int64 Revoked int64 }
JobProposalCounts defines the counts for job proposals of each status.
type JobProposalSpec ¶
type JobProposalSpec struct { ID int64 Definition string Status SpecStatus Version int32 JobProposalID int64 StatusUpdatedAt time.Time CreatedAt time.Time UpdatedAt time.Time }
JobProposalSpec defines a versioned proposed spec for a JobProposal.
func (*JobProposalSpec) CanEditDefinition ¶
func (s *JobProposalSpec) CanEditDefinition() bool
CanEditDefinition checks if the spec definition can be edited.
type JobProposalStatus ¶
type JobProposalStatus string
JobProposalStatus are the status codes that define the stage of a proposal
const ( JobProposalStatusPending JobProposalStatus = "pending" JobProposalStatusApproved JobProposalStatus = "approved" JobProposalStatusRejected JobProposalStatus = "rejected" JobProposalStatusCancelled JobProposalStatus = "cancelled" JobProposalStatusDeleted JobProposalStatus = "deleted" JobProposalStatusRevoked JobProposalStatus = "revoked" )
type NullService ¶
type NullService struct{}
NullService defines an implementation of the Feeds Service that is used when the Feeds Service is disabled.
func (NullService) ApproveSpec ¶
func (NullService) CancelSpec ¶
func (ns NullService) CancelSpec(ctx context.Context, id int64) error
func (NullService) Close ¶
func (ns NullService) Close() error
func (NullService) CountJobProposalsByStatus ¶
func (ns NullService) CountJobProposalsByStatus(ctx context.Context) (*JobProposalCounts, error)
func (NullService) CountManagers ¶
func (ns NullService) CountManagers(ctx context.Context) (int64, error)
func (NullService) CreateChainConfig ¶
func (ns NullService) CreateChainConfig(ctx context.Context, cfg ChainConfig) (int64, error)
func (NullService) DeleteChainConfig ¶
func (NullService) DeleteJob ¶
func (ns NullService) DeleteJob(ctx context.Context, args *DeleteJobArgs) (int64, error)
func (NullService) GetChainConfig ¶
func (ns NullService) GetChainConfig(ctx context.Context, id int64) (*ChainConfig, error)
func (NullService) GetJobProposal ¶
func (ns NullService) GetJobProposal(ctx context.Context, id int64) (*JobProposal, error)
func (NullService) GetManager ¶
func (ns NullService) GetManager(ctx context.Context, id int64) (*FeedsManager, error)
func (NullService) GetSpec ¶
func (ns NullService) GetSpec(ctx context.Context, id int64) (*JobProposalSpec, error)
func (NullService) IsJobManaged ¶
func (NullService) ListChainConfigsByManagerIDs ¶
func (ns NullService) ListChainConfigsByManagerIDs(ctx context.Context, mgrIDs []int64) ([]ChainConfig, error)
func (NullService) ListJobProposals ¶
func (ns NullService) ListJobProposals(ctx context.Context) ([]JobProposal, error)
func (NullService) ListJobProposalsByManagersIDs ¶
func (ns NullService) ListJobProposalsByManagersIDs(ctx context.Context, ids []int64) ([]JobProposal, error)
func (NullService) ListManagers ¶
func (ns NullService) ListManagers(ctx context.Context) ([]FeedsManager, error)
func (NullService) ListManagersByIDs ¶
func (ns NullService) ListManagersByIDs(ctx context.Context, ids []int64) ([]FeedsManager, error)
func (NullService) ListSpecsByJobProposalIDs ¶
func (ns NullService) ListSpecsByJobProposalIDs(ctx context.Context, ids []int64) ([]JobProposalSpec, error)
func (NullService) ProposeJob ¶
func (ns NullService) ProposeJob(ctx context.Context, args *ProposeJobArgs) (int64, error)
func (NullService) RegisterManager ¶
func (ns NullService) RegisterManager(ctx context.Context, params RegisterManagerParams) (int64, error)
func (NullService) RejectSpec ¶
func (ns NullService) RejectSpec(ctx context.Context, id int64) error
func (NullService) RevokeJob ¶
func (ns NullService) RevokeJob(ctx context.Context, args *RevokeJobArgs) (int64, error)
func (NullService) SyncNodeInfo ¶
func (ns NullService) SyncNodeInfo(ctx context.Context, id int64) error
func (NullService) UpdateChainConfig ¶
func (ns NullService) UpdateChainConfig(ctx context.Context, cfg ChainConfig) (int64, error)
func (NullService) UpdateManager ¶
func (ns NullService) UpdateManager(ctx context.Context, mgr FeedsManager) error
func (NullService) UpdateSpecDefinition ¶
type OCR1Config ¶
type OCR1Config struct { Enabled bool `json:"enabled"` IsBootstrap bool `json:"is_bootstrap"` Multiaddr null.String `json:"multiaddr"` P2PPeerID null.String `json:"p2p_peer_id"` KeyBundleID null.String `json:"key_bundle_id"` }
OCR1Config defines configuration for OCR1 Jobs.
func (*OCR1Config) Scan ¶
func (c *OCR1Config) Scan(value interface{}) error
type OCR2Config ¶
type OCR2Config interface { Enabled() bool BlockchainTimeout() time.Duration ContractConfirmations() uint16 ContractPollInterval() time.Duration ContractTransmitterTransmitTimeout() time.Duration DatabaseTimeout() time.Duration DefaultTransactionQueueDepth() uint32 SimulateTransactions() bool TraceLogging() bool }
type OCR2ConfigModel ¶ added in v2.3.0
type OCR2ConfigModel struct { Enabled bool `json:"enabled"` IsBootstrap bool `json:"is_bootstrap"` Multiaddr null.String `json:"multiaddr"` ForwarderAddress null.String `json:"forwarder_address"` P2PPeerID null.String `json:"p2p_peer_id"` KeyBundleID null.String `json:"key_bundle_id"` Plugins Plugins `json:"plugins"` }
OCR2ConfigModel defines configuration for OCR2 Jobs.
func (*OCR2ConfigModel) Scan ¶ added in v2.3.0
func (c *OCR2ConfigModel) Scan(value interface{}) error
type ORM ¶
type ORM interface { CountManagers(ctx context.Context) (int64, error) CreateManager(ctx context.Context, ms *FeedsManager) (int64, error) GetManager(ctx context.Context, id int64) (*FeedsManager, error) ListManagers(ctx context.Context) (mgrs []FeedsManager, err error) ListManagersByIDs(ctx context.Context, ids []int64) ([]FeedsManager, error) UpdateManager(ctx context.Context, mgr FeedsManager) error CreateBatchChainConfig(ctx context.Context, cfgs []ChainConfig) ([]int64, error) CreateChainConfig(ctx context.Context, cfg ChainConfig) (int64, error) DeleteChainConfig(ctx context.Context, id int64) (int64, error) GetChainConfig(ctx context.Context, id int64) (*ChainConfig, error) ListChainConfigsByManagerIDs(ctx context.Context, mgrIDs []int64) ([]ChainConfig, error) UpdateChainConfig(ctx context.Context, cfg ChainConfig) (int64, error) CountJobProposals(ctx context.Context) (int64, error) CountJobProposalsByStatus(ctx context.Context) (counts *JobProposalCounts, err error) CreateJobProposal(ctx context.Context, jp *JobProposal) (int64, error) DeleteProposal(ctx context.Context, id int64) error GetJobProposal(ctx context.Context, id int64) (*JobProposal, error) GetJobProposalByRemoteUUID(ctx context.Context, uuid uuid.UUID) (*JobProposal, error) ListJobProposals(ctx context.Context) (jps []JobProposal, err error) ListJobProposalsByManagersIDs(ctx context.Context, ids []int64) ([]JobProposal, error) UpdateJobProposalStatus(ctx context.Context, id int64, status JobProposalStatus) error // NEEDED? UpsertJobProposal(ctx context.Context, jp *JobProposal) (int64, error) ApproveSpec(ctx context.Context, id int64, externalJobID uuid.UUID) error CancelSpec(ctx context.Context, id int64) error CreateSpec(ctx context.Context, spec JobProposalSpec) (int64, error) ExistsSpecByJobProposalIDAndVersion(ctx context.Context, jpID int64, version int32) (exists bool, err error) GetApprovedSpec(ctx context.Context, jpID int64) (*JobProposalSpec, error) GetLatestSpec(ctx context.Context, jpID int64) (*JobProposalSpec, error) GetSpec(ctx context.Context, id int64) (*JobProposalSpec, error) ListSpecsByJobProposalIDs(ctx context.Context, ids []int64) ([]JobProposalSpec, error) RejectSpec(ctx context.Context, id int64) error RevokeSpec(ctx context.Context, id int64) error UpdateSpecDefinition(ctx context.Context, id int64, spec string) error IsJobManaged(ctx context.Context, jobID int64) (bool, error) Transact(context.Context, func(ORM) error) error WithDataSource(sqlutil.DataSource) ORM }
type PluginType ¶
type PluginType string
const ( PluginTypeCommit PluginType = "COMMIT" PluginTypeExecute PluginType = "EXECUTE" PluginTypeMedian PluginType = "MEDIAN" PluginTypeMercury PluginType = "MERCURY" PluginTypeRebalancer PluginType = "REBALANCER" PluginTypeUnknown PluginType = "UNKNOWN" )
func ToPluginType ¶
func ToPluginType(s string) (PluginType, error)
type Plugins ¶
type ProposeJobArgs ¶
type ProposeJobArgs struct { FeedsManagerID int64 RemoteUUID uuid.UUID Multiaddrs pq.StringArray Version int32 Spec string }
ProposeJobArgs are the arguments to provide to the ProposeJob method.
type RPCHandlers ¶
type RPCHandlers struct {
// contains filtered or unexported fields
}
RPCHandlers define handlers for RPC method calls from the Feeds Manager
func NewRPCHandlers ¶
func NewRPCHandlers(svc Service, feedsManagerID int64) *RPCHandlers
func (*RPCHandlers) DeleteJob ¶
func (h *RPCHandlers) DeleteJob(ctx context.Context, req *pb.DeleteJobRequest) (*pb.DeleteJobResponse, error)
DeleteJob deletes a job proposal record.
func (*RPCHandlers) ProposeJob ¶
func (h *RPCHandlers) ProposeJob(ctx context.Context, req *pb.ProposeJobRequest) (*pb.ProposeJobResponse, error)
ProposeJob creates a new job proposal record for the feeds manager
func (*RPCHandlers) RevokeJob ¶
func (h *RPCHandlers) RevokeJob(ctx context.Context, req *pb.RevokeJobRequest) (*pb.RevokeJobResponse, error)
RevokeJob revokes a pending job proposal record.
type RegisterManagerParams ¶
type RegisterManagerParams struct { Name string URI string PublicKey crypto.PublicKey ChainConfigs []ChainConfig }
type RevokeJobArgs ¶
RevokeJobArgs are the arguments to provide the RevokeJob method
type Service ¶
type Service interface { Start(ctx context.Context) error Close() error CountManagers(ctx context.Context) (int64, error) GetManager(ctx context.Context, id int64) (*FeedsManager, error) ListManagers(ctx context.Context) ([]FeedsManager, error) ListManagersByIDs(ctx context.Context, ids []int64) ([]FeedsManager, error) RegisterManager(ctx context.Context, params RegisterManagerParams) (int64, error) UpdateManager(ctx context.Context, mgr FeedsManager) error CreateChainConfig(ctx context.Context, cfg ChainConfig) (int64, error) DeleteChainConfig(ctx context.Context, id int64) (int64, error) GetChainConfig(ctx context.Context, id int64) (*ChainConfig, error) ListChainConfigsByManagerIDs(ctx context.Context, mgrIDs []int64) ([]ChainConfig, error) UpdateChainConfig(ctx context.Context, cfg ChainConfig) (int64, error) DeleteJob(ctx context.Context, args *DeleteJobArgs) (int64, error) IsJobManaged(ctx context.Context, jobID int64) (bool, error) ProposeJob(ctx context.Context, args *ProposeJobArgs) (int64, error) RevokeJob(ctx context.Context, args *RevokeJobArgs) (int64, error) SyncNodeInfo(ctx context.Context, id int64) error CountJobProposalsByStatus(ctx context.Context) (*JobProposalCounts, error) GetJobProposal(ctx context.Context, id int64) (*JobProposal, error) ListJobProposals(ctx context.Context) ([]JobProposal, error) ListJobProposalsByManagersIDs(ctx context.Context, ids []int64) ([]JobProposal, error) ApproveSpec(ctx context.Context, id int64, force bool) error CancelSpec(ctx context.Context, id int64) error GetSpec(ctx context.Context, id int64) (*JobProposalSpec, error) ListSpecsByJobProposalIDs(ctx context.Context, ids []int64) ([]JobProposalSpec, error) RejectSpec(ctx context.Context, id int64) error UpdateSpecDefinition(ctx context.Context, id int64, spec string) error }
Service represents a behavior of the feeds service
type SpecStatus ¶
type SpecStatus string
SpecStatus is the status of each proposed spec.
const ( // SpecStatusPending defines a spec status which has been proposed by the // FMS. SpecStatusPending SpecStatus = "pending" // SpecStatusApproved defines a spec status which the node op has approved. // An approved spec is currently being run by the node. SpecStatusApproved SpecStatus = "approved" // SpecStatusRejected defines a spec status which was proposed, but was // rejected by the node op. SpecStatusRejected SpecStatus = "rejected" // SpecStatusCancelled defines a spec status which was previously approved, // but cancelled by the node op. A cancelled spec is not being run by the // node. SpecStatusCancelled SpecStatus = "cancelled" // SpecStatusRevoked defines a spec status which was revoked. A revoked spec cannot be // approved. SpecStatusRevoked SpecStatus = "revoked" )