offchainreporting2plus

package
v0.0.0-...-fd3cab2 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 13 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SanityCheckLocalConfig

func SanityCheckLocalConfig(c types.LocalConfig) (err error)

Types

type Bootstrapper

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

Bootstrapper connects to a particular feed and listens for config changes, but does not participate in the protocol. It merely acts as a bootstrap node for peer discovery.

func NewBootstrapper

func NewBootstrapper(args BootstrapperArgs) (*Bootstrapper, error)

func (*Bootstrapper) Close

func (b *Bootstrapper) Close() error

Close shuts down a Bootstrapper. Can safely be called multiple times.

func (*Bootstrapper) Start

func (b *Bootstrapper) Start() error

Start spins up a Bootstrapper.

type BootstrapperArgs

type BootstrapperArgs struct {
	BootstrapperFactory    types.BootstrapperFactory
	V2Bootstrappers        []commontypes.BootstrapperLocator
	ContractConfigTracker  types.ContractConfigTracker
	Database               types.ConfigDatabase
	LocalConfig            types.LocalConfig
	Logger                 commontypes.Logger
	MonitoringEndpoint     commontypes.MonitoringEndpoint
	OffchainConfigDigester types.OffchainConfigDigester
}

type MercuryOracleArgs

type MercuryOracleArgs struct {
	// A factory for producing network endpoints. A network endpoints consists of
	// networking methods a consumer must implement to allow a node to
	// communicate with other participating nodes.
	BinaryNetworkEndpointFactory types.BinaryNetworkEndpointFactory

	// V2Bootstrappers is the list of bootstrap node addresses and IDs for the v2 stack.
	V2Bootstrappers []commontypes.BootstrapperLocator

	// Tracks configuration changes.
	ContractConfigTracker types.ContractConfigTracker

	// Interfaces with the OCR2Aggregator smart contract's transmission related logic.
	ContractTransmitter types.ContractTransmitter

	// Database provides persistent storage.
	Database ocr3types.Database

	// LocalConfig contains oracle-specific configuration details which are not
	// mandated by the on-chain configuration specification via OffchainAggregatoo.SetConfig.
	LocalConfig types.LocalConfig

	// Logger logs stuff.
	Logger commontypes.Logger

	// Enables adding metrics to track. This may be nil.
	MetricsRegisterer prometheus.Registerer

	// Used to send logs to a monitor.
	MonitoringEndpoint commontypes.MonitoringEndpoint

	// Computes a config digest using purely offchain logic.
	OffchainConfigDigester types.OffchainConfigDigester

	// OffchainKeyring contains the secret keys needed for the OCR protocol, and methods
	// which use those keys without exposing them to the rest of the application.
	OffchainKeyring types.OffchainKeyring

	// OnchainKeyring is used to sign reports that can be validated
	// offchain and by the target contract.
	OnchainKeyring types.OnchainKeyring

	// ReportingPluginFactory creates ReportingPlugins that determine the
	// "application logic" used in an OCR protocol instance.
	MercuryPluginFactory ocr3types.MercuryPluginFactory
}

MercuryOracleArgs is used for OCR3 protocol instances that only use the Mercury-specific subset of OCR3 features.

type OCR2OracleArgs

type OCR2OracleArgs struct {
	// A factory for producing network endpoints. A network endpoints consists of
	// networking methods a consumer must implement to allow a node to
	// communicate with other participating nodes.
	BinaryNetworkEndpointFactory types.BinaryNetworkEndpointFactory

	// V2Bootstrappers is the list of bootstrap node addresses and IDs for the v2 stack.
	V2Bootstrappers []commontypes.BootstrapperLocator

	// Tracks configuration changes.
	ContractConfigTracker types.ContractConfigTracker

	// Interfaces with the OCR2Aggregator smart contract's transmission related logic.
	ContractTransmitter types.ContractTransmitter

	// Database provides persistent storage.
	Database types.Database

	// LocalConfig contains oracle-specific configuration details which are not
	// mandated by the on-chain configuration specification via OffchainAggregatoo.SetConfig.
	LocalConfig types.LocalConfig

	// Logger logs stuff.
	Logger commontypes.Logger

	// Used to send logs to a monitor.
	MonitoringEndpoint commontypes.MonitoringEndpoint

	// Enables adding metrics to track. This may be nil.
	MetricsRegisterer prometheus.Registerer

	// Computes a config digest using purely offchain logic.
	OffchainConfigDigester types.OffchainConfigDigester

	// OffchainKeyring contains the secret keys needed for the OCR protocol, and methods
	// which use those keys without exposing them to the rest of the application.
	OffchainKeyring types.OffchainKeyring

	// OnchainKeyring is used to sign reports that can be validated
	// offchain and by the target contract.
	OnchainKeyring types.OnchainKeyring

	// ReportingPluginFactory creates ReportingPlugins that determine the
	// "application logic" used in a OCR2 protocol instance.
	ReportingPluginFactory types.ReportingPluginFactory
}

OCR2OracleArgs contains the configuration and services a caller must provide, in order to run the offchainreporting protocol.

type OCR3OracleArgs

type OCR3OracleArgs[RI any] struct {
	// A factory for producing network endpoints. A network endpoints consists of
	// networking methods a consumer must implement to allow a node to
	// communicate with other participating nodes.
	BinaryNetworkEndpointFactory types.BinaryNetworkEndpointFactory

	// V2Bootstrappers is the list of bootstrap node addresses and IDs for the v2 stack.
	V2Bootstrappers []commontypes.BootstrapperLocator

	// Tracks configuration changes.
	ContractConfigTracker types.ContractConfigTracker

	// Transmit reports to the targeted system (e.g. a blockchain)
	ContractTransmitter ocr3types.ContractTransmitter[RI]

	// Database provides persistent storage.
	Database ocr3types.Database

	// LocalConfig contains oracle-specific configuration details which are not
	// mandated by the on-chain configuration specification via OffchainAggregatoo.SetConfig.
	LocalConfig types.LocalConfig

	// Logger logs stuff.
	Logger commontypes.Logger

	// Enables adding metrics to track. This may be nil.
	MetricsRegisterer prometheus.Registerer

	// Used to send logs to a monitor.
	MonitoringEndpoint commontypes.MonitoringEndpoint

	// Computes a config digest using purely offchain logic.
	OffchainConfigDigester types.OffchainConfigDigester

	// OffchainKeyring contains the secret keys needed for the OCR protocol, and methods
	// which use those keys without exposing them to the rest of the application.
	OffchainKeyring types.OffchainKeyring

	// OnchainKeyring is used to sign reports that can be validated
	// offchain and by the target contract.
	OnchainKeyring ocr3types.OnchainKeyring[RI]

	// PluginFactory creates Plugins that determine the "application logic" used
	// in a protocol instance.
	ReportingPluginFactory ocr3types.ReportingPluginFactory[RI]
}

type Oracle

type Oracle interface {
	Start() error
	Close() error
}

func NewOracle

func NewOracle(args OracleArgs) (Oracle, error)

NewOracle returns a newly initialized Oracle using the provided services and configuration.

type OracleArgs

type OracleArgs interface {
	// contains filtered or unexported methods
}

Directories

Path Synopsis
chains
Package confighelper provides helpers for converting between the gethwrappers/OCR2Aggregator.SetConfig event and types.ContractConfig
Package confighelper provides helpers for converting between the gethwrappers/OCR2Aggregator.SetConfig event and types.ContractConfig
internal
managed
Package managed provides "managed" versions of Oracle and Bootstrapper that perform garbage collection, track on-chain configuration changes, serializes messages to binary, etc...
Package managed provides "managed" versions of Oracle and Bootstrapper that perform garbage collection, track on-chain configuration changes, serializes messages to binary, etc...
shim
Package shim contains implementations of internal types in terms of the external types
Package shim contains implementations of internal types in terms of the external types
Package types contains the types and interfaces a consumer of the OCR library needs to be aware of
Package types contains the types and interfaces a consumer of the OCR library needs to be aware of

Jump to

Keyboard shortcuts

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