Documentation ¶
Index ¶
- type FilChain
- type FilCold
- func (fc *FilCold) EnsureRenewals(ctx context.Context, c cid.Cid, inf ffs.FilInfo, cfg ffs.FilConfig) (ffs.FilInfo, []ffs.DealError, error)
- func (fc *FilCold) Fetch(ctx context.Context, dataCid cid.Cid, waddr string) error
- func (fc *FilCold) IsFilDealActive(ctx context.Context, proposalCid cid.Cid) (bool, error)
- func (fc *FilCold) Store(ctx context.Context, c cid.Cid, cfg ffs.FilConfig) ([]cid.Cid, []ffs.DealError, uint64, error)
- func (fc *FilCold) WaitForDeals(ctx context.Context, c cid.Cid, proposals []cid.Cid) ([]ffs.FilStorage, []ffs.DealError, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FilCold ¶
type FilCold struct {
// contains filtered or unexported fields
}
FilCold is a ColdStorage implementation which saves data in the Filecoin network. It assumes the underlying Filecoin client has access to an IPFS node where data is stored.
func New ¶
func New(ms ffs.MinerSelector, dm *deals.Module, ipfs iface.CoreAPI, chain FilChain, l ffs.CidLogger) *FilCold
New returns a new FilCold instance.
func (*FilCold) EnsureRenewals ¶
func (fc *FilCold) EnsureRenewals(ctx context.Context, c cid.Cid, inf ffs.FilInfo, cfg ffs.FilConfig) (ffs.FilInfo, []ffs.DealError, error)
EnsureRenewals analyzes a FilInfo state for a Cid and executes renewals considering the FilConfig desired configuration.
func (*FilCold) Fetch ¶
Fetch fetches the stored Cid data.The data will be considered available to the underlying blockstore.
func (*FilCold) IsFilDealActive ¶
IsFilDealActive returns true if a deal is considered active on-chain, false otherwise.
func (*FilCold) Store ¶
func (fc *FilCold) Store(ctx context.Context, c cid.Cid, cfg ffs.FilConfig) ([]cid.Cid, []ffs.DealError, uint64, error)
Store stores a Cid in Filecoin considering the configuration provided. The Cid is retrieved using the DAGService registered on instance creation. It returns a slice of ProposalCids that were correctly started, and a slice of with Proposal Cids rejected. Returned proposed deals can be tracked with the WaitForDeals API.
func (*FilCold) WaitForDeals ¶
func (fc *FilCold) WaitForDeals(ctx context.Context, c cid.Cid, proposals []cid.Cid) ([]ffs.FilStorage, []ffs.DealError, error)
WaitForDeals blocks waiting for all the provided proposals to reach a final status. It returns the ones that finished successfully and the other deal errors that happened on failed ones.