Documentation ¶
Index ¶
- Constants
- type AutomationProvider
- type BatchGetLatestValuesRequest
- type BatchGetLatestValuesResult
- type BatchRead
- type BatchReadResult
- type BoundContract
- type CCIPCommitFactoryGenerator
- type CCIPCommitProvider
- type CCIPExecProvider
- type CCIPExecutionFactoryGenerator
- type CCIPFactoryGenerator
- type CCIPOCR3CommitProvider
- type CCIPOCR3ExecuteProvider
- type ChainFeeComponents
- type ChainService
- type ChainStatus
- type Codec
- type ConfigProvider
- type ContractBatch
- type ContractBatchResults
- type ContractKeyFilter
- type ContractReader
- type ContractTypeProvider
- type ContractWriter
- type Decoder
- type Encoder
- type FunctionsEvents
- type FunctionsProvider
- type Head
- type InternalError
- type InvalidArgumentError
- type LLOConfigProvider
- type LLOProvider
- type MedianProvider
- type MercuryCredentials
- type MercuryPluginFactory
- type MercuryProvider
- type NodeStatus
- type NotFoundError
- type OCR2PluginType
- type OCR3CapabilityProvider
- type OCR3ContractTransmitter
- type OracleRequest
- type OracleResponse
- type Plugin
- type PluginArgs
- type PluginMercury
- type PluginProvider
- type RelayArgs
- type RelayID
- type Relayer
- type RemoteCodec
- type ReportingPluginFactory
- type Sequence
- type Servicedeprecated
- type TransactionStatus
- type TxMeta
- type TypeProvider
- type UnimplementedContractReader
- func (UnimplementedContractReader) BatchGetLatestValues(ctx context.Context, request BatchGetLatestValuesRequest) (BatchGetLatestValuesResult, error)
- func (UnimplementedContractReader) Bind(ctx context.Context, bindings []BoundContract) error
- func (UnimplementedContractReader) Close() error
- func (UnimplementedContractReader) GetLatestValue(ctx context.Context, readIdentifier string, ...) error
- func (UnimplementedContractReader) GetLatestValueWithHeadData(ctx context.Context, readIdentifier string, ...) (*Head, error)
- func (UnimplementedContractReader) HealthReport() map[string]error
- func (UnimplementedContractReader) Name() string
- func (UnimplementedContractReader) QueryKey(ctx context.Context, boundContract BoundContract, filter query.KeyFilter, ...) ([]Sequence, error)
- func (UnimplementedContractReader) QueryKeys(ctx context.Context, keyQueries []ContractKeyFilter, ...) (iter.Seq2[string, Sequence], error)
- func (UnimplementedContractReader) Ready() error
- func (UnimplementedContractReader) Start(context.Context) error
- func (UnimplementedContractReader) Unbind(ctx context.Context, bindings []BoundContract) error
- type UnimplementedError
Examples ¶
Constants ¶
const ( ErrFieldNotFound = InvalidArgumentError("field not found") ErrInvalidEncoding = InvalidArgumentError("invalid encoding") ErrSliceWrongLen = InvalidArgumentError("slice is wrong length") ErrNotASlice = InvalidArgumentError("element is not a slice") )
const ( ErrInvalidType = InvalidArgumentError("invalid type") ErrInvalidConfig = InvalidArgumentError("invalid configuration") ErrContractReaderConfigMissing = UnimplementedError("ContractReader entry missing from RelayConfig") ErrInternal = InternalError("internal error") ErrNotFound = NotFoundError("not found") ErrFinalityViolated = InternalError("finality violated") )
Errors exposed to product plugins
const (
ErrSettingTransactionGasLimitNotSupported = InvalidArgumentError("setting transaction gas limit is not supported")
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AutomationProvider ¶
type AutomationProvider interface { PluginProvider Registry() automation.Registry Encoder() automation.Encoder TransmitEventProvider() automation.EventProvider BlockSubscriber() automation.BlockSubscriber PayloadBuilder() automation.PayloadBuilder UpkeepStateStore() automation.UpkeepStateStore LogEventProvider() automation.LogEventProvider LogRecoverer() automation.LogRecoverer UpkeepProvider() automation.ConditionalUpkeepProvider }
AutomationProvider provides components needed for the automation OCR2 plugin.
type BatchGetLatestValuesRequest ¶
type BatchGetLatestValuesRequest map[BoundContract]ContractBatch
BatchGetLatestValuesRequest string is contract name.
type BatchGetLatestValuesResult ¶
type BatchGetLatestValuesResult map[BoundContract]ContractBatchResults
type BatchReadResult ¶
type BatchReadResult struct { ReadName string // contains filtered or unexported fields }
func (*BatchReadResult) GetResult ¶
func (brr *BatchReadResult) GetResult() (any, error)
GetResult returns an error if this specific read from the batch failed, otherwise returns the result in format that was provided in the request.
func (*BatchReadResult) SetResult ¶
func (brr *BatchReadResult) SetResult(returnValue any, err error)
type BoundContract ¶
func (BoundContract) ReadIdentifier ¶ added in v0.2.2
func (bc BoundContract) ReadIdentifier(readName string) string
func (BoundContract) String ¶ added in v0.2.2
func (bc BoundContract) String() string
type CCIPCommitFactoryGenerator ¶
type CCIPCommitFactoryGenerator interface {
NewCommitFactory(ctx context.Context, provider CCIPCommitProvider) (ReportingPluginFactory, error)
}
type CCIPCommitProvider ¶
type CCIPCommitProvider interface { PluginProvider NewCommitStoreReader(ctx context.Context, addr ccip.Address) (ccip.CommitStoreReader, error) NewOffRampReader(ctx context.Context, addr ccip.Address) (ccip.OffRampReader, error) NewOnRampReader(ctx context.Context, addr ccip.Address, sourceSelector uint64, destSelector uint64) (ccip.OnRampReader, error) NewPriceGetter(ctx context.Context) (ccip.PriceGetter, error) NewPriceRegistryReader(ctx context.Context, addr ccip.Address) (ccip.PriceRegistryReader, error) SourceNativeToken(ctx context.Context, addr ccip.Address) (ccip.Address, error) }
type CCIPExecProvider ¶
type CCIPExecProvider interface { PluginProvider GetTransactionStatus(ctx context.Context, transactionID string) (TransactionStatus, error) NewCommitStoreReader(ctx context.Context, addr ccip.Address) (ccip.CommitStoreReader, error) NewOffRampReader(ctx context.Context, addr ccip.Address) (ccip.OffRampReader, error) NewOnRampReader(ctx context.Context, addr ccip.Address, sourceSelector uint64, destSelector uint64) (ccip.OnRampReader, error) NewPriceRegistryReader(ctx context.Context, addr ccip.Address) (ccip.PriceRegistryReader, error) NewTokenDataReader(ctx context.Context, tokenAddress ccip.Address) (ccip.TokenDataReader, error) NewTokenPoolBatchedReader(ctx context.Context, offRampAddress ccip.Address, sourceSelector uint64) (ccip.TokenPoolBatchedReader, error) SourceNativeToken(ctx context.Context, addr ccip.Address) (ccip.Address, error) }
type CCIPExecutionFactoryGenerator ¶
type CCIPExecutionFactoryGenerator interface {
NewExecutionFactory(ctx context.Context, srcProvider CCIPExecProvider, dstProvider CCIPExecProvider, srcChainID int64, dstChainID int64, sourceTokenAddress string) (ReportingPluginFactory, error)
}
type CCIPFactoryGenerator ¶
type CCIPFactoryGenerator interface { CCIPCommitFactoryGenerator CCIPExecutionFactoryGenerator }
type CCIPOCR3CommitProvider ¶
type CCIPOCR3CommitProvider interface { PluginProvider ReportCodec(ctx context.Context) (ccipocr3.CommitPluginCodec, error) MsgHasher(ctx context.Context) (ccipocr3.MessageHasher, error) }
type CCIPOCR3ExecuteProvider ¶
type CCIPOCR3ExecuteProvider interface { PluginProvider ReportCodec(ctx context.Context) (ccipocr3.ExecutePluginCodec, error) MsgHasher(ctx context.Context) (ccipocr3.MessageHasher, error) }
type ChainFeeComponents ¶
type ChainFeeComponents struct { // The cost of executing transaction in the chain's EVM (or the L2 environment). ExecutionFee *big.Int // The cost associated with an L2 posting a transaction's data to the L1. DataAvailabilityFee *big.Int }
ChainFeeComponents contains the different cost components of executing a transaction.
type ChainService ¶
type ChainService interface { Service // LatestHead returns the latest head for the underlying chain. LatestHead(ctx context.Context) (Head, error) // GetChainStatus returns the ChainStatus for this Relayer. GetChainStatus(ctx context.Context) (ChainStatus, error) // ListNodeStatuses returns the status of RPC nodes. ListNodeStatuses(ctx context.Context, pageSize int32, pageToken string) (stats []NodeStatus, nextPageToken string, total int, err error) // Transact submits a transaction to transfer tokens. // If balanceCheck is true, the balance will be checked before submitting. Transact(ctx context.Context, from, to string, amount *big.Int, balanceCheck bool) error }
ChainService is a sub-interface that encapsulates the explicit interactions with a chain, rather than through a provider.
type ChainStatus ¶
type Codec ¶
Codec is an interface that provides encoding and decoding functionality for a specific type identified by a name. Because there are many types that a ContractReader or ContractWriter can either accept or return, all encoding instructions provided by the codec are based on the type name.
Starting from the lowest level, take for instance a big.Int encoder where we want the output to be big endian binary encoded.
typeCodec, _ := binary.BigEndian().BigInt(32, true)
This allows us to encode and decode big.Int values with big endian encoding using the [encodings.TypeCodec] interface.
encodedBytes := []byte{} originalValue := big.NewInt(42) encodedBytes, _ = typeCodec.Encode(originalValue, encodedBytes) // new encoded bytes are appended to existing value, _, _ := typeCodec.Decode(encodedBytes, value)
The additional [encodings.TypeCodec] methods such as 'GetType() reflect.Type' allow composition. This is useful for creating a struct codec such as the one defined in encodings/struct.go.
tlCodec, _ := encodings.NewStructCodec([]encodings.NamedTypeCodec{{Name: "Value", Codec: typeCodec}})
This provides a [encodings.TopLevelCodec] which is a [encodings.TypeCodec] with a total size of all encoded elements. Going up another level, we create a Codec from a map of [encodings.TypeCodec] instances using [encodings.CodecFromTypeCodec].
codec := encodings.CodecFromTypeCodec{"SomeStruct": tlCodec} type SomeStruct struct { Value *big.Int } encodedStructBytes, _ := codec.Encode(ctx, SomeStruct{Value: big.NewInt(42)}, "SomeStruct") var someStruct SomeStruct _ = codec.Decode(encodedStructBytes, &someStruct, "SomeStruct")
Therefore 'itemType' passed to [Encode] and [Decode] references the key in the map of [encodings.TypeCodec] instances. Also worth noting that a `TopLevelCodec` can also be added to a `CodecFromTypeCodec` map. This allows for the [encodings.SizeAtTopLevel] method to be referenced when [encodings.GetMaxEncodingSize] is called on the Codec.
Also, when the type is unknown to the caller, the decoded type for an 'itemName' can be retrieved from the codec to be used for decoding. The `CreateType` method returns an instance of the expected type using reflection under the hood and the overall composition of `TypeCodec` instances. This allows proper types to be conveyed to the caller through the GRPC interface where data may be JSON encoded, passed through GRPC, and JSON decoded on the other side.
decodedStruct, _ := codec.CreateType("SomeStruct", false) _ = codec.Decode(encodedStructBytes, &decodedStruct, "SomeStruct")
The `encodings` package provides a `Builder` interface that allows for the creation of any encoding type. This is useful for creating custom encodings such as the EVM ABI encoding. An encoder implements the `Builder` interface and plugs directly into `TypeCodec`.
From the perspective of a `ContractReader` instance, the `itemType` at the top level is the `readIdentifier` which can be imagined as `contractName + methodName` given that a contract method call returns some configured value that would need its own codec. Each implementation of `ContractReader` maps the names to codecs differently on the inside, but from the level of the interface, the `itemType` is the `readIdentifier`.
Example ¶
ExampleCodec provides a minimal example of constructing and using a codec.
package main import ( "context" "fmt" "math/big" "github.com/smartcontractkit/chainlink-common/pkg/codec/encodings" "github.com/smartcontractkit/chainlink-common/pkg/codec/encodings/binary" ) func main() { ctx := context.Background() typeCodec, _ := binary.BigEndian().BigInt(32, true) // start with empty encoded bytes encodedBytes := []byte{} originalValue := big.NewInt(42) encodedBytes, _ = typeCodec.Encode(originalValue, encodedBytes) // new encoded bytes are appended to existing value, _, _ := typeCodec.Decode(encodedBytes) // originalValue is the same as value fmt.Printf("%+v == %+v\n", originalValue, value) // TopLevelCodec is a TypeCodec that has a total size of all encoded elements tlCodec, _ := encodings.NewStructCodec([]encodings.NamedTypeCodec{{Name: "Value", Codec: typeCodec}}) codec := encodings.CodecFromTypeCodec{"SomeStruct": tlCodec} type SomeStruct struct { Value *big.Int } originalStruct := SomeStruct{Value: big.NewInt(42)} encodedStructBytes, _ := codec.Encode(ctx, originalStruct, "SomeStruct") var someStruct SomeStruct _ = codec.Decode(ctx, encodedStructBytes, &someStruct, "SomeStruct") decodedStruct, _ := codec.CreateType("SomeStruct", false) _ = codec.Decode(ctx, encodedStructBytes, &decodedStruct, "SomeStruct") // encoded struct is equal to decoded struct using defined type and/or CreateType fmt.Printf("%+v == %+v == %+v\n", originalStruct, someStruct, decodedStruct) }
Output:
type ConfigProvider ¶
type ConfigProvider interface { Service OffchainConfigDigester() ocrtypes.OffchainConfigDigester ContractConfigTracker() ocrtypes.ContractConfigTracker }
The bootstrap jobs only watch config.
type ContractBatch ¶
type ContractBatch []BatchRead
type ContractBatchResults ¶
type ContractBatchResults []BatchReadResult
type ContractKeyFilter ¶ added in v0.4.0
type ContractKeyFilter struct { query.KeyFilter Contract BoundContract SequenceDataType any }
type ContractReader ¶
type ContractReader interface { services.Service // GetLatestValue gets the latest value with a certain confidence level that maps to blockchain finality.... // The params argument can be any object which maps a set of generic parameters into chain specific parameters defined in RelayConfig. // It must encode as an object via [json.Marshal] and [github.com/fxamacker/cbor/v2.Marshal]. // Typically, would be either a struct with field names mapping to arguments, or anonymous map such as `map[string]any{"baz": 42, "test": true}}` // // returnVal must [json.Unmarshal] and and [github.com/fxamacker/cbor/v2.Marshal] as an object. // // Example use: // type ProductParams struct { // ID int `json:"id"` // } // type ProductReturn struct { // Foo string `json:"foo"` // Bar *big.Int `json:"bar"` // } // func do(ctx context.Context, cr ContractReader) (resp ProductReturn, err error) { // err = cr.GetLatestValue(ctx, "FooContract", "GetProduct", primitives.Finalized, ProductParams{ID:1}, &resp) // return // } // // Note that implementations should ignore extra fields in params that are not expected in the call to allow easier // use across chains and contract versions. // Similarly, when using a struct for returnVal, fields in the return value that are not on-chain will not be set. // Passing in a *values.Value as the returnVal will encode the return value as an appropriate value.Value instance. GetLatestValue(ctx context.Context, readIdentifier string, confidenceLevel primitives.ConfidenceLevel, params, returnVal any) error // GetLatestValueWithHeadData should be used in the same way as GetLatestValue, but also returns the head data if available. GetLatestValueWithHeadData(ctx context.Context, readIdentifier string, confidenceLevel primitives.ConfidenceLevel, params, returnVal any) (*Head, error) // BatchGetLatestValues batches get latest value calls based on request, which is grouped by contract names that each have a slice of BatchRead. // BatchGetLatestValuesRequest params and returnVal follow same rules as GetLatestValue params and returnVal arguments, with difference in how response is returned. // BatchGetLatestValuesResult response is grouped by contract names, which contain read results that maintain the order from the request. // Contract call errors are returned in the Err field of BatchGetLatestValuesResult. BatchGetLatestValues(ctx context.Context, request BatchGetLatestValuesRequest) (BatchGetLatestValuesResult, error) // Bind will add provided bindings and will return an error if the contract is not known by the ContractReader, or if // the Address is invalid. Any provided binding that already exists should result in a noop. Bind(ctx context.Context, bindings []BoundContract) error // Unbind will remove all provided bindings. Unbind(ctx context.Context, bindings []BoundContract) error // QueryKey provides fetching chain agnostic events (Sequence) with general querying capability. QueryKey(ctx context.Context, contract BoundContract, filter query.KeyFilter, limitAndSort query.LimitAndSort, sequenceDataType any) ([]Sequence, error) // QueryKeys provides fetching chain agnostic events (Sequence) of different types with general querying capability. // The iterator returns a pair of key and sequence. QueryKeys(ctx context.Context, filters []ContractKeyFilter, limitAndSort query.LimitAndSort) (iter.Seq2[string, Sequence], error) // HealthReport returns a full health report of the callee including its dependencies. // Keys are based on Name(), with nil values when healthy or errors otherwise. // Use CopyHealth to collect reports from sub-services. // This should run very fast, so avoid doing computation and instead prefer reporting pre-calculated state. // On finality violation report must contain at least one ErrFinalityViolation. HealthReport() map[string]error // contains filtered or unexported methods }
ContractReader defines essential read operations a chain should implement for reading contract values and events.
type ContractTypeProvider ¶
type ContractWriter ¶ added in v0.4.0
type ContractWriter interface { services.Service // SubmitTransaction packs and broadcasts a transaction to the underlying chain contract. // // - `args` should be any object which maps a set of method param into the contract and method specific method params. // - `transactionID` will be used by the underlying TXM as an idempotency key, and unique reference to track transaction attempts. SubmitTransaction(ctx context.Context, contractName, method string, args any, transactionID string, toAddress string, meta *TxMeta, value *big.Int) error // GetTransactionStatus returns the current status of a transaction in the underlying chain's TXM. GetTransactionStatus(ctx context.Context, transactionID string) (TransactionStatus, error) // GetFeeComponents retrieves the associated gas costs for executing a transaction. GetFeeComponents(ctx context.Context) (*ChainFeeComponents, error) }
type Decoder ¶
type Decoder interface { Decode(ctx context.Context, raw []byte, into any, itemType string) error // GetMaxDecodingSize returns the max size in bytes if n elements are supplied for all top level dynamically sized elements. // If no elements are dynamically sized, the returned value will be the same for all n. // If there are multiple levels of dynamically sized elements, or itemType cannot be found, // ErrInvalidType will be returned. GetMaxDecodingSize(ctx context.Context, n int, itemType string) (int, error) }
type Encoder ¶
type Encoder interface { Encode(ctx context.Context, item any, itemType string) ([]byte, error) // GetMaxEncodingSize returns the max size in bytes if n elements are supplied for all top level dynamically sized elements. // If no elements are dynamically sized, the returned value will be the same for all n. // If there are multiple levels of dynamically sized elements, or itemType cannot be found, // ErrInvalidType will be returned. GetMaxEncodingSize(ctx context.Context, n int, itemType string) (int, error) }
type FunctionsEvents ¶
type FunctionsEvents interface { Service LatestEvents() ([]OracleRequest, []OracleResponse, error) }
An on-chain event source, which understands router proxy contracts.
type FunctionsProvider ¶
type FunctionsProvider interface { PluginProvider FunctionsEvents() FunctionsEvents }
type InternalError ¶
type InternalError string
func (InternalError) Error ¶
func (e InternalError) Error() string
func (InternalError) GRPCStatus ¶
func (e InternalError) GRPCStatus() *status.Status
func (InternalError) Is ¶
func (e InternalError) Is(target error) bool
type InvalidArgumentError ¶
type InvalidArgumentError string
func (InvalidArgumentError) Error ¶
func (e InvalidArgumentError) Error() string
func (InvalidArgumentError) GRPCStatus ¶
func (e InvalidArgumentError) GRPCStatus() *status.Status
func (InvalidArgumentError) Is ¶
func (e InvalidArgumentError) Is(target error) bool
type LLOConfigProvider ¶ added in v0.4.0
type LLOConfigProvider interface { OffchainConfigDigester() ocrtypes.OffchainConfigDigester // One instance will be run per config tracker ContractConfigTrackers() []ocrtypes.ContractConfigTracker }
type LLOProvider ¶
type LLOProvider interface { Service LLOConfigProvider ShouldRetireCache() llo.ShouldRetireCache ContractTransmitter() llo.Transmitter ChannelDefinitionCache() llo.ChannelDefinitionCache }
type MedianProvider ¶
type MedianProvider interface { PluginProvider ReportCodec() median.ReportCodec MedianContract() median.MedianContract OnchainConfigCodec() median.OnchainConfigCodec }
MedianProvider provides all components needed for a median OCR2 plugin.
type MercuryCredentials ¶
type MercuryPluginFactory ¶
type MercuryPluginFactory interface { Service ocr3types.MercuryPluginFactory }
type MercuryProvider ¶
type MercuryProvider interface { PluginProvider ReportCodecV1() v1.ReportCodec ReportCodecV2() v2.ReportCodec ReportCodecV3() v3.ReportCodec ReportCodecV4() v4.ReportCodec OnchainConfigCodec() mercury.OnchainConfigCodec MercuryServerFetcher() mercury.ServerFetcher MercuryChainReader() mercury.ChainReader }
MercuryProvider provides components needed for a mercury OCR2 plugin. Mercury requires config tracking but does not transmit on-chain.
type NodeStatus ¶
type NotFoundError ¶
type NotFoundError string
func (NotFoundError) Error ¶
func (e NotFoundError) Error() string
func (NotFoundError) GRPCStatus ¶
func (e NotFoundError) GRPCStatus() *status.Status
func (NotFoundError) Is ¶
func (e NotFoundError) Is(target error) bool
type OCR2PluginType ¶
type OCR2PluginType string
OCR2PluginType defines supported OCR2 plugin types.
const ( Median OCR2PluginType = "median" DKG OCR2PluginType = "dkg" OCR2VRF OCR2PluginType = "ocr2vrf" // TODO: sc-55296 to rename ocr2keeper to ocr2automation in code OCR2Keeper OCR2PluginType = "ocr2automation" Functions OCR2PluginType = "functions" Mercury OCR2PluginType = "mercury" LLO OCR2PluginType = "llo" GenericPlugin OCR2PluginType = "plugin" OCR3Capability OCR2PluginType = "ocr3-capability" CCIPCommit OCR2PluginType = "ccip-commit" CCIPExecution OCR2PluginType = "ccip-execution" )
type OCR3CapabilityProvider ¶
type OCR3CapabilityProvider interface { PluginProvider OCR3ContractTransmitter }
type OCR3ContractTransmitter ¶
type OCR3ContractTransmitter interface {
OCR3ContractTransmitter() ocr3types.ContractTransmitter[[]byte]
}
type OracleRequest ¶
type OracleRequest struct { RequestID [32]byte RequestingContract ocrtypes.Account RequestInitiator ocrtypes.Account //nolint:revive SubscriptionId uint64 SubscriptionOwner ocrtypes.Account Data []byte DataVersion uint16 Flags [32]byte CallbackGasLimit uint64 TxHash []byte CoordinatorContract ocrtypes.Account OnchainMetadata []byte }
type OracleResponse ¶
type OracleResponse struct {
RequestID [32]byte
}
type Plugin ¶
type Plugin = PluginProvider
Plugin is an alias for PluginProvider, for compatibility. Deprecated
type PluginArgs ¶
PluginArgs are the args required to create any OCR2 plugin components. It's possible that the plugin config might actually be different per relay type, so we pass the config directly through.
type PluginMercury ¶
type PluginMercury interface { NewMercuryV1Factory(ctx context.Context, provider MercuryProvider, dataSource v1.DataSource) (MercuryPluginFactory, error) NewMercuryV2Factory(ctx context.Context, provider MercuryProvider, dataSource v2.DataSource) (MercuryPluginFactory, error) NewMercuryV3Factory(ctx context.Context, provider MercuryProvider, dataSource v3.DataSource) (MercuryPluginFactory, error) NewMercuryV4Factory(ctx context.Context, provider MercuryProvider, dataSource v4.DataSource) (MercuryPluginFactory, error) }
type PluginProvider ¶
type PluginProvider interface { ConfigProvider ContractTransmitter() ocrtypes.ContractTransmitter ContractReader() ContractReader Codec() Codec }
PluginProvider provides common components for any OCR2 plugin. It watches config and is able to transmit.
type RelayArgs ¶
type RelayArgs struct { ExternalJobID uuid.UUID JobID int32 OracleSpecID int32 ContractID string New bool // Whether this is a first time job add. RelayConfig []byte // The specific configuration of a given relayer instance. Will vary by relayer type. ProviderType string MercuryCredentials *MercuryCredentials }
RelayArgs are the args required to create relayer. The are common to all relayer implementations.
type RelayID ¶
func NewRelayID ¶
func (*RelayID) UnmarshalString ¶
type Relayer ¶
type Relayer interface { ChainService // NewContractWriter returns a new ContractWriter. // The format of config depends on the implementation. NewContractWriter(ctx context.Context, config []byte) (ContractWriter, error) // NewContractReader returns a new ContractReader. // The format of contractReaderConfig depends on the implementation. NewContractReader(ctx context.Context, contractReaderConfig []byte) (ContractReader, error) NewConfigProvider(ctx context.Context, rargs RelayArgs) (ConfigProvider, error) NewMedianProvider(ctx context.Context, rargs RelayArgs, pargs PluginArgs) (MedianProvider, error) NewMercuryProvider(ctx context.Context, rargs RelayArgs, pargs PluginArgs) (MercuryProvider, error) NewFunctionsProvider(ctx context.Context, rargs RelayArgs, pargs PluginArgs) (FunctionsProvider, error) NewAutomationProvider(ctx context.Context, rargs RelayArgs, pargs PluginArgs) (AutomationProvider, error) NewLLOProvider(ctx context.Context, rargs RelayArgs, pargs PluginArgs) (LLOProvider, error) NewCCIPCommitProvider(ctx context.Context, rargs RelayArgs, pargs PluginArgs) (CCIPCommitProvider, error) NewCCIPExecProvider(ctx context.Context, rargs RelayArgs, pargs PluginArgs) (CCIPExecProvider, error) NewPluginProvider(ctx context.Context, rargs RelayArgs, pargs PluginArgs) (PluginProvider, error) NewOCR3CapabilityProvider(ctx context.Context, rargs RelayArgs, pargs PluginArgs) (OCR3CapabilityProvider, error) }
Relayer extends ChainService with providers for each product.
type RemoteCodec ¶
type RemoteCodec interface { Codec TypeProvider }
type ReportingPluginFactory ¶
type ReportingPluginFactory interface { Service libocr.ReportingPluginFactory }
type TransactionStatus ¶
type TransactionStatus int
TransactionStatus are the status we expect every TXM to support and that can be returned by StatusForUUID.
const ( Unknown TransactionStatus = iota Pending Unconfirmed Finalized Failed Fatal )
type TxMeta ¶
type TxMeta struct { // Used for Keystone Workflows WorkflowExecutionID *string // An optional maximum gas limit for the transaction. If not set the ContractWriter implementation will be responsible for // setting a gas limit for the transaction. If it is set and the ContractWriter implementation does not support setting // this value per transaction it will return ErrSettingTransactionGasLimitNotSupported GasLimit *big.Int }
TxMeta contains metadata fields for a transaction.
type TypeProvider ¶
type UnimplementedContractReader ¶ added in v0.2.2
type UnimplementedContractReader struct{}
func (UnimplementedContractReader) BatchGetLatestValues ¶ added in v0.2.2
func (UnimplementedContractReader) BatchGetLatestValues(ctx context.Context, request BatchGetLatestValuesRequest) (BatchGetLatestValuesResult, error)
func (UnimplementedContractReader) Bind ¶ added in v0.2.2
func (UnimplementedContractReader) Bind(ctx context.Context, bindings []BoundContract) error
func (UnimplementedContractReader) Close ¶ added in v0.2.2
func (UnimplementedContractReader) Close() error
func (UnimplementedContractReader) GetLatestValue ¶ added in v0.2.2
func (UnimplementedContractReader) GetLatestValue(ctx context.Context, readIdentifier string, confidenceLevel primitives.ConfidenceLevel, params, returnVal any) error
func (UnimplementedContractReader) GetLatestValueWithHeadData ¶ added in v0.4.0
func (UnimplementedContractReader) GetLatestValueWithHeadData(ctx context.Context, readIdentifier string, confidenceLevel primitives.ConfidenceLevel, params, returnVal any) (*Head, error)
func (UnimplementedContractReader) HealthReport ¶ added in v0.2.2
func (UnimplementedContractReader) HealthReport() map[string]error
func (UnimplementedContractReader) Name ¶ added in v0.2.2
func (UnimplementedContractReader) Name() string
func (UnimplementedContractReader) QueryKey ¶ added in v0.2.2
func (UnimplementedContractReader) QueryKey(ctx context.Context, boundContract BoundContract, filter query.KeyFilter, limitAndSort query.LimitAndSort, sequenceDataType any) ([]Sequence, error)
func (UnimplementedContractReader) QueryKeys ¶ added in v0.4.0
func (UnimplementedContractReader) QueryKeys(ctx context.Context, keyQueries []ContractKeyFilter, limitAndSort query.LimitAndSort) (iter.Seq2[string, Sequence], error)
func (UnimplementedContractReader) Ready ¶ added in v0.2.2
func (UnimplementedContractReader) Ready() error
func (UnimplementedContractReader) Start ¶ added in v0.2.2
func (UnimplementedContractReader) Start(context.Context) error
func (UnimplementedContractReader) Unbind ¶ added in v0.2.2
func (UnimplementedContractReader) Unbind(ctx context.Context, bindings []BoundContract) error
type UnimplementedError ¶
type UnimplementedError string
func (UnimplementedError) Error ¶
func (e UnimplementedError) Error() string
func (UnimplementedError) GRPCStatus ¶
func (e UnimplementedError) GRPCStatus() *status.Status
func (UnimplementedError) Is ¶
func (e UnimplementedError) Is(target error) bool