Documentation
¶
Overview ¶
Package snapshot provides a BlockHeightContractFilterer backed by a pre-computed postage batch snapshot, used to rebuild the batch store from an embedded snapshot instead of replaying the whole postage contract history.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New( ctx context.Context, logger log.Logger, getter SnapshotGetter, syncingStopped *syncutil.Signaler, contractAddress common.Address, contractABI abi.ABI, blockTime time.Duration, stallingTimeout time.Duration, backoffTimeout time.Duration, startBlock uint64, ) (*batchservice.Snapshot, error)
New builds the inputs the batch service needs to rebuild the store from the embedded snapshot: a listener that replays the snapshot's logs and the block to start from. The snapshot is parsed eagerly here so a corrupt one fails fast and the caller can fall back to a full chain rebuild.
Types ¶
type SnapshotGetter ¶
type SnapshotGetter interface {
GetBatchSnapshot() []byte
}
type SnapshotLogFilterer ¶
type SnapshotLogFilterer struct {
// contains filtered or unexported fields
}
func NewSnapshotLogFilterer ¶
func NewSnapshotLogFilterer(logger log.Logger, getter SnapshotGetter) *SnapshotLogFilterer
func (*SnapshotLogFilterer) BlockNumber ¶
func (f *SnapshotLogFilterer) BlockNumber(_ context.Context) (uint64, error)
func (*SnapshotLogFilterer) FilterLogs ¶
func (f *SnapshotLogFilterer) FilterLogs(ctx context.Context, query ethereum.FilterQuery) ([]types.Log, error)
func (*SnapshotLogFilterer) GetBatchSnapshot ¶
func (f *SnapshotLogFilterer) GetBatchSnapshot() []byte
Click to show internal directories.
Click to hide internal directories.