Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrBlockNotFound = errors.New("block not found") ErrNoBlocksHeaders = errors.New("no block headers in repository") )
View Source
var ErrFilterNotFound = errors.New("filter not found")
Functions ¶
This section is empty.
Types ¶
type BlockHeaderRepository ¶
type BlockHeaderRepository interface {
// chain tip returns the best block header in the store
ChainTip(context.Context) (*block.Header, error)
GetBlockHeader(context.Context, chainhash.Hash) (*block.Header, error)
GetBlockHashByHeight(context.Context, uint32) (*chainhash.Hash, error)
WriteHeaders(context.Context, ...block.Header) error
// LatestBlockLocator returns the block locator for the latest known tip as root of the locator
LatestBlockLocator(context.Context) (blockchain.BlockLocator, error)
HasAllAncestors(context.Context, chainhash.Hash) (bool, error)
}
type FilterEntry ¶
FilterEntry is the base filter structure using to store filter data.
func NewFilterEntry ¶
func NewFilterEntry(key FilterKey, filter *gcs.Filter) (*FilterEntry, error)
type FilterKey ¶
type FilterKey struct {
BlockHash []byte
FilterType FilterType
}
FilterKey is the unique key for a filter. for each possible key, the repository should store 1 unique filter
type FilterRepository ¶
type FilterRepository interface {
PutFilter(context.Context, *FilterEntry) error
GetFilter(context.Context, FilterKey) (*FilterEntry, error)
}
type FilterType ¶
type FilterType byte
const ( // RegularFilter is only filter type supported for now RegularFilter FilterType = iota )
Click to show internal directories.
Click to hide internal directories.