ethclient

package
v0.1.1-experimental.5 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NewPayloadMethodV3 for creating a new payload in Deneb.
	NewPayloadMethodV3 = "engine_newPayloadV3"
	// ForkchoiceUpdatedMethodV3 for updating fork choice in Deneb.
	ForkchoiceUpdatedMethodV3 = "engine_forkchoiceUpdatedV3"
	// GetPayloadMethodV3 for retrieving a payload in Deneb.
	GetPayloadMethodV3 = "engine_getPayloadV3"
	// BlockByHashMethod for retrieving a block by its hash.
	BlockByHashMethod = "eth_getBlockByHash"
	// BlockByNumberMethod for retrieving a block by its number.
	BlockByNumberMethod = "eth_getBlockByNumber"
	// ExchangeCapabilities for exchanging capabilities with the peer.
	ExchangeCapabilities = "engine_exchangeCapabilities"
	// GetClientVersionV1 for retrieving the capabilities of the peer.
	GetClientVersionV1 = "engine_getClientVersionV1"
)

Constants for JSON-RPC method names.

Variables

View Source
var ErrNilResponse = errors.New("nil response")

ErrNilResponse is an error that is returned when the response is nil.

Functions

func BeaconKitSupportedCapabilities

func BeaconKitSupportedCapabilities() []string

BeaconKitSupportedCapabilities returns the full list of capabilities of the beacon kit client.

Types

type Eth1Client

type Eth1Client struct {
	*ethclient.Client
}

Eth1Client is a struct that holds the Ethereum 1 client and its configuration.

func NewEth1Client

func NewEth1Client(client *ethclient.Client) (*Eth1Client, error)

NewEth1Client creates a new Ethereum 1 client with the provided context and options.

func (*Eth1Client) ExchangeCapabilities

func (s *Eth1Client) ExchangeCapabilities(
	ctx context.Context,
	capabilities []string,
) ([]string, error)

ExchangeCapabilities calls the engine_exchangeCapabilities method via JSON-RPC.

func (*Eth1Client) ExecutionBlockByHash

func (s *Eth1Client) ExecutionBlockByHash(
	ctx context.Context, hash primitives.ExecutionHash, withTxs bool,
) (*primitives.ExecutionBlock, error)

ExecutionBlockByHash fetches an execution engine block by hash by calling eth_blockByHash via JSON-RPC.

func (*Eth1Client) ExecutionBlockByNumber

func (s *Eth1Client) ExecutionBlockByNumber(
	ctx context.Context, num rpc.BlockNumber, withTxs bool,
) (*primitives.ExecutionBlock, error)

ExecutionBlockByNumber fetches an execution engine block by number by calling eth_getBlockByNumber via JSON-RPC.

func (*Eth1Client) ForkchoiceUpdatedV3

func (s *Eth1Client) ForkchoiceUpdatedV3(
	ctx context.Context,
	state *engine.ForkchoiceState,
	attrs enginetypes.PayloadAttributer,
) (*engine.ForkchoiceResponse, error)

ForkchoiceUpdatedV3 calls the engine_forkchoiceUpdatedV3 method via JSON-RPC.

func (*Eth1Client) GetClientVersionV1

func (s *Eth1Client) GetClientVersionV1(
	ctx context.Context,
) ([]ethengine.ClientVersionV1, error)

GetClientVersionV1 calls the engine_getClientVersionV1 method via JSON-RPC.

func (*Eth1Client) GetPayloadV3

func (s *Eth1Client) GetPayloadV3(
	ctx context.Context, payloadID engine.PayloadID,
) (enginetypes.ExecutionPayloadEnvelope, error)

GetPayloadV3 calls the engine_getPayloadV3 method via JSON-RPC.

func (*Eth1Client) NewPayloadV3

func (s *Eth1Client) NewPayloadV3(
	ctx context.Context, payload *enginetypes.ExecutableDataDeneb,
	versionedHashes []primitives.ExecutionHash, parentBlockRoot *[32]byte,
) (*engine.PayloadStatus, error)

NewPayloadV3 calls the engine_newPayloadV3 method via JSON-RPC.

Jump to

Keyboard shortcuts

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