module

package
v2.6.2 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2021 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrDealNotFound indicates a particular ProposalCid from a deal isn't found on-chain. Currently,
	// in Lotus this indicates that it may never existed on-chain, or it existed but it already expired
	// (currEpoch > StartEpoch+Duration).
	ErrDealNotFound = errors.New("deal not found on-chain")
)
View Source
var (
	// ErrRetrievalNoAvailableProviders indicates that the data isn't available on any provided
	// to be retrieved.
	ErrRetrievalNoAvailableProviders = errors.New("no providers to retrieve the data")
)

Functions

This section is empty.

Types

type Module

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

Module exposes storage and monitoring from the market.

func New

func New(ds datastore.TxnDatastore, clientBuilder lotus.ClientBuilder, pollDuration time.Duration, dealFinalityTimeout time.Duration, opts ...deals.Option) (*Module, error)

New creates a new Module.

func (*Module) CalculateDealPiece

func (m *Module) CalculateDealPiece(ctx context.Context, c cid.Cid) (api.DataCIDSize, error)

CalculateDealPiece calculates the size and CommP for a data cid.

func (*Module) Close added in v2.4.0

func (m *Module) Close() error

Close gracefully shutdowns the deals module.

func (*Module) Fetch

func (m *Module) Fetch(ctx context.Context, waddr string, payloadCid cid.Cid, pieceCid *cid.Cid, miners []string) (string, <-chan marketevents.RetrievalEvent, error)

Fetch fetches deal data to the underlying blockstore of the Filecoin client. This API is meant for clients that use external implementations of blockstores with their own API, e.g: IPFS.

func (*Module) GetDealInfo

func (m *Module) GetDealInfo(ctx context.Context, dealID uint64) (api.MarketDeal, error)

GetDealInfo returns info about a deal. If the deal isn't active on-chain, it returns ErrDealNotFound.

func (*Module) GetUpdatedRetrievalRecordsSince added in v2.1.0

func (m *Module) GetUpdatedRetrievalRecordsSince(since time.Time, limit int) ([]deals.RetrievalDealRecord, error)

GetUpdatedRetrievalRecordsSince returns all the retrieval records that got created or updated since sinceNano.

func (*Module) GetUpdatedStorageDealRecordsSince added in v2.1.0

func (m *Module) GetUpdatedStorageDealRecordsSince(since time.Time, limit int) ([]deals.StorageDealRecord, error)

GetUpdatedStorageDealRecordsSince returns all the storage deal records that got created or updated since sinceNano.

func (*Module) Import

func (m *Module) Import(ctx context.Context, data io.Reader, isCAR bool) (cid.Cid, int64, error)

Import imports raw data in the Filecoin client. The isCAR flag indicates if the data is already in CAR format, so it shouldn't be encoded into a UnixFS DAG in the Filecoin client. It returns the imported data cid and the data size.

func (*Module) ListRetrievalDealRecords

func (m *Module) ListRetrievalDealRecords(opts ...deals.DealRecordsOption) ([]deals.RetrievalDealRecord, error)

ListRetrievalDealRecords returns a list of retrieval deals according to the provided options.

func (*Module) ListStorageDealRecords

func (m *Module) ListStorageDealRecords(opts ...deals.DealRecordsOption) ([]deals.StorageDealRecord, error)

ListStorageDealRecords lists storage deals according to the provided options.

func (*Module) Retrieve

func (m *Module) Retrieve(ctx context.Context, waddr string, payloadCid cid.Cid, pieceCid *cid.Cid, miners []string, CAREncoding bool) (string, io.ReadCloser, error)

Retrieve retrieves Deal data. It returns the miner address where the data is being fetched from, and a byte reader to read the retrieved data.

func (*Module) Store

func (m *Module) Store(ctx context.Context, waddr string, dataCid cid.Cid, dataSize int64, pieceSize abi.PaddedPieceSize, pieceCid cid.Cid, dcfgs []deals.StorageDealConfig, minDuration uint64) ([]deals.StoreResult, error)

Store create Deal Proposals with all miners indicated in dcfgs. The epoch price is automatically calculated considering each miner epoch price and piece size. The data of dataCid should be already imported to the Filecoin Client or should be accessible to it. (e.g: is integrated with an IPFS node).

func (*Module) Watch

func (m *Module) Watch(ctx context.Context, proposal cid.Cid) (<-chan deals.StorageDealInfo, error)

Watch returns a channel with state changes of indicated proposals.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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