fetcher

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2020 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const MAX_BATCH_SIZE = 100

Variables

View Source
var ErrEmptyHeader = errors.New("empty header returned over RPC")

Functions

This section is empty.

Types

type Fetcher

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

Fetcher is the underlying type which satisfies the core.Fetcher interface for go-ethereum

func NewFetcher

func NewFetcher(ethClient core.EthClient, rpcClient core.RPCClient, node core.Node) *Fetcher

NewFetcher returns a new Fetcher

func (*Fetcher) GetHeaderByNumber

func (fetcher *Fetcher) GetHeaderByNumber(blockNumber int64) (header core.Header, err error)

GetHeaderByNumber fetches the header for the provided block number

func (*Fetcher) GetHeadersByNumbers

func (fetcher *Fetcher) GetHeadersByNumbers(blockNumbers []int64) (header []core.Header, err error)

GetHeadersByNumbers batch fetches all of the headers for the provided block numbers

func (*Fetcher) LastBlock

func (fetcher *Fetcher) LastBlock() (*big.Int, error)

LastBlock determines and returns the latest block number

func (*Fetcher) Node

func (fetcher *Fetcher) Node() core.Node

Node returns the node info associated with this Fetcher

Jump to

Keyboard shortcuts

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