eth

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MetricsSubsystem = "eth"

	ChainIDMethodName          = "chainId"
	GetBlockByNumberMethodName = "getBlockByNumber"
	GetBlockByHashMethodName   = "getBlockByHash"
)

Variables

View Source
var RPCMethodDurationBucketsMicroseconds = []float64{1, 10, 50, 100, 500, 1000}

Functions

This section is empty.

Types

type BlockAPI

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

func NewBlockAPI

func NewBlockAPI(blockStore DB, chainID *big.Int, metrics Metrics) *BlockAPI

func (*BlockAPI) GetBlockByHash

func (e *BlockAPI) GetBlockByHash(hash common.Hash, fullTx bool) (map[string]any, error)

func (*BlockAPI) GetBlockByNumber

func (e *BlockAPI) GetBlockByNumber(id BlockID, fullTx bool) (map[string]any, error)

type BlockID

type BlockID struct {
	Label  eth.BlockLabel
	Height int64
}

func (*BlockID) Get

func (id *BlockID) Get(s BlockIDDatabase) (*monomer.Block, error)

func (*BlockID) UnmarshalJSON

func (id *BlockID) UnmarshalJSON(data []byte) error

type BlockIDDatabase

type BlockIDDatabase interface {
	BlockByLabel(eth.BlockLabel) (*monomer.Block, error)
	BlockByHeight(uint64) (*monomer.Block, error)
}

type ChainIDAPI

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

func NewChainIDAPI

func NewChainIDAPI(chainID *hexutil.Big, metrics Metrics) *ChainIDAPI

func (*ChainIDAPI) ChainId

func (e *ChainIDAPI) ChainId() *hexutil.Big

type DB

type DB interface {
	BlockByLabel(eth.BlockLabel) (*monomer.Block, error)
	BlockByHeight(uint64) (*monomer.Block, error)
	BlockByHash(common.Hash) (*monomer.Block, error)
	HeadBlock() (*monomer.Block, error)
}

type Metrics

type Metrics interface {
	rpcmetrics.Metrics
}

Metrics contains metrics collected from the eth package.

func NewMetrics

func NewMetrics(namespace string) Metrics

func NewNoopMetrics

func NewNoopMetrics() Metrics

type ProofAPI

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

func NewProofAPI

func NewProofAPI(db state.Database, blockStore DB) *ProofAPI

func (*ProofAPI) GetProof

func (p *ProofAPI) GetProof(
	ctx context.Context,
	address common.Address,
	storageKeys []string,
	blockNrOrHash rpc.BlockNumberOrHash,
) (*ethapi.AccountResult, error)

GetProof returns the account and storage values of the specified account including the Merkle-proof. The user can specify either a block number or a block hash to build to proof from.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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