node

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrHeaderTraversalAheadOfProvider            = errors.New("the HeaderTraversal's internal state is ahead of the provider")
	ErrHeaderTraversalAndProviderMismatchedState = errors.New("the HeaderTraversal and provider have diverged in state")
)

Functions

func IsURLAvailable

func IsURLAvailable(address string) bool

Types

type EthClient

type EthClient interface {
	BlockHeaderByNumber(*big.Int) (*types.Header, error)
	LatestSafeBlockHeader() (*types.Header, error)
	LatestFinalizedBlockHeader() (*types.Header, error)
	BlockHeaderByHash(common.Hash) (*types.Header, error)
	BlockHeadersByRange(*big.Int, *big.Int, uint) ([]types.Header, error)

	TxByHash(common.Hash) (*types.Transaction, error)

	StorageHash(common.Address, *big.Int) (common.Hash, error)
	FilterLogs(ethereum.FilterQuery) (Logs, error)

	Close()
}

func DialEthClient

func DialEthClient(ctx context.Context, rpcUrl string) (EthClient, error)

type HeaderTraversal

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

func NewHeaderTraversal

func NewHeaderTraversal(ethClient EthClient, fromHeader *types.Header, confDepth *big.Int, chainId uint) *HeaderTraversal

func (*HeaderTraversal) LastTraversedHeader

func (f *HeaderTraversal) LastTraversedHeader() *types.Header

func (*HeaderTraversal) LatestHeader

func (f *HeaderTraversal) LatestHeader() *types.Header

func (*HeaderTraversal) NextHeaders

func (f *HeaderTraversal) NextHeaders(maxSize uint64) ([]types.Header, error)

type Logs

type Logs struct {
	Logs          []types.Log
	ToBlockHeader *types.Header
}

type RPC

type RPC interface {
	Close()
	CallContext(ctx context.Context, result any, method string, args ...any) error
	BatchCallContext(ctx context.Context, b []rpc.BatchElem) error
}

func NewRPC

func NewRPC(client *rpc.Client) RPC

Jump to

Keyboard shortcuts

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