Documentation ¶
Index ¶
- Variables
- type Config
- type DealInfo
- type Module
- func (m *Module) Fetch(ctx context.Context, waddr string, cid cid.Cid) error
- func (m *Module) GetDealStatus(ctx context.Context, pcid cid.Cid) (storagemarket.StorageDealStatus, bool, error)
- func (m *Module) Import(ctx context.Context, data io.Reader, isCAR bool) (cid.Cid, int64, error)
- func (m *Module) Retrieve(ctx context.Context, waddr string, cid cid.Cid, CAREncoding bool) (io.ReadCloser, error)
- func (m *Module) Store(ctx context.Context, waddr string, dataCid cid.Cid, size uint64, ...) ([]StoreResult, error)
- func (m *Module) Watch(ctx context.Context, proposals []cid.Cid) (<-chan DealInfo, error)
- type Option
- type StorageDealConfig
- type StoreResult
Constants ¶
This section is empty.
Variables ¶
var ( // ErrRetrievalNoAvailableProviders indicates that the data isn't available on any provided // to be retrieved. ErrRetrievalNoAvailableProviders = errors.New("no providers to retrieve the data") // 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") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
ImportPath string
}
Config contains configuration for storing deals.
type DealInfo ¶
type DealInfo struct { ProposalCid cid.Cid StateID uint64 StateName string Miner string PieceCID cid.Cid Size uint64 PricePerEpoch uint64 Duration uint64 DealID uint64 ActivationEpoch int64 Message string }
DealInfo contains information about a proposal storage deal
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
Module exposes storage and monitoring from the market.
func New ¶
func New(api *apistruct.FullNodeStruct, opts ...Option) (*Module, error)
New creates a new Module.
func (*Module) Fetch ¶
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) GetDealStatus ¶
func (m *Module) GetDealStatus(ctx context.Context, pcid cid.Cid) (storagemarket.StorageDealStatus, bool, error)
GetDealStatus returns the current status of the deal, and a flag indicating if the miner of the deal was slashed. If the deal doesn't exist, *or has expired* it will return ErrDealNotFound. There's not actual way of distinguishing both scenarios in Lotus.
func (*Module) Import ¶
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) Retrieve ¶
func (m *Module) Retrieve(ctx context.Context, waddr string, cid cid.Cid, CAREncoding bool) (io.ReadCloser, error)
Retrieve retrieves Deal data.
func (*Module) Store ¶
func (m *Module) Store(ctx context.Context, waddr string, dataCid cid.Cid, size uint64, dcfgs []StorageDealConfig, duration uint64) ([]StoreResult, error)
Store create Deal Proposals with all miners indicated in dcfgs. The epoch price is automatically calculated considering each miner epoch price and data 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).
type Option ¶
Option sets values on a Config.
func WithImportPath ¶
WithImportPath indicates the import path that will be used to store data to later be imported to Lotus.
type StorageDealConfig ¶
StorageDealConfig contains information about a storage proposal for a miner
type StoreResult ¶
type StoreResult struct { ProposalCid cid.Cid Config StorageDealConfig Success bool Message string }
StoreResult contains information about Executing deals.