blockstore

package
v0.9.5 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2021 License: Apache-2.0, MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockstoreAPI

type BlockstoreAPI struct {
	// contains filtered or unexported fields
}

func (*BlockstoreAPI) ChainDeleteObj added in v0.9.1

func (blockstoreAPI *BlockstoreAPI) ChainDeleteObj(ctx context.Context, obj cid.Cid) error

func (*BlockstoreAPI) ChainHasObj added in v0.9.1

func (blockstoreAPI *BlockstoreAPI) ChainHasObj(ctx context.Context, obj cid.Cid) (bool, error)

func (*BlockstoreAPI) ChainReadObj added in v0.9.1

func (blockstoreAPI *BlockstoreAPI) ChainReadObj(ctx context.Context, ocid cid.Cid) ([]byte, error)

func (*BlockstoreAPI) ChainStatObj added in v0.9.1

func (blockstoreAPI *BlockstoreAPI) ChainStatObj(ctx context.Context, obj cid.Cid, base cid.Cid) (ObjStat, error)

type BlockstoreSubmodule

type BlockstoreSubmodule struct {
	// blockstore is the un-networked blocks interface
	Blockstore bstore.Blockstore

	// cborStore is a wrapper for a `cbor.IpldStore` that works on the local IPLD-Cbor objects stored in `blockstore`.
	CborStore cbor.IpldStore
}

BlockstoreSubmodule enhances the `Node` with local key/value storing capabilities.

TODO: split chain data from piece data (issue: https://github.com/filecoin-project/venus/issues/3481) Note: at present: - `blockstore` is shared by chain/graphsync and piece/bitswap data - `cborStore` is used for chain state and shared with piece data exchange for deals at the moment.

func NewBlockstoreSubmodule

func NewBlockstoreSubmodule(ctx context.Context, repo blockstoreRepo) (*BlockstoreSubmodule, error)

NewBlockstoreSubmodule creates a new block store submodule.

func (*BlockstoreSubmodule) API

func (bsm *BlockstoreSubmodule) API() *BlockstoreAPI

type IBlockstoreAPI added in v0.9.1

type IBlockstoreAPI interface {
	ChainReadObj(ctx context.Context, ocid cid.Cid) ([]byte, error)
	ChainDeleteObj(ctx context.Context, obj cid.Cid) error
	ChainHasObj(ctx context.Context, obj cid.Cid) (bool, error)
	ChainStatObj(ctx context.Context, obj cid.Cid, base cid.Cid) (ObjStat, error)
}

type ObjStat added in v0.9.1

type ObjStat struct {
	Size  uint64
	Links uint64
}

Jump to

Keyboard shortcuts

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