store

package
v0.14.0-beta.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 9, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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) Get

func (bs *Blockstore) Get(ctx context.Context, cid cid.Cid) (blocks.Block, error)

func (*Blockstore) GetSize

func (bs *Blockstore) GetSize(ctx context.Context, cid cid.Cid) (int, error)

func (*Blockstore) Has

func (bs *Blockstore) Has(ctx context.Context, cid cid.Cid) (bool, 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.

func (*Blockstore) Put

func (bs *Blockstore) Put(ctx context.Context, blk blocks.Block) error

func (*Blockstore) PutMany

func (bs *Blockstore) PutMany(ctx context.Context, blocks []blocks.Block) error

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.

func (*Store) Close

func (s *Store) Close() error

func (*Store) GetByHash

func (s *Store) GetByHash(ctx context.Context, datahash share.DataHash) (file.EdsFile, error)

func (*Store) GetByHeight

func (s *Store) GetByHeight(ctx context.Context, height uint64) (file.EdsFile, error)

func (*Store) HasByHash

func (s *Store) HasByHash(ctx context.Context, datahash share.DataHash) (bool, error)

func (*Store) HasByHeight

func (s *Store) HasByHeight(ctx context.Context, height uint64) (bool, error)

func (*Store) Put

func (s *Store) Put(
	ctx context.Context,
	datahash share.DataHash,
	height uint64,
	square *rsmt2d.ExtendedDataSquare,
) (file.EdsFile, error)

func (*Store) Remove

func (s *Store) Remove(ctx context.Context, height uint64) error

func (*Store) WithMetrics

func (s *Store) WithMetrics() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL