Documentation ¶
Overview ¶
Package executionclient implements functions for interacting with Ethereum execution clients.
Index ¶
- Constants
- Variables
- type BlockLogs
- type ExecutionClient
- func (ec *ExecutionClient) BlockByNumber(ctx context.Context, blockNumber *big.Int) (*ethtypes.Block, error)
- func (ec *ExecutionClient) Close() error
- func (ec *ExecutionClient) FetchHistoricalLogs(ctx context.Context, fromBlock uint64) (logs <-chan BlockLogs, errors <-chan error, err error)
- func (ec *ExecutionClient) Filterer() (*contract.ContractFilterer, error)
- func (ec *ExecutionClient) Healthy(ctx context.Context) error
- func (ec *ExecutionClient) StreamLogs(ctx context.Context, fromBlock uint64) <-chan BlockLogs
- type ExecutionOptions
- type Option
- func WithConnectionTimeout(timeout time.Duration) Option
- func WithFollowDistance(offset uint64) Option
- func WithLogBatchSize(size uint64) Option
- func WithLogger(logger *zap.Logger) Option
- func WithMetrics(metrics metrics) Option
- func WithReconnectionInitialInterval(interval time.Duration) Option
- func WithReconnectionMaxInterval(interval time.Duration) Option
Constants ¶
Variables ¶
Functions ¶
This section is empty.
Types ¶
type ExecutionClient ¶
type ExecutionClient struct {
// contains filtered or unexported fields
}
ExecutionClient represents a client for interacting with Ethereum execution client.
func New ¶
func New(ctx context.Context, nodeAddr string, contractAddr ethcommon.Address, opts ...Option) (*ExecutionClient, error)
New creates a new instance of ExecutionClient.
func (*ExecutionClient) BlockByNumber ¶ added in v1.2.2
func (*ExecutionClient) Close ¶
func (ec *ExecutionClient) Close() error
Close shuts down ExecutionClient.
func (*ExecutionClient) FetchHistoricalLogs ¶
func (ec *ExecutionClient) FetchHistoricalLogs(ctx context.Context, fromBlock uint64) (logs <-chan BlockLogs, errors <-chan error, err error)
FetchHistoricalLogs retrieves historical logs emitted by the contract starting from fromBlock.
func (*ExecutionClient) Filterer ¶
func (ec *ExecutionClient) Filterer() (*contract.ContractFilterer, error)
func (*ExecutionClient) Healthy ¶
func (ec *ExecutionClient) Healthy(ctx context.Context) error
Healthy returns if execution client is currently healthy: responds to requests and not in the syncing state.
func (*ExecutionClient) StreamLogs ¶
func (ec *ExecutionClient) StreamLogs(ctx context.Context, fromBlock uint64) <-chan BlockLogs
StreamLogs subscribes to events emitted by the contract.
type ExecutionOptions ¶
type ExecutionOptions struct { Addr string `yaml:"ETH1Addr" env:"ETH_1_ADDR" env-required:"true" env-description:"Execution client WebSocket address"` ConnectionTimeout time.Duration `` /* 131-byte string literal not displayed */ }
ExecutionOptions contains config configurations related to Ethereum execution client.
type Option ¶
type Option func(*ExecutionClient)
Option defines an ExecutionClient configuration option.
func WithConnectionTimeout ¶
WithConnectionTimeout sets timeout for network connection to eth1 node.
func WithFollowDistance ¶
WithFollowDistance sets finalization offset. It defines how many blocks in the past the latest block we want to process is.
func WithLogBatchSize ¶
WithLogBatchSize sets log batch size.
func WithReconnectionInitialInterval ¶
WithReconnectionInitialInterval sets initial reconnection interval.
func WithReconnectionMaxInterval ¶
WithReconnectionMaxInterval sets max reconnection interval.