Documentation ¶
Index ¶
- Constants
- Variables
- func BeaconKitSupportedCapabilities() []string
- type Eth1Client
- func (s *Eth1Client) ExchangeCapabilities(ctx context.Context, capabilities []string) ([]string, error)
- func (s *Eth1Client) ExecutionBlockByHash(ctx context.Context, hash primitives.ExecutionHash, withTxs bool) (*primitives.ExecutionBlock, error)
- func (s *Eth1Client) ExecutionBlockByNumber(ctx context.Context, num rpc.BlockNumber, withTxs bool) (*primitives.ExecutionBlock, error)
- func (s *Eth1Client) ForkchoiceUpdatedV3(ctx context.Context, state *engine.ForkchoiceState, ...) (*engine.ForkchoiceResponse, error)
- func (s *Eth1Client) GetClientVersionV1(ctx context.Context) ([]ethengine.ClientVersionV1, error)
- func (s *Eth1Client) GetPayloadV3(ctx context.Context, payloadID engine.PayloadID) (enginetypes.ExecutionPayloadEnvelope, error)
- func (s *Eth1Client) NewPayloadV3(ctx context.Context, payload *enginetypes.ExecutableDataDeneb, ...) (*engine.PayloadStatus, error)
Constants ¶
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 ¶
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 ¶
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.