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 ¶
This section is empty.
Types ¶
type EthClient ¶
type EthClient interface { FinalizedBlockHeight() (*big.Int, error) BlockHeadersByRange(*big.Int, *big.Int) ([]*types.Header, error) BlockHeaderByHash(common.Hash) (*types.Header, error) RawRpcClient() *rpc.Client }
func NewEthClient ¶
type HeaderTraversal ¶
type HeaderTraversal struct {
// contains filtered or unexported fields
}
func NewHeaderTraversal ¶
func NewHeaderTraversal(ethClient EthClient, fromHeader *types.Header) *HeaderTraversal
NewHeaderTraversal instantiates a new instance of HeaderTraversal against the supplied rpc client. The HeaderTraversal will start fetching blocks starting from the supplied header unless nil, indicating genesis.
func (*HeaderTraversal) NextFinalizedHeaders ¶
func (f *HeaderTraversal) NextFinalizedHeaders(maxSize uint64) ([]*types.Header, error)
NextFinalizedHeaders retrives the next set of headers that have been marked as finalized by the connected client, bounded by the supplied size
Click to show internal directories.
Click to hide internal directories.