Documentation ¶
Index ¶
- Variables
- type Blockstore
- func (bs *Blockstore) AllKeysChan(context.Context) (<-chan cid.Cid, error)
- func (bs *Blockstore) DeleteBlock(ctx context.Context, cid cid.Cid) error
- func (bs *Blockstore) Get(ctx context.Context, cid cid.Cid) (blocks.Block, error)
- func (bs *Blockstore) GetSize(ctx context.Context, cid cid.Cid) (int, error)
- func (bs *Blockstore) Has(ctx context.Context, cid cid.Cid) (bool, error)
- func (bs *Blockstore) HashOnRead(bool)
- func (bs *Blockstore) Put(ctx context.Context, blk blocks.Block) error
- func (bs *Blockstore) PutMany(ctx context.Context, blocks []blocks.Block) error
- type Parameters
- type Store
- func (s *Store) Close() error
- func (s *Store) GetByHash(ctx context.Context, datahash share.DataHash) (file.EdsFile, error)
- func (s *Store) GetByHeight(ctx context.Context, height uint64) (file.EdsFile, error)
- func (s *Store) HasByHash(ctx context.Context, datahash share.DataHash) (bool, error)
- func (s *Store) HasByHeight(ctx context.Context, height uint64) (bool, error)
- func (s *Store) Put(ctx context.Context, datahash share.DataHash, height uint64, ...) (file.EdsFile, error)
- func (s *Store) Remove(ctx context.Context, height uint64) error
- func (s *Store) WithMetrics() error
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = errors.New("eds not found in store")
Functions ¶
This section is empty.
Types ¶
type Blockstore ¶
type Blockstore struct {
// contains filtered or unexported fields
}
Blockstore implements the bstore.Blockstore interface on an EDSStore. It is used to provide a custom blockstore interface implementation to achieve access to the underlying EDSStore. The main use-case is randomized sampling over the whole chain of EDS block data and getting data by namespace.
func NewBlockstore ¶
func NewBlockstore(store *Store, ds datastore.Batching) *Blockstore
func (*Blockstore) AllKeysChan ¶
func (bs *Blockstore) AllKeysChan(context.Context) (<-chan cid.Cid, error)
AllKeysChan is a noop on the EDS blockstore because the keys are not stored in a single CAR file.
func (*Blockstore) DeleteBlock ¶
func (bs *Blockstore) DeleteBlock(ctx context.Context, cid cid.Cid) error
func (*Blockstore) GetSize ¶
func (bs *Blockstore) GetSize(ctx context.Context, cid cid.Cid) (int, error)
func (*Blockstore) HashOnRead ¶
func (bs *Blockstore) HashOnRead(bool)
HashOnRead is a noop on the EDS blockstore but an error cannot be returned due to the method signature from the blockstore interface.
type Parameters ¶
type Parameters struct { // RecentBlocksCacheSize is the size of the cache for recent blocks. RecentBlocksCacheSize int // BlockstoreCacheSize is the size of the cache for blockstore requested accessors. BlockstoreCacheSize int }
func DefaultParameters ¶
func DefaultParameters() *Parameters
DefaultParameters returns the default configuration values for the EDS store parameters.
func (*Parameters) Validate ¶
func (p *Parameters) Validate() error
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store maintains (via DAGStore) a top-level index enabling granular and efficient random access to every share and/or Merkle proof over every registered CARv1 file. The EDSStore provides a custom blockstore interface implementation to achieve access. The main use-case is randomized sampling over the whole chain of EDS block data and getting data by namespace.
func NewStore ¶
func NewStore(params *Parameters, basePath string) (*Store, error)
NewStore creates a new EDS Store under the given basepath and datastore.