Documentation ¶
Index ¶
- Variables
- func Init(ctx context.Context, store header.Store, ex header.Exchange, ...) error
- func NewStore(ds datastore.Batching) (header.Store, error)
- func NewStoreWithHead(ctx context.Context, ds datastore.Batching, head *header.ExtendedHeader) (header.Store, error)
- func NewTestStore(ctx context.Context, t *testing.T, head *header.ExtendedHeader) header.Store
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DefaultStoreCacheSize defines the amount of max entries allowed in the Header Store cache. DefaultStoreCacheSize = 4096 // DefaultIndexCacheSize defines the amount of max entries allowed in the Height to Hash index cache. DefaultIndexCacheSize = 16384 // DefaultWriteBatchSize defines the size of the batched header write. // Headers are written in batches not to thrash the underlying Datastore with writes. DefaultWriteBatchSize = 2048 )
TODO(@Wondertan): Those values must be configurable and proper defaults should be set for specific node type. (#709)
Functions ¶
func Init ¶
Init ensures a Store is initialized. If it is not already initialized, it initializes the Store by requesting the header with the given hash.
func NewStore ¶
NewStore constructs a Store over datastore. The datastore must have a head there otherwise Start will error. For first initialization of Store use NewStoreWithHead.
func NewStoreWithHead ¶
func NewStoreWithHead(ctx context.Context, ds datastore.Batching, head *header.ExtendedHeader) (header.Store, error)
NewStoreWithHead initiates a new Store and forcefully sets a given trusted header as head.
func NewTestStore ¶
NewTestStore creates initialized and started in memory header Store which is useful for testing.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.