Documentation ¶
Index ¶
- Constants
- type BlockIndex
- func (bi *BlockIndex) CheckIntegrity() (err error)
- func (bi *BlockIndex) Close() error
- func (bi *BlockIndex) FillGaps(ctx context.Context, latestNumber uint64) error
- func (bi *BlockIndex) ForEachBlock(fn func(block *web3.BlockHeader) error) error
- func (bi *BlockIndex) Open() error
- func (bi *BlockIndex) Prune(callback func(block *web3.BlockHeader)) (size int, removed int, err error)
- func (bi *BlockIndex) Put(block *web3.BlockHeader) (latest uint64, err error)
- func (bi *BlockIndex) Stats() (stats *BlockIndexStats, err error)
- type BlockIndexStats
Constants ¶
View Source
const ( BucketNameBlocks = "blocks" BucketNameNumberIdx = "numberIdx" )
View Source
const (
ErrIntegrityCheckFailed = errors.ConstError("integrity check has failed")
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockIndex ¶
type BlockIndex struct { Log *zap.Logger Path string Size int ReOrgSize int ClientId string Loader func(number uint64) (*web3.BlockHeader, error) // contains filtered or unexported fields }
func (*BlockIndex) CheckIntegrity ¶
func (bi *BlockIndex) CheckIntegrity() (err error)
func (*BlockIndex) Close ¶
func (bi *BlockIndex) Close() error
func (*BlockIndex) FillGaps ¶
func (bi *BlockIndex) FillGaps( ctx context.Context, latestNumber uint64, ) error
func (*BlockIndex) ForEachBlock ¶
func (bi *BlockIndex) ForEachBlock(fn func(block *web3.BlockHeader) error) error
func (*BlockIndex) Open ¶
func (bi *BlockIndex) Open() error
func (*BlockIndex) Prune ¶
func (bi *BlockIndex) Prune(callback func(block *web3.BlockHeader)) (size int, removed int, err error)
func (*BlockIndex) Put ¶
func (bi *BlockIndex) Put(block *web3.BlockHeader) (latest uint64, err error)
func (*BlockIndex) Stats ¶
func (bi *BlockIndex) Stats() (stats *BlockIndexStats, err error)
Click to show internal directories.
Click to hide internal directories.