Documentation ¶
Index ¶
- type BlockServiceAPI
- func (blockServiceAPI *BlockServiceAPI) DAGCat(ctx context.Context, c cid.Cid) (io.Reader, error)
- func (blockServiceAPI *BlockServiceAPI) DAGGetFileSize(ctx context.Context, c cid.Cid) (uint64, error)
- func (blockServiceAPI *BlockServiceAPI) DAGGetNode(ctx context.Context, ref string) (interface{}, error)
- func (blockServiceAPI *BlockServiceAPI) DAGImportData(ctx context.Context, data io.Reader) (ipld.Node, error)
- type BlockServiceSubmodule
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockServiceAPI ¶
type BlockServiceAPI struct {
// contains filtered or unexported fields
}
func (*BlockServiceAPI) DAGCat ¶
DAGCat returns an iostream with a piece of data stored on the merkeldag with the given cid.
func (*BlockServiceAPI) DAGGetFileSize ¶
func (blockServiceAPI *BlockServiceAPI) DAGGetFileSize(ctx context.Context, c cid.Cid) (uint64, error)
DAGGetFileSize returns the file size for a given Cid
func (*BlockServiceAPI) DAGGetNode ¶
func (blockServiceAPI *BlockServiceAPI) DAGGetNode(ctx context.Context, ref string) (interface{}, error)
DAGGetNode returns the associated DAG node for the passed in CID.
func (*BlockServiceAPI) DAGImportData ¶
func (blockServiceAPI *BlockServiceAPI) DAGImportData(ctx context.Context, data io.Reader) (ipld.Node, error)
DAGImportData adds data from an io reader to the merkledag and returns the Cid of the given data. Once the data is in the DAG, it can fetched from the node via Bitswap and a copy will be kept in the blockstore.
type BlockServiceSubmodule ¶
type BlockServiceSubmodule struct { // blockservice is a higher level interface for fetching data Blockservice bserv.BlockService Dag *dag.DAG }
BlockServiceSubmodule enhances the `Node` with networked key/value fetching capabilities.
TODO: split chain data from piece data (issue: https://github.com/filecoin-project/venus/issues/3481) Note: at present: - `BlockService` is shared by chain/graphsync and piece/bitswap data
func NewBlockserviceSubmodule ¶
func NewBlockserviceSubmodule(ctx context.Context, blockstore *blockstore.BlockstoreSubmodule, network *network.NetworkSubmodule) (*BlockServiceSubmodule, error)
NewBlockserviceSubmodule creates a new block service submodule.
func (*BlockServiceSubmodule) API ¶
func (blockService *BlockServiceSubmodule) API() *BlockServiceAPI