feeds

package
v0.10.12 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2021 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JobTypeFluxMonitor       = "fluxmonitor"
	JobTypeOffchainReporting = "offchainreporting"
)

We only support OCR and FM for the feeds manager

Variables

View Source
var (
	ErrOCRDisabled = errors.New("ocr is disabled")
)

Functions

func NewORM

func NewORM(db *gorm.DB) *orm

func NewService

func NewService(
	orm ORM,
	txm postgres.TransactionManager,
	jobSpawner job.Spawner,
	csaKeyStore keystore.CSAKeystoreInterface,
	ethKeyStore keystore.EthKeyStoreInterface,
	cfg Config,
) *service

NewService constructs a new feeds service

Types

type Config added in v0.10.10

type Config interface {
	ChainID() *big.Int
	Dev() bool
	FeatureOffchainReporting() bool
	DefaultHTTPTimeout() models.Duration
	OCRBlockchainTimeout(override time.Duration) time.Duration
	OCRContractConfirmations(override uint16) uint16
	OCRContractPollInterval(override time.Duration) time.Duration
	OCRContractSubscribeInterval(override time.Duration) time.Duration
	OCRContractTransmitterTransmitTimeout() time.Duration
	OCRDatabaseTimeout() time.Duration
	OCRObservationTimeout(override time.Duration) time.Duration
	OCRObservationGracePeriod() time.Duration
}

type FeedsManager

type FeedsManager struct {
	ID        int64
	Name      string
	URI       string
	PublicKey crypto.PublicKey
	JobTypes  pq.StringArray `gorm:"type:text[]"`

	// Determines whether the node will be used as a bootstrap peer. If this is
	// true, you must have both an OCRBootstrapAddr and OCRBootstrapPeerID.
	IsOCRBootstrapPeer bool

	// The libp2p multiaddress which the node operator will assign to this node
	// for bootstrap peer discovery.
	OCRBootstrapPeerMultiaddr null.String

	CreatedAt time.Time
	UpdatedAt time.Time
}

func (FeedsManager) TableName

func (FeedsManager) TableName() string

type JobProposal added in v0.10.9

type JobProposal struct {
	ID int64
	// RemoteUUID is the unique id of the proposal in FMS.
	RemoteUUID uuid.UUID
	Spec       string
	Status     JobProposalStatus
	// ExternalJobID is the external job id in the spec.
	ExternalJobID  uuid.NullUUID
	FeedsManagerID int64
	CreatedAt      time.Time
	UpdatedAt      time.Time
}

type JobProposalStatus added in v0.10.9

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"
)

type ORM

type ORM interface {
	ApproveJobProposal(ctx context.Context, id int64, externalJobID uuid.UUID, status JobProposalStatus) error
	CountJobProposals() (int64, error)
	CountManagers() (int64, error)
	CreateJobProposal(ctx context.Context, jp *JobProposal) (int64, error)
	CreateManager(ctx context.Context, ms *FeedsManager) (int64, error)
	GetJobProposal(ctx context.Context, id int64) (*JobProposal, error)
	GetManager(ctx context.Context, id int64) (*FeedsManager, error)
	ListJobProposals(ctx context.Context) ([]JobProposal, error)
	ListManagers(ctx context.Context) ([]FeedsManager, error)
	UpdateJobProposalSpec(ctx context.Context, id int64, spec string) error
	UpdateJobProposalStatus(ctx context.Context, id int64, status JobProposalStatus) error
}

type RPCHandlers added in v0.10.9

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

RPCHandlers define handlers for RPC method calls from the Feeds Manager

func NewRPCHandlers added in v0.10.9

func NewRPCHandlers(svc Service, feedsManagerID int64) *RPCHandlers

func (*RPCHandlers) ProposeJob added in v0.10.9

ProposeJob creates a new job proposal record for the feeds manager

type Service

type Service interface {
	Start() error
	Close() error

	ApproveJobProposal(ctx context.Context, id int64) error
	CountManagers() (int64, error)
	CreateJobProposal(jp *JobProposal) (int64, error)
	GetJobProposal(id int64) (*JobProposal, error)
	GetManager(id int64) (*FeedsManager, error)
	ListManagers() ([]FeedsManager, error)
	ListJobProposals() ([]JobProposal, error)
	RegisterManager(ms *FeedsManager) (int64, error)
	RejectJobProposal(ctx context.Context, id int64) error
	SyncNodeInfo(id int64) error
	UpdateJobProposalSpec(ctx context.Context, id int64, spec string) error

	Unsafe_SetFMSClient(pb.FeedsManagerClient)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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