Documentation ¶
Index ¶
- Constants
- Variables
- func GenerateCommP(filepath string) (cidAndSize *writer.DataCIDSize, finalErr error)
- func GeneratePieceCommitment(filepath string, dealSize abi.PaddedPieceSize) (c cid.Cid, finalErr error)
- type ChainDealManager
- func (c *ChainDealManager) CheckDealEquality(ctx context.Context, tok ctypes.TipSetKey, p1, p2 market.DealProposal) (bool, error)
- func (c *ChainDealManager) GetCurrentDealInfo(ctx context.Context, tok ctypes.TipSetKey, proposal *market.DealProposal, ...) (CurrentDealInfo, error)
- func (c *ChainDealManager) WaitForPublishDeals(ctx context.Context, publishCid cid.Cid, proposal market8.DealProposal) (*storagemarket.PublishDealsWaitResult, error)
- type ChainDealManagerCfg
- type Config
- type CurrentDealInfo
- type Provider
- func (p *Provider) AddPieceToSector(ctx context.Context, deal smtypes.ProviderDealState, pieceData io.Reader) (*storagemarket.PackingResult, error)
- func (p *Provider) CancelDealDataTransfer(dealUuid uuid.UUID) error
- func (p *Provider) Deal(ctx context.Context, dealUuid uuid.UUID) (*types.ProviderDealState, error)
- func (p *Provider) DealBySignedProposalCid(ctx context.Context, propCid cid.Cid) (*types.ProviderDealState, error)
- func (p *Provider) ExecuteDeal(dp *types.DealParams, clientPeer peer.ID) (*api.ProviderDealRejectionInfo, error)
- func (p *Provider) FailPausedDeal(dealUuid uuid.UUID) error
- func (p *Provider) GetAsk() *storagemarket.SignedStorageAsk
- func (p *Provider) GetBalance(ctx context.Context, addr address.Address, encodedTs shared.TipSetToken) (storagemarket.Balance, error)
- func (p *Provider) ImportOfflineDealData(dealUuid uuid.UUID, filePath string) (pi *api.ProviderDealRejectionInfo, err error)
- func (p *Provider) NBytesReceived(dealUuid uuid.UUID) uint64
- func (p *Provider) RetryPausedDeal(dealUuid uuid.UUID) error
- func (p *Provider) Start() error
- func (p *Provider) Stop()
- func (p *Provider) SubscribeDealUpdates(dealUuid uuid.UUID) (event.Subscription, error)
- func (p *Provider) SubscribeNewDeals() (event.Subscription, error)
- func (p *Provider) Transfers() map[uuid.UUID][]transferPoint
Constants ¶
const (
// DealCancelled means that a deal has been cancelled by the caller
DealCancelled = "Cancelled"
)
const DealMaxLabelSize = 256
Variables ¶
var ( ErrDealNotFound = fmt.Errorf("deal not found") ErrDealHandlerNotFound = errors.New("deal handler not found") )
Functions ¶
func GenerateCommP ¶
func GenerateCommP(filepath string) (cidAndSize *writer.DataCIDSize, finalErr error)
GenerateCommP
func GeneratePieceCommitment ¶
func GeneratePieceCommitment(filepath string, dealSize abi.PaddedPieceSize) (c cid.Cid, finalErr error)
GeneratePieceCommitment generates the pieceCid for the CARv1 deal payload in the CARv2 file that already exists at the given path.
Types ¶
type ChainDealManager ¶
type ChainDealManager struct {
// contains filtered or unexported fields
}
func NewChainDealManager ¶
func NewChainDealManager(a v1api.FullNode, cfg ChainDealManagerCfg) *ChainDealManager
func (*ChainDealManager) CheckDealEquality ¶
func (c *ChainDealManager) CheckDealEquality(ctx context.Context, tok ctypes.TipSetKey, p1, p2 market.DealProposal) (bool, error)
func (*ChainDealManager) GetCurrentDealInfo ¶
func (c *ChainDealManager) GetCurrentDealInfo(ctx context.Context, tok ctypes.TipSetKey, proposal *market.DealProposal, publishCid cid.Cid) (CurrentDealInfo, error)
GetCurrentDealInfo gets the current deal state and deal ID. Note that the deal ID is assigned when the deal is published, so it may have changed if there was a reorg after the deal was published.
func (*ChainDealManager) WaitForPublishDeals ¶
func (c *ChainDealManager) WaitForPublishDeals(ctx context.Context, publishCid cid.Cid, proposal market8.DealProposal) (*storagemarket.PublishDealsWaitResult, error)
type ChainDealManagerCfg ¶
type ChainDealManagerCfg struct {
PublishDealsConfidence uint64
}
type CurrentDealInfo ¶
type Provider ¶
type Provider struct { // Address of the provider on chain. Address address.Address Transport transport.Transport // contains filtered or unexported fields }
func NewProvider ¶
func NewProvider(cfg Config, sqldb *sql.DB, dealsDB *db.DealsDB, fundMgr *fundmanager.FundManager, storageMgr *storagemanager.StorageManager, fullnodeApi v1api.FullNode, dp types.DealPublisher, addr address.Address, pa types.PieceAdder, sps sealingpipeline.API, cm types.ChainDealManager, df dtypes.StorageDealFilter, logsSqlDB *sql.DB, logsDB *db.LogsDB, dagst stores.DAGStoreWrapper, ps piecestore.PieceStore, ip types.IndexProvider, askGetter types.AskGetter, sigVerifier types.SignatureVerifier, dl *logs.DealLogger, tspt transport.Transport) (*Provider, error)
func (*Provider) AddPieceToSector ¶
func (p *Provider) AddPieceToSector(ctx context.Context, deal smtypes.ProviderDealState, pieceData io.Reader) (*storagemarket.PackingResult, error)
func (*Provider) CancelDealDataTransfer ¶
func (*Provider) DealBySignedProposalCid ¶ added in v1.1.0
func (*Provider) ExecuteDeal ¶
func (p *Provider) ExecuteDeal(dp *types.DealParams, clientPeer peer.ID) (*api.ProviderDealRejectionInfo, error)
ExecuteDeal is called when the Storage Provider receives a deal proposal from the network
func (*Provider) FailPausedDeal ¶
FailPausedDeal moves a deal from the paused state to the failed state
func (*Provider) GetAsk ¶
func (p *Provider) GetAsk() *storagemarket.SignedStorageAsk
func (*Provider) GetBalance ¶
func (p *Provider) GetBalance(ctx context.Context, addr address.Address, encodedTs shared.TipSetToken) (storagemarket.Balance, error)
func (*Provider) ImportOfflineDealData ¶
func (p *Provider) ImportOfflineDealData(dealUuid uuid.UUID, filePath string) (pi *api.ProviderDealRejectionInfo, err error)
ImportOfflineDealData is called when the Storage Provider imports data for an offline deal (the deal must already have been proposed by the client)
func (*Provider) RetryPausedDeal ¶
RetryPausedDeal starts execution of a deal from the point at which it stopped
func (*Provider) SubscribeDealUpdates ¶
SubscribeDealUpdates subscribes to updates to a deal
func (*Provider) SubscribeNewDeals ¶
func (p *Provider) SubscribeNewDeals() (event.Subscription, error)
SubscribeNewDeals subscribes to "new deal" events
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
mock_types
Package mock_types is a generated GoMock package.
|
Package mock_types is a generated GoMock package. |