Documentation ¶
Index ¶
- Constants
- Variables
- func GenerateCommP(filepath string) (*abi.PieceInfo, 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 HostTransferStats
- 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(ctx context.Context, 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(ctx context.Context, dealUuid uuid.UUID, filePath string) (pi *api.ProviderDealRejectionInfo, err error)
- func (p *Provider) IsTransferStalled(dealUuid uuid.UUID) bool
- 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) Transfer(dealUuid uuid.UUID) []TransferPoint
- func (p *Provider) TransferStats() []*HostTransferStats
- func (p *Provider) Transfers() map[uuid.UUID][]TransferPoint
- type TransferLimiterConfig
- type 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 ¶
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 Config ¶
type Config struct { // The maximum amount of time a transfer can take before it fails MaxTransferDuration time.Duration // Whether to do commp on the Boost node (local) or the sealing node (remote) RemoteCommp bool // The number of commp processes that can run in parallel MaxConcurrentLocalCommp uint64 TransferLimiter TransferLimiterConfig }
type CurrentDealInfo ¶
type HostTransferStats ¶ added in v1.4.0
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, commpCalc smtypes.CommpCalculator, 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(ctx context.Context, 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(ctx context.Context, 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) IsTransferStalled ¶ added in v1.4.0
Indicates if a transfer has been marked as "stalled", ie the transfer is not making any progress
func (*Provider) NBytesReceived ¶
Get the number of bytes downloaded in total for the given deal
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
func (*Provider) Transfer ¶ added in v1.4.0
func (p *Provider) Transfer(dealUuid uuid.UUID) []TransferPoint
Transfer returns samples of an active transfer, sampled for up to 20s
func (*Provider) TransferStats ¶ added in v1.4.0
func (p *Provider) TransferStats() []*HostTransferStats
type TransferLimiterConfig ¶ added in v1.4.0
type TransferLimiterConfig struct { // The maximum number of concurrent transfers (soft limit - see comment below) MaxConcurrent uint64 // The period between checking if a connection has stalled StallCheckPeriod time.Duration // The time that can elapse before a download is considered stalled StallTimeout time.Duration }
type TransferPoint ¶ added in v1.4.0
type TransferPoint struct { // The time at which the sample was taken, truncated to the nearest second At time.Time // The number of bytes transferred Bytes uint64 }
A sample of the number of bytes transferred at the given time
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
mock_types
Package mock_types is a generated GoMock package.
|
Package mock_types is a generated GoMock package. |