node

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2023 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrFetcherAndProviderMismatchedState = errors.New("the fetcher and provider have diverged in finalized state")

Functions

This section is empty.

Types

type EthClient

type EthClient interface {
	FinalizedBlockHeight() (*big.Int, error)
	BlockHeadersByRange(*big.Int, *big.Int) ([]*types.Header, error)

	RawRpcClient() *rpc.Client
}

func NewEthClient

func NewEthClient(rpcUrl string) (EthClient, error)

type Fetcher

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

func NewFetcher

func NewFetcher(ethClient EthClient, fromHeader *types.Header) (*Fetcher, error)

NewFetcher instantiates a new instance of Fetcher against the supplied rpc client. The Fetcher will start fetching blocks starting from the supplied header unless nil, indicating genesis.

func (*Fetcher) NextFinalizedHeaders

func (f *Fetcher) NextFinalizedHeaders() ([]*types.Header, error)

NextConfirmedHeaders retrives the next set of headers that have been marked as finalized by the connected client

Jump to

Keyboard shortcuts

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