Documentation ¶
Index ¶
- Constants
- Variables
- func NewDB(sqldb *sql.DB, oracleSpecID int32) ocrtypes.Database
- func NewLogger(internal *logger.Logger, trace bool, saveError func(string)) ocrtypes.Logger
- func ValidatedOracleSpecToml(config *orm.Config, tomlString string) (job.SpecDB, error)
- type Delegate
- type KeyStore
- func (ks KeyStore) ArchiveEncryptedOCRKeyBundle(key *ocrkey.EncryptedKeyBundle) error
- func (ks KeyStore) ArchiveEncryptedP2PKey(key *p2pkey.EncryptedP2PKey) error
- func (ks KeyStore) CreateEncryptedOCRKeyBundle(encryptedKey *ocrkey.EncryptedKeyBundle) error
- func (ks KeyStore) DecryptedOCRKey(hash models.Sha256Hash) (ocrkey.KeyBundle, bool)
- func (ks KeyStore) DecryptedP2PKey(peerID p2ppeer.ID) (p2pkey.Key, bool)
- func (ks KeyStore) DecryptedP2PKeys() (keys []p2pkey.Key)
- func (ks KeyStore) DeleteEncryptedOCRKeyBundle(key *ocrkey.EncryptedKeyBundle) error
- func (ks KeyStore) DeleteEncryptedP2PKey(key *p2pkey.EncryptedP2PKey) error
- func (ks KeyStore) ExportOCRKeyBundle(id models.Sha256Hash, newPassword string) ([]byte, error)
- func (ks KeyStore) ExportP2PKey(ID int32, newPassword string) ([]byte, error)
- func (ks KeyStore) FindEncryptedOCRKeyBundleByID(id models.Sha256Hash) (ocrkey.EncryptedKeyBundle, error)
- func (ks KeyStore) FindEncryptedOCRKeyBundles() (keys []ocrkey.EncryptedKeyBundle, err error)
- func (ks KeyStore) FindEncryptedP2PKeyByID(id int32) (*p2pkey.EncryptedP2PKey, error)
- func (ks KeyStore) FindEncryptedP2PKeys() (keys []p2pkey.EncryptedP2PKey, err error)
- func (ks KeyStore) GenerateEncryptedOCRKeyBundle() (ocrkey.KeyBundle, ocrkey.EncryptedKeyBundle, error)
- func (ks KeyStore) GenerateEncryptedP2PKey() (p2pkey.Key, p2pkey.EncryptedP2PKey, error)
- func (ks KeyStore) ImportOCRKeyBundle(keyJSON []byte, oldPassword string) (*ocrkey.EncryptedKeyBundle, error)
- func (ks KeyStore) ImportP2PKey(keyJSON []byte, oldPassword string) (*p2pkey.EncryptedP2PKey, error)
- func (ks *KeyStore) Unlock(password string) error
- func (ks KeyStore) UpsertEncryptedOCRKeyBundle(encryptedKey *ocrkey.EncryptedKeyBundle) error
- func (ks KeyStore) UpsertEncryptedP2PKey(k *p2pkey.EncryptedP2PKey) error
- type OCRContractConfigSubscription
- func (sub *OCRContractConfigSubscription) Close()
- func (sub *OCRContractConfigSubscription) Configs() <-chan ocrtypes.ContractConfig
- func (sub *OCRContractConfigSubscription) HandleLog(lb log.Broadcast, err error)
- func (sub *OCRContractConfigSubscription) IsV2Job() bool
- func (sub *OCRContractConfigSubscription) JobID() models.JobID
- func (sub *OCRContractConfigSubscription) JobIDV2() int32
- func (sub *OCRContractConfigSubscription) OnConnect()
- func (sub *OCRContractConfigSubscription) OnDisconnect()
- type OCRContractConfigTracker
- func (oc *OCRContractConfigTracker) ConfigFromLogs(ctx context.Context, changedInBlock uint64) (c ocrtypes.ContractConfig, err error)
- func (oc *OCRContractConfigTracker) LatestBlockHeight(ctx context.Context) (blockheight uint64, err error)
- func (oc *OCRContractConfigTracker) LatestConfigDetails(ctx context.Context) (changedInBlock uint64, configDigest ocrtypes.ConfigDigest, err error)
- func (oc *OCRContractConfigTracker) SubscribeToNewConfigs(context.Context) (ocrtypes.ContractConfigSubscription, error)
- type OCRContractTransmitter
- func (oc *OCRContractTransmitter) FromAddress() gethCommon.Address
- func (oc *OCRContractTransmitter) LatestTransmissionDetails(ctx context.Context) (configDigest ocrtypes.ConfigDigest, epoch uint32, round uint8, ...)
- func (oc *OCRContractTransmitter) Transmit(ctx context.Context, report []byte, rs, ss [][32]byte, vs [32]byte) error
- type P2PPeer
- type Pstorewrapper
- type SingletonPeerWrapper
- type Transmitter
Constants ¶
const OCRContractConfigSubscriptionHandleLogTimeout = 5 * time.Second
Variables ¶
var (
OCRContractConfigSet = getConfigSetHash()
)
Functions ¶
Types ¶
type Delegate ¶
type Delegate struct {
// contains filtered or unexported fields
}
func NewDelegate ¶
type KeyStore ¶
func NewKeyStore ¶
func NewKeyStore(db *gorm.DB, scryptParams utils.ScryptParams) *KeyStore
func (KeyStore) ArchiveEncryptedOCRKeyBundle ¶
func (ks KeyStore) ArchiveEncryptedOCRKeyBundle(key *ocrkey.EncryptedKeyBundle) error
ArchiveEncryptedOCRKeyBundle deletes the provided encrypted OCR key bundle
func (KeyStore) ArchiveEncryptedP2PKey ¶
func (ks KeyStore) ArchiveEncryptedP2PKey(key *p2pkey.EncryptedP2PKey) error
func (KeyStore) CreateEncryptedOCRKeyBundle ¶
func (ks KeyStore) CreateEncryptedOCRKeyBundle(encryptedKey *ocrkey.EncryptedKeyBundle) error
CreateEncryptedOCRKeyBundle creates an encrypted OCR private key record
func (KeyStore) DecryptedOCRKey ¶
func (KeyStore) DecryptedP2PKey ¶
func (KeyStore) DecryptedP2PKeys ¶
func (KeyStore) DeleteEncryptedOCRKeyBundle ¶
func (ks KeyStore) DeleteEncryptedOCRKeyBundle(key *ocrkey.EncryptedKeyBundle) error
DeleteEncryptedOCRKeyBundle deletes the provided encrypted OCR key bundle
func (KeyStore) DeleteEncryptedP2PKey ¶
func (ks KeyStore) DeleteEncryptedP2PKey(key *p2pkey.EncryptedP2PKey) error
func (KeyStore) ExportOCRKeyBundle ¶
ExportOCRKeyBundle exports an OCR key bundle from the database
func (KeyStore) ExportP2PKey ¶
ExportP2PKey exports a p2p key from the database
func (KeyStore) FindEncryptedOCRKeyBundleByID ¶
func (ks KeyStore) FindEncryptedOCRKeyBundleByID(id models.Sha256Hash) (ocrkey.EncryptedKeyBundle, error)
FindEncryptedOCRKeyBundleByID finds an EncryptedKeyBundle bundle by its ID
func (KeyStore) FindEncryptedOCRKeyBundles ¶
func (ks KeyStore) FindEncryptedOCRKeyBundles() (keys []ocrkey.EncryptedKeyBundle, err error)
FindEncryptedOCRKeyBundles finds all the encrypted OCR key records
func (KeyStore) FindEncryptedP2PKeyByID ¶
func (ks KeyStore) FindEncryptedP2PKeyByID(id int32) (*p2pkey.EncryptedP2PKey, error)
func (KeyStore) FindEncryptedP2PKeys ¶
func (ks KeyStore) FindEncryptedP2PKeys() (keys []p2pkey.EncryptedP2PKey, err error)
func (KeyStore) GenerateEncryptedOCRKeyBundle ¶
func (KeyStore) GenerateEncryptedP2PKey ¶
func (KeyStore) ImportOCRKeyBundle ¶
func (ks KeyStore) ImportOCRKeyBundle(keyJSON []byte, oldPassword string) (*ocrkey.EncryptedKeyBundle, error)
ImportOCRKeyBundle imports an OCR key bundle to the database
func (KeyStore) ImportP2PKey ¶
func (ks KeyStore) ImportP2PKey(keyJSON []byte, oldPassword string) (*p2pkey.EncryptedP2PKey, error)
ImportP2PKey imports a p2p key to the database
func (KeyStore) UpsertEncryptedOCRKeyBundle ¶
func (ks KeyStore) UpsertEncryptedOCRKeyBundle(encryptedKey *ocrkey.EncryptedKeyBundle) error
func (KeyStore) UpsertEncryptedP2PKey ¶
func (ks KeyStore) UpsertEncryptedP2PKey(k *p2pkey.EncryptedP2PKey) error
type OCRContractConfigSubscription ¶
type OCRContractConfigSubscription struct {
// contains filtered or unexported fields
}
func (*OCRContractConfigSubscription) Close ¶
func (sub *OCRContractConfigSubscription) Close()
Close complies with ContractConfigSubscription interface
func (*OCRContractConfigSubscription) Configs ¶
func (sub *OCRContractConfigSubscription) Configs() <-chan ocrtypes.ContractConfig
Configs complies with ContractConfigSubscription interface
func (*OCRContractConfigSubscription) HandleLog ¶
func (sub *OCRContractConfigSubscription) HandleLog(lb log.Broadcast, err error)
HandleLog complies with LogListener interface
func (*OCRContractConfigSubscription) IsV2Job ¶
func (sub *OCRContractConfigSubscription) IsV2Job() bool
IsV2Job complies with LogListener interface
func (*OCRContractConfigSubscription) JobID ¶
func (sub *OCRContractConfigSubscription) JobID() models.JobID
JobID complies with LogListener interface
func (*OCRContractConfigSubscription) JobIDV2 ¶
func (sub *OCRContractConfigSubscription) JobIDV2() int32
JobIDV2 complies with LogListener interface
func (*OCRContractConfigSubscription) OnConnect ¶
func (sub *OCRContractConfigSubscription) OnConnect()
OnConnect complies with LogListener interface
func (*OCRContractConfigSubscription) OnDisconnect ¶
func (sub *OCRContractConfigSubscription) OnDisconnect()
OnDisconnect complies with LogListener interface
type OCRContractConfigTracker ¶
type OCRContractConfigTracker struct {
// contains filtered or unexported fields
}
func NewOCRContractConfigTracker ¶
func NewOCRContractConfigTracker( address gethCommon.Address, contractFilterer *offchainaggregator.OffchainAggregatorFilterer, contractCaller *offchainaggregator.OffchainAggregatorCaller, ethClient eth.Client, logBroadcaster log.Broadcaster, jobID int32, logger logger.Logger, ) (o *OCRContractConfigTracker, err error)
func (*OCRContractConfigTracker) ConfigFromLogs ¶
func (oc *OCRContractConfigTracker) ConfigFromLogs(ctx context.Context, changedInBlock uint64) (c ocrtypes.ContractConfig, err error)
func (*OCRContractConfigTracker) LatestBlockHeight ¶
func (oc *OCRContractConfigTracker) LatestBlockHeight(ctx context.Context) (blockheight uint64, err error)
func (*OCRContractConfigTracker) LatestConfigDetails ¶
func (oc *OCRContractConfigTracker) LatestConfigDetails(ctx context.Context) (changedInBlock uint64, configDigest ocrtypes.ConfigDigest, err error)
func (*OCRContractConfigTracker) SubscribeToNewConfigs ¶
func (oc *OCRContractConfigTracker) SubscribeToNewConfigs(context.Context) (ocrtypes.ContractConfigSubscription, error)
type OCRContractTransmitter ¶
type OCRContractTransmitter struct {
// contains filtered or unexported fields
}
func NewOCRContractTransmitter ¶
func NewOCRContractTransmitter( address gethCommon.Address, contractCaller *offchainaggregator.OffchainAggregatorCaller, contractABI abi.ABI, transmitter Transmitter, ) *OCRContractTransmitter
func (*OCRContractTransmitter) FromAddress ¶
func (oc *OCRContractTransmitter) FromAddress() gethCommon.Address
func (*OCRContractTransmitter) LatestTransmissionDetails ¶
func (oc *OCRContractTransmitter) LatestTransmissionDetails(ctx context.Context) (configDigest ocrtypes.ConfigDigest, epoch uint32, round uint8, latestAnswer ocrtypes.Observation, latestTimestamp time.Time, err error)
type Pstorewrapper ¶
type Pstorewrapper struct { utils.StartStopOnce Peerstore p2ppeerstore.Peerstore // contains filtered or unexported fields }
func NewPeerstoreWrapper ¶
func NewPeerstoreWrapper(db *gorm.DB, writeInterval time.Duration, peerID models.PeerID) (*Pstorewrapper, error)
NewPeerstoreWrapper creates a new database-backed peerstore wrapper scoped to the given jobID Multiple peerstore wrappers should not be instantiated with the same jobID
func (*Pstorewrapper) Close ¶
func (p *Pstorewrapper) Close() error
func (*Pstorewrapper) Start ¶
func (p *Pstorewrapper) Start() error
func (*Pstorewrapper) WriteToDB ¶
func (p *Pstorewrapper) WriteToDB() error
type SingletonPeerWrapper ¶
type SingletonPeerWrapper struct { PeerID models.PeerID Peer peer // contains filtered or unexported fields }
SingletonPeerWrapper manages all libocr peers for the application
func NewSingletonPeerWrapper ¶
func NewSingletonPeerWrapper(keyStore *KeyStore, config *orm.Config, db *gorm.DB) *SingletonPeerWrapper
NewSingletonPeerWrapper creates a new peer based on the p2p keys in the keystore It currently only supports one peerID/key It should be fairly easy to modify it to support multiple peerIDs/keys using e.g. a map
func (SingletonPeerWrapper) Close ¶
func (p SingletonPeerWrapper) Close() (err error)
Close closes the peer and peerstore
func (*SingletonPeerWrapper) IsStarted ¶
func (p *SingletonPeerWrapper) IsStarted() bool
func (*SingletonPeerWrapper) Start ¶
func (p *SingletonPeerWrapper) Start() (err error)
type Transmitter ¶
type Transmitter interface { CreateEthTransaction(ctx context.Context, toAddress gethCommon.Address, payload []byte) error FromAddress() gethCommon.Address }
func NewTransmitter ¶
func NewTransmitter(sqldb *sql.DB, fromAddress gethCommon.Address, gasLimit uint64) Transmitter
NewTransmitter creates a new eth transmitter