Documentation ¶
Overview ¶
Package backend handles the scribe backend.
Index ¶
- func BlockHashesInRange(ctx context.Context, backend ScribeBackend, startHeight uint64, ...) (*immutable.Map[uint64, string], error)
- func GetLogsInRange(ctx context.Context, backend ScribeBackend, contractAddresses []common.Address, ...) (*immutable.List[*[]types.Log], error)
- func MakeRange[T constraints.Integer](min, max T) []T
- type ScribeBackend
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BlockHashesInRange ¶
func BlockHashesInRange(ctx context.Context, backend ScribeBackend, startHeight uint64, endHeight uint64) (*immutable.Map[uint64, string], error)
BlockHashesInRange gets all block hashes in a range with a single batch request in successful cases an immutable map is returned of [height->hash], otherwise an error is returned.
func GetLogsInRange ¶
func GetLogsInRange(ctx context.Context, backend ScribeBackend, contractAddresses []common.Address, expectedChainID uint64, chunks []*util.Chunk, topics [][]common.Hash) (*immutable.List[*[]types.Log], error)
GetLogsInRange gets all logs in a range with a single batch request in successful cases an immutable list is returned, otherwise an error is returned.
func MakeRange ¶
func MakeRange[T constraints.Integer](min, max T) []T
MakeRange returns a range of integers from min to max inclusive.
Types ¶
type ScribeBackend ¶
type ScribeBackend interface { // ChainID gets the chain id from the rpc server. ChainID(ctx context.Context) (*big.Int, error) // BlockNumber gets the latest block number. BlockNumber(ctx context.Context) (uint64, error) // HeaderByNumber returns the block header with the given block number. HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error) // BatchWithContext batches multiple BatchWithContext(ctx context.Context, calls ...w3types.Caller) error }
ScribeBackend is the set of functions that the scribe needs from a client.
func DialBackend ¶
DialBackend returns a scribe backend.
Click to show internal directories.
Click to hide internal directories.