blockservice

package
v0.9.6 Latest Latest
Warning

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

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

Documentation

Index

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

func (blockServiceAPI *BlockServiceAPI) DAGCat(ctx context.Context, c cid.Cid) (io.Reader, error)

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

Jump to

Keyboard shortcuts

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