geth

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2026 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Overview

Package geth provides go-ethereum adapters for the execution interfaces. This package contains all go-ethereum dependencies, allowing the core execution package to remain free of CGO-dependent imports.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdaptReceipts

func AdaptReceipts(receipts []*types.Receipt) []execution.Receipt

AdaptReceipts converts a slice of go-ethereum receipts to execution.Receipt interfaces.

Types

type BlockAdapter

type BlockAdapter struct {
	// contains filtered or unexported fields
}

BlockAdapter wraps a go-ethereum Block to implement execution.Block.

func NewBlockAdapter

func NewBlockAdapter(block *types.Block) *BlockAdapter

NewBlockAdapter creates a new BlockAdapter from a go-ethereum Block. It extracts sender addresses for all transactions using the appropriate signer.

func (*BlockAdapter) BaseFee

func (b *BlockAdapter) BaseFee() *big.Int

BaseFee returns the base fee per gas (EIP-1559), or nil for pre-London blocks.

func (*BlockAdapter) Hash

func (b *BlockAdapter) Hash() execution.Hash

Hash returns the block hash.

func (*BlockAdapter) Number

func (b *BlockAdapter) Number() *big.Int

Number returns the block number.

func (*BlockAdapter) ParentHash

func (b *BlockAdapter) ParentHash() execution.Hash

ParentHash returns the parent block hash.

func (*BlockAdapter) Transactions

func (b *BlockAdapter) Transactions() []execution.Transaction

Transactions returns all transactions in the block.

type RPCNode

type RPCNode struct {
	// contains filtered or unexported fields
}

RPCNode implements execution.Node using JSON-RPC connections.

func NewRPCNode

func NewRPCNode(log logrus.FieldLogger, conf *execution.Config) *RPCNode

NewRPCNode creates a new RPC-based execution node.

func (*RPCNode) BlockByNumber

func (n *RPCNode) BlockByNumber(ctx context.Context, number *big.Int) (execution.Block, error)

BlockByNumber returns the block at the given number.

func (*RPCNode) BlockNumber

func (n *RPCNode) BlockNumber(ctx context.Context) (*uint64, error)

BlockNumber returns the current block number.

func (*RPCNode) BlockReceipts

func (n *RPCNode) BlockReceipts(ctx context.Context, number *big.Int) ([]execution.Receipt, error)

BlockReceipts returns all receipts for the block at the given number.

func (*RPCNode) BlocksByNumbers

func (n *RPCNode) BlocksByNumbers(ctx context.Context, numbers []*big.Int) ([]execution.Block, error)

BlocksByNumbers returns blocks at the given numbers using batch RPC. Returns blocks up to the first not-found (contiguous only).

func (*RPCNode) ChainID

func (n *RPCNode) ChainID() int64

ChainID returns the chain ID from the metadata service.

func (*RPCNode) ClientType

func (n *RPCNode) ClientType() string

ClientType returns the client type from the metadata service.

func (*RPCNode) DebugTraceTransaction

func (n *RPCNode) DebugTraceTransaction(
	ctx context.Context,
	hash string,
	blockNumber *big.Int,
	opts execution.TraceOptions,
) (*execution.TraceTransaction, error)

DebugTraceTransaction returns the execution trace for the transaction.

func (*RPCNode) IsSynced

func (n *RPCNode) IsSynced() bool

IsSynced returns true if the node is synced.

func (*RPCNode) Metadata

func (n *RPCNode) Metadata() *services.MetadataService

Metadata returns the metadata service for this node.

func (*RPCNode) Name

func (n *RPCNode) Name() string

Name returns the configured name for this node.

func (*RPCNode) OnReady

func (n *RPCNode) OnReady(_ context.Context, callback func(ctx context.Context) error)

func (*RPCNode) Start

func (n *RPCNode) Start(ctx context.Context) error

func (*RPCNode) Stop

func (n *RPCNode) Stop(ctx context.Context) error

func (*RPCNode) TransactionReceipt

func (n *RPCNode) TransactionReceipt(ctx context.Context, hash string) (execution.Receipt, error)

TransactionReceipt returns the receipt for the transaction with the given hash.

type ReceiptAdapter

type ReceiptAdapter struct {
	// contains filtered or unexported fields
}

ReceiptAdapter wraps a go-ethereum Receipt to implement execution.Receipt.

func NewReceiptAdapter

func NewReceiptAdapter(receipt *types.Receipt) *ReceiptAdapter

NewReceiptAdapter creates a new ReceiptAdapter from a go-ethereum Receipt.

func (*ReceiptAdapter) GasUsed

func (r *ReceiptAdapter) GasUsed() uint64

GasUsed returns the gas used by the transaction.

func (*ReceiptAdapter) Status

func (r *ReceiptAdapter) Status() uint64

Status returns the transaction status (1=success, 0=failure).

func (*ReceiptAdapter) TxHash

func (r *ReceiptAdapter) TxHash() execution.Hash

TxHash returns the transaction hash.

type TransactionAdapter

type TransactionAdapter struct {
	// contains filtered or unexported fields
}

TransactionAdapter wraps a go-ethereum Transaction to implement execution.Transaction.

func NewTransactionAdapter

func NewTransactionAdapter(tx *types.Transaction) *TransactionAdapter

NewTransactionAdapter creates a new TransactionAdapter from a go-ethereum Transaction. It computes the sender address using the appropriate signer.

func (*TransactionAdapter) BlobGas

func (t *TransactionAdapter) BlobGas() uint64

BlobGas returns the blob gas used (for blob transactions).

func (*TransactionAdapter) BlobGasFeeCap

func (t *TransactionAdapter) BlobGasFeeCap() *big.Int

BlobGasFeeCap returns the max blob fee per gas (for blob transactions).

func (*TransactionAdapter) BlobHashes

func (t *TransactionAdapter) BlobHashes() []execution.Hash

BlobHashes returns the versioned hashes (for blob transactions).

func (*TransactionAdapter) ChainId

func (t *TransactionAdapter) ChainId() *big.Int

ChainId returns the chain ID, or nil for legacy transactions.

func (*TransactionAdapter) Data

func (t *TransactionAdapter) Data() []byte

Data returns the input data (calldata).

func (*TransactionAdapter) From

From returns the sender address.

func (*TransactionAdapter) Gas

func (t *TransactionAdapter) Gas() uint64

Gas returns the gas limit.

func (*TransactionAdapter) GasFeeCap

func (t *TransactionAdapter) GasFeeCap() *big.Int

GasFeeCap returns the max fee per gas (EIP-1559).

func (*TransactionAdapter) GasPrice

func (t *TransactionAdapter) GasPrice() *big.Int

GasPrice returns the gas price (for legacy transactions).

func (*TransactionAdapter) GasTipCap

func (t *TransactionAdapter) GasTipCap() *big.Int

GasTipCap returns the max priority fee per gas (EIP-1559).

func (*TransactionAdapter) Hash

func (t *TransactionAdapter) Hash() execution.Hash

Hash returns the transaction hash.

func (*TransactionAdapter) Nonce

func (t *TransactionAdapter) Nonce() uint64

Nonce returns the sender account nonce.

func (*TransactionAdapter) Size

func (t *TransactionAdapter) Size() uint64

Size returns the encoded transaction size in bytes.

func (*TransactionAdapter) To

To returns the recipient address, or nil for contract creation.

func (*TransactionAdapter) Type

func (t *TransactionAdapter) Type() uint8

Type returns the transaction type.

func (*TransactionAdapter) Value

func (t *TransactionAdapter) Value() *big.Int

Value returns the value transferred in wei.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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