Documentation
¶
Overview ¶
Package client handles connections between chainlink nodes and different blockchain networks
Index ¶
- Constants
- Variables
- func ObservationSourceSpecBridge(bta BridgeTypeAttributes) string
- func ObservationSourceSpecHTTP(url string) string
- type BasicHTTPClient
- type BlockchainClient
- type BlockchainNetwork
- type BlockchainNetworkInit
- type BlockchainWallet
- type BlockchainWallets
- type BridgeType
- type BridgeTypeAttributes
- type BridgeTypeData
- type Chainlink
- type ChainlinkConfig
- type ContractDeployer
- type CronJobSpec
- type DirectRequestJobSpec
- type DirectRequestTxPipelineSpec
- type EIAttributes
- type EIKey
- type EIKeyCreate
- type EIKeys
- type ETHKey
- type ETHKeyAttributes
- type ETHKeyData
- type ETHKeys
- type EthereumClient
- func (e *EthereumClient) AddHeaderEventSubscription(key string, subscriber HeaderEventSubscription)
- func (e *EthereumClient) BlockNumber(ctx context.Context) (uint64, error)
- func (e *EthereumClient) BorrowedNonces(n bool)
- func (e *EthereumClient) CalculateTxGas(gasUsed *big.Int) (*big.Float, error)
- func (e *EthereumClient) Close() error
- func (e *EthereumClient) DeleteHeaderEventSubscription(key string)
- func (e *EthereumClient) DeployContract(fromWallet BlockchainWallet, contractName string, deployer ContractDeployer) (*common.Address, *types.Transaction, interface{}, error)
- func (e *EthereumClient) Fund(fromWallet BlockchainWallet, toAddress string, ...) error
- func (e *EthereumClient) Get() interface{}
- func (e *EthereumClient) GetHeaderSubscriptions() map[string]HeaderEventSubscription
- func (e *EthereumClient) GetNonce(ctx context.Context, addr common.Address) (uint64, error)
- func (e *EthereumClient) HeaderTimestampByNumber(ctx context.Context, bn *big.Int) (uint64, error)
- func (e *EthereumClient) ParallelTransactions(enabled bool)
- func (e *EthereumClient) ProcessTransaction(txHash common.Hash) error
- func (e *EthereumClient) SendTransaction(from BlockchainWallet, to common.Address, value *big.Float, data []byte) (common.Hash, error)
- func (e *EthereumClient) TransactionCallMessage(from BlockchainWallet, to common.Address, value *big.Int, data []byte) (*ethereum.CallMsg, error)
- func (e *EthereumClient) TransactionOpts(from BlockchainWallet, to common.Address, value *big.Int, data []byte) (*bind.TransactOpts, error)
- func (e *EthereumClient) WaitForEvents() error
- type EthereumNetwork
- func (e *EthereumNetwork) ChainID() *big.Int
- func (e *EthereumNetwork) Config() *config.NetworkConfig
- func (e *EthereumNetwork) FluxMonitorSubmissionGasUsed() (*big.Int, error)
- func (e *EthereumNetwork) ID() string
- func (e *EthereumNetwork) SetURL(newURL string)
- func (e *EthereumNetwork) Type() string
- func (e *EthereumNetwork) URL() string
- func (e *EthereumNetwork) Wallets() (BlockchainWallets, error)
- type EthereumWallet
- type ExplorerClient
- type FluxMonitorJobSpec
- type GasUsedEstimations
- type HeaderEventSubscription
- type InstantConfirmations
- type Job
- type JobData
- type JobForm
- type JobRunsResponse
- type JobSpec
- type KeeperJobSpec
- type Name
- type NodeAccessKeys
- type OCRBootstrapJobSpec
- type OCRKey
- type OCRKeyAttributes
- type OCRKeyData
- type OCRKeys
- type OCRTaskJobSpec
- type P2PData
- type P2PKey
- type P2PKeyAttributes
- type P2PKeyData
- type P2PKeys
- type PipelineSpec
- type Prometheus
- type ResourcesSummary
- type Response
- type ResponseSlice
- type RunInputs
- type RunsAttributesResponse
- type RunsMetaResponse
- type RunsResponseData
- type Session
- type Spec
- type SpecData
- type SpecForm
- type TransactionConfirmer
- type VRFJobSpec
- type VRFKey
- type VRFKeyAttributes
- type VRFKeys
- type VRFTxPipelineSpec
- type Wallets
- type WebhookJobSpec
Constants ¶
const ( QueryMemoryUsage = `` /* 201-byte string literal not displayed */ QueryAllCPUBusyPercentage = `100 - (avg by (instance) (irate(node_cpu_seconds_total{mode="idle"}[%s])) * 100)` )
const BlockchainTypeEVM = "evm"
Variables ¶
var ErrNotFound = errors.New("unexpected response code, got 404")
var ErrUnprocessableEntity = errors.New("unexpected response code, got 422")
var OneEth = big.NewFloat(1e18)
var OneGWei = big.NewInt(1e9)
var OneLINK = big.NewFloat(1e18)
Functions ¶
func ObservationSourceSpecBridge ¶
func ObservationSourceSpecBridge(bta BridgeTypeAttributes) string
ObservationSourceSpecBridge creates a bridge task spec for json data
func ObservationSourceSpecHTTP ¶
ObservationSourceSpecHTTP creates a http GET task spec for json data
Types ¶
type BasicHTTPClient ¶
type BasicHTTPClient struct { BaseURL string HttpClient *http.Client Cookies []*http.Cookie Header http.Header }
BasicHTTPClient handles basic http sending logic and cookie handling
func NewBasicHTTPClient ¶
func NewBasicHTTPClient(c *http.Client, baseURL string) *BasicHTTPClient
NewBasicHTTPClient returns new basic http client configured with an base URL
type BlockchainClient ¶
type BlockchainClient interface { BlockNumber(ctx context.Context) (uint64, error) HeaderTimestampByNumber(ctx context.Context, bn *big.Int) (uint64, error) Get() interface{} CalculateTxGas(gasUsedValue *big.Int) (*big.Float, error) Fund(fromWallet BlockchainWallet, toAddress string, nativeAmount, linkAmount *big.Float) error ParallelTransactions(enabled bool) Close() error AddHeaderEventSubscription(key string, subscriber HeaderEventSubscription) DeleteHeaderEventSubscription(key string) WaitForEvents() error }
BlockchainClient is the interface that wraps a given client implementation for a blockchain, to allow for switching of network types within the test suite
func NewBlockchainClient ¶
func NewBlockchainClient(network BlockchainNetwork) (BlockchainClient, error)
NewBlockchainClient returns an instantiated network client implementation based on the network configuration given
type BlockchainNetwork ¶
type BlockchainNetwork interface { GasUsedEstimations ID() string URL() string Type() string SetURL(string) ChainID() *big.Int Wallets() (BlockchainWallets, error) Config() *config.NetworkConfig }
BlockchainNetwork is the interface that when implemented, defines a new blockchain network that can be tested against
func NewNetworkFromConfig ¶
func NewNetworkFromConfig(conf *config.Config) (BlockchainNetwork, error)
NewNetworkFromConfig prepares settings for a connection to a hardhat blockchain
type BlockchainNetworkInit ¶
type BlockchainNetworkInit func(conf *config.Config) (BlockchainNetwork, error)
BlockchainNetworkInit is a helper function to obtain different blockchain networks
type BlockchainWallet ¶
BlockchainWallet when implemented is the interface to allow multiple wallet implementations for each BlockchainNetwork that is supported
type BlockchainWallets ¶
type BlockchainWallets interface { Default() BlockchainWallet All() []BlockchainWallet SetDefault(i int) error Wallet(i int) (BlockchainWallet, error) }
BlockchainWallets is an interface that when implemented is a representation of a slice of wallets for a specific network
type BridgeType ¶
type BridgeType struct {
Data BridgeTypeData `json:"data"`
}
BridgeType is the model that represents the bridge when read or created on a Chainlink node
type BridgeTypeAttributes ¶
type BridgeTypeAttributes struct { Name string `json:"name"` URL string `json:"url"` RequestData string `json:"requestData,omitempty"` }
BridgeTypeAttributes is the model that represents the bridge when read or created on a Chainlink node
type BridgeTypeData ¶
type BridgeTypeData struct {
Attributes BridgeTypeAttributes `json:"attributes"`
}
BridgeTypeData is the model that represents the bridge when read or created on a Chainlink node
type Chainlink ¶
type Chainlink interface { URL() string CreateJob(spec JobSpec) (*Job, error) CreateJobRaw(spec string) (*Job, error) ReadJobs() (*ResponseSlice, error) ReadJob(id string) (*Response, error) DeleteJob(id string) error CreateSpec(spec string) (*Spec, error) ReadSpec(id string) (*Response, error) DeleteSpec(id string) error CreateBridge(bta *BridgeTypeAttributes) error ReadBridge(name string) (*BridgeType, error) DeleteBridge(name string) error ReadRunsByJob(jobID string) (*JobRunsResponse, error) CreateOCRKey() (*OCRKey, error) ReadOCRKeys() (*OCRKeys, error) DeleteOCRKey(id string) error CreateP2PKey() (*P2PKey, error) ReadP2PKeys() (*P2PKeys, error) DeleteP2PKey(id int) error ReadETHKeys() (*ETHKeys, error) ReadVRFKeys() (*VRFKeys, error) PrimaryEthAddress() (string, error) CreateEI(eia *EIAttributes) (*EIKeyCreate, error) ReadEIs() (*EIKeys, error) DeleteEI(name string) error RemoteIP() string SetSessionCookie() error SetPageSize(size int) // SetClient is used for testing SetClient(client *http.Client) }
Chainlink interface that enables interactions with a chainlink node
func NewChainlink ¶
func NewChainlink(c *ChainlinkConfig, httpClient *http.Client) (Chainlink, error)
NewChainlink creates a new chainlink model using a provided config
type ChainlinkConfig ¶
ChainlinkConfig represents the variables needed to connect to a Chainlink node
type ContractDeployer ¶
type ContractDeployer func(auth *bind.TransactOpts, backend bind.ContractBackend) ( common.Address, *types.Transaction, interface{}, error, )
ContractDeployer acts as a go-between function for general contract deployment
type CronJobSpec ¶
type CronJobSpec struct { Schedule string `toml:"schedule"` // CRON job style schedule string ObservationSource string `toml:"observationSource"` // List of commands for the chainlink node }
CronJobSpec represents a cron job spec
func (*CronJobSpec) String ¶
func (c *CronJobSpec) String() (string, error)
func (*CronJobSpec) Type ¶
func (c *CronJobSpec) Type() string
type DirectRequestJobSpec ¶
type DirectRequestJobSpec struct { Name string `toml:"name"` ContractAddress string `toml:"contractAddress"` ExternalJobID string `toml:"externalJobID"` ObservationSource string `toml:"observationSource"` // List of commands for the chainlink node }
DirectRequestJobSpec represents a direct request spec
func (*DirectRequestJobSpec) String ¶
func (d *DirectRequestJobSpec) String() (string, error)
func (*DirectRequestJobSpec) Type ¶
func (d *DirectRequestJobSpec) Type() string
type DirectRequestTxPipelineSpec ¶
type DirectRequestTxPipelineSpec struct { BridgeTypeAttributes BridgeTypeAttributes DataPath string }
DirectRequestTxPipelineSpec oracle request with tx callback
func (*DirectRequestTxPipelineSpec) String ¶
func (d *DirectRequestTxPipelineSpec) String() (string, error)
func (*DirectRequestTxPipelineSpec) Type ¶
func (d *DirectRequestTxPipelineSpec) Type() string
type EIAttributes ¶
type EIAttributes struct { Name string `json:"name,omitempty"` URL string `json:"url,omitempty"` IncomingAccessKey string `json:"incomingAccessKey,omitempty"` AccessKey string `json:"accessKey,omitempty"` Secret string `json:"incomingSecret,omitempty"` OutgoingToken string `json:"outgoingToken,omitempty"` OutgoingSecret string `json:"outgoingSecret,omitempty"` }
EIAttributes is the model that represents the EI keys when created and read
type EIKey ¶
type EIKey struct {
Attributes EIAttributes `json:"attributes"`
}
EIKey is the model that represents the EI configs when read
type EIKeyCreate ¶
type EIKeyCreate struct {
Data EIKey `json:"data"`
}
EIKeyCreate is the model that represents the EI config when created
type EIKeys ¶
type EIKeys struct {
Data []EIKey `json:"data"`
}
EIKeys is the model that represents the EI configs when read
type ETHKey ¶
type ETHKey struct {
Data ETHKeyData `json:"data"`
}
ETHKey is the model that represents the created ETH keys when read
type ETHKeyAttributes ¶
type ETHKeyAttributes struct {
Address string `json:"address"`
}
ETHKeyAttributes is the model that represents the created ETH keys when read
type ETHKeyData ¶
type ETHKeyData struct {
Attributes ETHKeyAttributes `json:"attributes"`
}
ETHKeyData is the model that represents the created ETH keys when read
type ETHKeys ¶
type ETHKeys struct {
Data []ETHKeyData `json:"data"`
}
ETHKeys is the model that represents the created ETH keys when read
type EthereumClient ¶
type EthereumClient struct { Client *ethclient.Client Network BlockchainNetwork BorrowNonces bool NonceMu *sync.Mutex Nonces map[string]uint64 // contains filtered or unexported fields }
EthereumClient wraps the client and the BlockChain network to interact with an EVM based Blockchain
func NewEthereumClient ¶
func NewEthereumClient(network BlockchainNetwork) (*EthereumClient, error)
NewEthereumClient returns an instantiated instance of the Ethereum client that has connected to the server
func (*EthereumClient) AddHeaderEventSubscription ¶
func (e *EthereumClient) AddHeaderEventSubscription(key string, subscriber HeaderEventSubscription)
AddHeaderEventSubscription adds a new header subscriber within the client to receive new headers
func (*EthereumClient) BlockNumber ¶
func (e *EthereumClient) BlockNumber(ctx context.Context) (uint64, error)
BlockNumber gets latest block number
func (*EthereumClient) BorrowedNonces ¶
func (e *EthereumClient) BorrowedNonces(n bool)
BorrowedNonces allows to handle nonces concurrently without requesting them every time
func (*EthereumClient) CalculateTxGas ¶
CalculateTxGas calculates tx gas cost accordingly gas used plus buffer, converts it to big.Float for funding
func (*EthereumClient) Close ¶
func (e *EthereumClient) Close() error
Close tears down the current open Ethereum client
func (*EthereumClient) DeleteHeaderEventSubscription ¶
func (e *EthereumClient) DeleteHeaderEventSubscription(key string)
DeleteHeaderEventSubscription removes a header subscriber from the map
func (*EthereumClient) DeployContract ¶
func (e *EthereumClient) DeployContract( fromWallet BlockchainWallet, contractName string, deployer ContractDeployer, ) (*common.Address, *types.Transaction, interface{}, error)
DeployContract acts as a general contract deployment tool to an ethereum chain
func (*EthereumClient) Fund ¶
func (e *EthereumClient) Fund( fromWallet BlockchainWallet, toAddress string, ethAmount, linkAmount *big.Float, ) error
Fund funds a specified address with LINK token and or ETH from the given wallet
func (*EthereumClient) Get ¶
func (e *EthereumClient) Get() interface{}
Get returns the underlying client type to be used generically across the framework for switching network types
func (*EthereumClient) GetHeaderSubscriptions ¶
func (e *EthereumClient) GetHeaderSubscriptions() map[string]HeaderEventSubscription
GetHeaderSubscriptions returns a duplicate map of the queued transactions
func (*EthereumClient) GetNonce ¶
GetNonce keep tracking of nonces per address, add last nonce for addr if the map is empty
func (*EthereumClient) HeaderTimestampByNumber ¶
HeaderTimestampByNumber gets header timestamp by number
func (*EthereumClient) ParallelTransactions ¶
func (e *EthereumClient) ParallelTransactions(enabled bool)
ParallelTransactions when enabled, sends the transaction without waiting for transaction confirmations. The hashes are then stored within the client and confirmations can be waited on by calling WaitForEvents. When disabled, the minimum confirmations are waited on when the transaction is sent, so parallelisation is disabled.
func (*EthereumClient) ProcessTransaction ¶
func (e *EthereumClient) ProcessTransaction(txHash common.Hash) error
ProcessTransaction will queue or wait on a transaction depending on whether queue transactions is enabled
func (*EthereumClient) SendTransaction ¶
func (e *EthereumClient) SendTransaction( from BlockchainWallet, to common.Address, value *big.Float, data []byte, ) (common.Hash, error)
SendTransaction sends a specified amount of WEI from a selected wallet to an address, and blocks until the transaction completes
func (*EthereumClient) TransactionCallMessage ¶
func (e *EthereumClient) TransactionCallMessage( from BlockchainWallet, to common.Address, value *big.Int, data []byte, ) (*ethereum.CallMsg, error)
TransactionCallMessage returns a filled Ethereum CallMsg object with suggest gas price and limit
func (*EthereumClient) TransactionOpts ¶
func (e *EthereumClient) TransactionOpts( from BlockchainWallet, to common.Address, value *big.Int, data []byte, ) (*bind.TransactOpts, error)
TransactionOpts return the base binding transaction options to create a new valid tx for contract deployment
func (*EthereumClient) WaitForEvents ¶
func (e *EthereumClient) WaitForEvents() error
WaitForEvents is a blocking function that waits for all event subscriptions that have been queued within the client.
type EthereumNetwork ¶
type EthereumNetwork struct {
// contains filtered or unexported fields
}
EthereumNetwork is the implementation of BlockchainNetwork for the local ETH dev server
func (*EthereumNetwork) ChainID ¶
func (e *EthereumNetwork) ChainID() *big.Int
ChainID returns the on-chain ID of the network being connected to
func (*EthereumNetwork) Config ¶
func (e *EthereumNetwork) Config() *config.NetworkConfig
Config returns the blockchain network configuration
func (*EthereumNetwork) FluxMonitorSubmissionGasUsed ¶
func (e *EthereumNetwork) FluxMonitorSubmissionGasUsed() (*big.Int, error)
FluxMonitorSubmissionGasUsed Flux Monitor one submission gasUsed value
func (*EthereumNetwork) ID ¶
func (e *EthereumNetwork) ID() string
ID returns the readable name of the EVM network
func (*EthereumNetwork) SetURL ¶
func (e *EthereumNetwork) SetURL(newURL string)
SetURL sets the RPC URL, useful for when blockchain URLs might be dynamic
func (*EthereumNetwork) Type ¶
func (e *EthereumNetwork) Type() string
Type returns the readable type of the EVM network
func (*EthereumNetwork) URL ¶
func (e *EthereumNetwork) URL() string
URL returns the RPC URL used for connecting to the network
func (*EthereumNetwork) Wallets ¶
func (e *EthereumNetwork) Wallets() (BlockchainWallets, error)
Wallets returns all the viable wallets used for testing on chain
type EthereumWallet ¶
type EthereumWallet struct {
// contains filtered or unexported fields
}
EthereumWallet is the implementation to allow testing with ETH based wallets
func NewEthereumWallet ¶
func NewEthereumWallet(pk string) (*EthereumWallet, error)
NewEthereumWallet returns the instantiated ETH wallet based on a given private key
func (*EthereumWallet) Address ¶
func (e *EthereumWallet) Address() string
Address returns the ETH address for a given wallet
func (*EthereumWallet) PrivateKey ¶
func (e *EthereumWallet) PrivateKey() string
PrivateKey returns the private key for a given Ethereum wallet
type ExplorerClient ¶
type ExplorerClient struct { *BasicHTTPClient Config *config.ExplorerConfig }
ExplorerClient is used to call Explorer API endpoints
func NewExplorerClient ¶ added in v0.0.3
func NewExplorerClient(cfg *config.ExplorerConfig) *ExplorerClient
NewExplorerClient creates a new explorer mock client
func (*ExplorerClient) PostAdminNodes ¶ added in v0.0.3
func (em *ExplorerClient) PostAdminNodes(nodeName string) (NodeAccessKeys, error)
PostAdminNodes is used to exercise the POST /api/v1/admin/nodes endpoint This endpoint is used to create access keys for nodes
type FluxMonitorJobSpec ¶
type FluxMonitorJobSpec struct { Name string `toml:"name"` ContractAddress string `toml:"contractAddress"` // Address of the Flux Monitor script Precision int `toml:"precision"` // Optional Threshold float32 `toml:"threshold"` // Optional AbsoluteThreshold float32 `toml:"absoluteThreshold"` // Optional IdleTimerPeriod time.Duration `toml:"idleTimerPeriod"` // Optional IdleTimerDisabled bool `toml:"idleTimerDisabled"` // Optional PollTimerPeriod time.Duration `toml:"pollTimerPeriod"` // Optional PollTimerDisabled bool `toml:"pollTimerDisabled"` // Optional MaxTaskDuration time.Duration `toml:"maxTaskDuration"` // Optional ObservationSource string `toml:"observationSource"` // List of commands for the chainlink node }
FluxMonitorJobSpec represents a flux monitor spec
func (*FluxMonitorJobSpec) String ¶
func (f *FluxMonitorJobSpec) String() (string, error)
func (*FluxMonitorJobSpec) Type ¶
func (f *FluxMonitorJobSpec) Type() string
type GasUsedEstimations ¶
GasUsedEstimations contains some known gas values for contracts for every network
type HeaderEventSubscription ¶
HeaderEventSubscription is an interface for allowing callbacks when the client receives a new header
type InstantConfirmations ¶
type InstantConfirmations struct{}
InstantConfirmations is a no-op confirmer as all transactions are instantly mined so no confs are needed
func (*InstantConfirmations) ReceiveBlock ¶
func (i *InstantConfirmations) ReceiveBlock(*types.Block) error
ReceiveBlock is a no-op
type JobData ¶
type JobData struct {
ID string `json:"id"`
}
JobData contains the ID for a given job
type JobForm ¶
type JobForm struct {
TOML string `json:"toml"`
}
JobForm is the form used when creating a v2 job spec, containing the TOML of the v2 job
type JobRunsResponse ¶
type JobRunsResponse struct { Data []RunsResponseData `json:"data"` Meta RunsMetaResponse `json:"meta"` }
JobRunsResponse job runs
type JobSpec ¶
type JobSpec interface { Type() string // String Returns TOML representation of the job String() (string, error) }
JobSpec represents the different possible job types that chainlink nodes can handle
type KeeperJobSpec ¶
type KeeperJobSpec struct { Name string `toml:"name"` ContractAddress string `toml:"contractAddress"` FromAddress string `toml:"fromAddress"` // Hex representation of the from address }
KeeperJobSpec represents a keeper spec
func (*KeeperJobSpec) String ¶
func (k *KeeperJobSpec) String() (string, error)
func (*KeeperJobSpec) Type ¶
func (k *KeeperJobSpec) Type() string
type Name ¶ added in v0.0.3
type Name struct {
Name string `json:"name"`
}
Name is the body of the request
type NodeAccessKeys ¶ added in v0.0.3
type NodeAccessKeys struct { ID string `mapstructure:"id" yaml:"id"` AccessKey string `mapstructure:"accesKey" yaml:"accessKey"` Secret string `mapstructure:"secret" yaml:"secret"` }
NodeAccessKeys is the body of the response
type OCRBootstrapJobSpec ¶
type OCRBootstrapJobSpec struct { Name string `toml:"name"` BlockChainTimeout time.Duration `toml:"blockchainTimeout"` // Optional ContractConfirmations int `toml:"contractConfigConfirmations"` // Optional TrackerPollInterval time.Duration `toml:"contractConfigTrackerPollInterval"` // Optional TrackerSubscribeInterval time.Duration `toml:"contractConfigTrackerSubscribeInterval"` // Optional ContractAddress string `toml:"contractAddress"` // Address of the OCR contract P2PBootstrapPeers []string `toml:"p2pBootstrapPeers"` // Typically empty for our suite IsBootstrapPeer bool `toml:"isBootstrapPeer"` // Typically true P2PPeerID string `toml:"p2pPeerID"` // This node's P2P ID }
OCRBootstrapJobSpec represents the spec for bootstrapping an OCR job, given to one node that then must be linked back to by others by OCRTaskJobSpecs
func (*OCRBootstrapJobSpec) String ¶
func (o *OCRBootstrapJobSpec) String() (string, error)
func (*OCRBootstrapJobSpec) Type ¶
func (o *OCRBootstrapJobSpec) Type() string
type OCRKey ¶
type OCRKey struct {
Data OCRKeyData `json:"data"`
}
OCRKey is the model that represents the created OCR keys when read
type OCRKeyAttributes ¶
type OCRKeyAttributes struct { ConfigPublicKey string `json:"configPublicKey"` OffChainPublicKey string `json:"offChainPublicKey"` OnChainSigningAddress string `json:"onChainSigningAddress"` }
OCRKeyAttributes is the model that represents the created OCR keys when read
type OCRKeyData ¶
type OCRKeyData struct { Attributes OCRKeyAttributes `json:"attributes"` ID string `json:"id"` }
OCRKeyData is the model that represents the created OCR keys when read
type OCRKeys ¶
type OCRKeys struct {
Data []OCRKeyData `json:"data"`
}
OCRKeys is the model that represents the created OCR keys when read
type OCRTaskJobSpec ¶
type OCRTaskJobSpec struct { Name string `toml:"name"` BlockChainTimeout time.Duration `toml:"blockchainTimeout"` // Optional ContractConfirmations int `toml:"contractConfigConfirmations"` // Optional TrackerPollInterval time.Duration `toml:"contractConfigTrackerPollInterval"` // Optional TrackerSubscribeInterval time.Duration `toml:"contractConfigTrackerSubscribeInterval"` // Optional ContractAddress string `toml:"contractAddress"` // Address of the OCR contract P2PBootstrapPeers []Chainlink `toml:"p2pBootstrapPeers"` // P2P ID of the bootstrap node IsBootstrapPeer bool `toml:"isBootstrapPeer"` // Typically false P2PPeerID string `toml:"p2pPeerID"` // This node's P2P ID KeyBundleID string `toml:"keyBundleID"` // ID of this node's OCR key bundle MonitoringEndpoint string `toml:"monitoringEndpoint"` // Typically "chain.link:4321" TransmitterAddress string `toml:"transmitterAddress"` // ETH address this node will use to transmit its answer ObservationSource string `toml:"observationSource"` // List of commands for the chainlink node }
OCRTaskJobSpec represents an OCR job that is given to other nodes, meant to communicate with the bootstrap node, and provide their answers
func (*OCRTaskJobSpec) String ¶
func (o *OCRTaskJobSpec) String() (string, error)
func (*OCRTaskJobSpec) Type ¶
func (o *OCRTaskJobSpec) Type() string
type P2PKey ¶
type P2PKey struct {
Data P2PKeyData `json:"data"`
}
P2PKey is the model that represents the created P2P keys when read
type P2PKeyAttributes ¶
type P2PKeyAttributes struct { ID int `json:"id"` PeerID string `json:"peerId"` PublicKey string `json:"publicKey"` }
P2PKeyAttributes is the model that represents the created P2P keys when read
type P2PKeyData ¶
type P2PKeyData struct {
Attributes P2PKeyAttributes `json:"attributes"`
}
P2PKeyData is the model that represents the created P2P keys when read
type P2PKeys ¶
type P2PKeys struct {
Data []P2PKeyData `json:"data"`
}
P2PKeys is the model that represents the created P2P keys when read
type PipelineSpec ¶
type PipelineSpec struct { BridgeTypeAttributes BridgeTypeAttributes DataPath string }
PipelineSpec common API call pipeline
func (*PipelineSpec) String ¶
func (d *PipelineSpec) String() (string, error)
func (*PipelineSpec) Type ¶
func (d *PipelineSpec) Type() string
type Prometheus ¶
func NewPrometheusClient ¶
func NewPrometheusClient(url string) (*Prometheus, error)
func (*Prometheus) CPUBusyPercentage ¶
func (p *Prometheus) CPUBusyPercentage() (float64, error)
CPUBusyPercentage host CPU busy percentage
func (*Prometheus) MemoryUsage ¶
func (p *Prometheus) MemoryUsage() (float64, error)
MemoryUsage total memory used by interval
func (*Prometheus) ResourcesSummary ¶
func (p *Prometheus) ResourcesSummary() (float64, float64, error)
type ResourcesSummary ¶
type Response ¶
type Response struct {
Data map[string]interface{}
}
Response is the generic model that can be used for all Chainlink API responses
type ResponseSlice ¶
type ResponseSlice struct {
Data []map[string]interface{}
}
ResponseSlice is the generic model that can be used for all Chainlink API responses that are an slice
type RunsAttributesResponse ¶
type RunsAttributesResponse struct { Meta interface{} `json:"meta"` Errors []interface{} `json:"errors"` Inputs RunInputs `json:"inputs"` CreatedAt time.Time `json:"createdAt"` FinishedAt time.Time `json:"finishedAt"` }
RunsAttributesResponse runs attributes
type RunsMetaResponse ¶
type RunsMetaResponse struct {
Count int `json:"count"`
}
RunsMetaResponse runs meta
type RunsResponseData ¶
type RunsResponseData struct { Type string `json:"type"` ID string `json:"id"` Attributes RunsAttributesResponse `json:"attributes"` }
RunsResponseData runs response data
type Spec ¶
type Spec struct {
Data SpecData `json:"data"`
}
Spec represents a job specification that contains information about the job spec
type SpecData ¶
type SpecData struct {
ID string `json:"id"`
}
SpecData contains the ID of the job spec
type SpecForm ¶
type SpecForm struct {
TOML string `json:"toml"`
}
SpecForm is the form used when creating a v2 job spec, containing the TOML of the v2 job
type TransactionConfirmer ¶
type TransactionConfirmer struct {
// contains filtered or unexported fields
}
TransactionConfirmer is an implementation of HeaderEventSubscription that checks whether tx are confirmed
func NewTransactionConfirmer ¶
func NewTransactionConfirmer(eth *EthereumClient, txHash common.Hash, minConfirmations int) *TransactionConfirmer
NewTransactionConfirmer returns a new instance of the transaction confirmer that waits for on-chain minimum confirmations
func (*TransactionConfirmer) ReceiveBlock ¶
func (t *TransactionConfirmer) ReceiveBlock(block *types.Block) error
ReceiveBlock the implementation of the HeaderEventSubscription that receives each block and checks tx confirmation
func (*TransactionConfirmer) Wait ¶
func (t *TransactionConfirmer) Wait() error
Wait is a blocking function that waits until the transaction is complete
type VRFJobSpec ¶
type VRFJobSpec struct { Name string `toml:"name"` CoordinatorAddress string `toml:"coordinatorAddress"` // Address of the VRF Coordinator contract PublicKey string `toml:"publicKey"` // Public key of the proving key Confirmations int `toml:"confirmations"` // Number of block confirmations to wait for ExternalJobID string `toml:"externalJobID"` ObservationSource string `toml:"observationSource"` // List of commands for the chainlink node }
VRFJobSpec represents a VRF job
func (*VRFJobSpec) String ¶
func (v *VRFJobSpec) String() (string, error)
func (*VRFJobSpec) Type ¶
func (v *VRFJobSpec) Type() string
type VRFKey ¶
type VRFKey struct { Type string `json:"type"` ID string `json:"id"` Attributes VRFKeyAttributes `json:"attributes"` }
VRFKey is the model that represents the created VRF key when read
type VRFKeyAttributes ¶
type VRFKeyAttributes struct { Compressed string `json:"compressed"` Uncompressed string `json:"uncompressed"` Hash string `json:"hash"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` DeletedAt interface{} `json:"deletedAt"` }
VRFKeyAttributes is the model that represents the created VRF key attributes when read
type VRFKeys ¶
type VRFKeys struct {
Data []VRFKey `json:"data"`
}
VRFKeys is the model that represents the created VRF keys when read
type VRFTxPipelineSpec ¶
type VRFTxPipelineSpec struct {
Address string
}
VRFTxPipelineSpec VRF request with tx callback
func (*VRFTxPipelineSpec) String ¶
func (d *VRFTxPipelineSpec) String() (string, error)
func (*VRFTxPipelineSpec) Type ¶
func (d *VRFTxPipelineSpec) Type() string
type Wallets ¶
type Wallets struct {
// contains filtered or unexported fields
}
Wallets is the default implementation of BlockchainWallets that holds a slice of wallets with the default
func (*Wallets) All ¶
func (w *Wallets) All() []BlockchainWallet
All returns the raw representation of Wallets
func (*Wallets) Default ¶
func (w *Wallets) Default() BlockchainWallet
Default returns the default wallet to be used for a transaction on-chain
func (*Wallets) SetDefault ¶
SetDefault changes the default wallet to be used for on-chain transactions
type WebhookJobSpec ¶
type WebhookJobSpec struct {
ObservationSource string `toml:"observationSource"` // List of commands for the chainlink node
}
WebhookJobSpec reprsents a webhook job
func (*WebhookJobSpec) String ¶
func (w *WebhookJobSpec) String() (string, error)
func (*WebhookJobSpec) Type ¶
func (w *WebhookJobSpec) Type() string