Documentation ¶
Index ¶
- func WatchHeadChanges(ctx context.Context, src NewHeadSource, fn HeadSignalFn) (ethereum.Subscription, error)
- type BlockByHashFn
- type BlockByHashSource
- type BlockByNumFn
- type BlockByNumberSource
- type BlockID
- type BlockLinkByNumber
- type BlockLinkByNumberFn
- type BlockSource
- type CombinedL1Source
- func (cs *CombinedL1Source) BlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error)
- func (cs *CombinedL1Source) Close()
- func (cs *CombinedL1Source) HeaderByHash(ctx context.Context, hash common.Hash) (*types.Header, error)
- func (cs *CombinedL1Source) HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error)
- func (cs *CombinedL1Source) SubscribeNewHead(ctx context.Context, ch chan<- *types.Header) (ethereum.Subscription, error)
- func (cs *CombinedL1Source) TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error)
- type HeadSignal
- type HeadSignalFn
- type HeaderByHashFn
- type HeaderByHashSource
- type HeaderByNumberFn
- type HeaderByNumberSource
- type L1Source
- type NewHeadFn
- type NewHeadSource
- type ReceiptFn
- type ReceiptSource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WatchHeadChanges ¶
func WatchHeadChanges(ctx context.Context, src NewHeadSource, fn HeadSignalFn) (ethereum.Subscription, error)
WatchHeadChanges wraps a new-head subscription from NewHeadSource to feed the given Tracker
Types ¶
type BlockByHashFn ¶
func (BlockByHashFn) BlockByHash ¶
type BlockByHashSource ¶
type BlockByNumFn ¶
func (BlockByNumFn) BlockByNumber ¶
type BlockByNumberSource ¶
type BlockID ¶
func (BlockID) TerminalString ¶
TerminalString implements log.TerminalStringer, formatting a string for console output during logging.
type BlockLinkByNumber ¶
type BlockLinkByNumber interface {
BlockLinkByNumber(ctx context.Context, num uint64) (self BlockID, parent BlockID, err error)
}
BlockLinkByNumber Retrieves the *currently* canonical block-hash at the given block-height, and the parent before it. The results of this should not be cached, or the cache needs to be reorg-aware.
func CanonicalChain ¶
func CanonicalChain(l1Src HeaderByNumberSource) BlockLinkByNumber
CanonicalChain presents the block-hashes by height by wrapping a header-source (useful due to lack of a direct JSON RPC endpoint)
type BlockLinkByNumberFn ¶
type BlockLinkByNumberFn func(ctx context.Context, num uint64) (self BlockID, parent BlockID, err error)
BlockLinkByNumberFn implements BlockLinkByNumber to implement the interface as anonymous function
func (BlockLinkByNumberFn) BlockLinkByNumber ¶
type BlockSource ¶
type BlockSource interface { BlockByHashSource BlockByNumberSource }
type CombinedL1Source ¶
type CombinedL1Source struct {
// contains filtered or unexported fields
}
CombinedL1Source implements round-robin between multiple L1 sources, to divide concurrent requests to multiple endpoints
func (*CombinedL1Source) BlockByHash ¶
func (*CombinedL1Source) Close ¶
func (cs *CombinedL1Source) Close()
func (*CombinedL1Source) HeaderByHash ¶
func (*CombinedL1Source) HeaderByNumber ¶
func (*CombinedL1Source) SubscribeNewHead ¶
func (*CombinedL1Source) TransactionReceipt ¶
type HeadSignal ¶
type HeadSignalFn ¶
type HeadSignalFn func(sig HeadSignal)
HeadSignalFn is used as callback function to accept head-signals
type HeaderByHashFn ¶
func (HeaderByHashFn) HeaderByHash ¶
type HeaderByHashSource ¶
type HeaderByNumberFn ¶
func (HeaderByNumberFn) HeaderByNumber ¶
type HeaderByNumberSource ¶
type L1Source ¶
type L1Source interface { NewHeadSource HeaderByHashSource HeaderByNumberSource ReceiptSource BlockByHashSource Close() }