Documentation ¶
Index ¶
- Constants
- Variables
- func GenerateCommP(filepath string) (*abi.PieceInfo, error)
- func HasDeal(deals []abi.DealID, pdsDealId abi.DealID) bool
- func IsFinalSealingState(state lapi.SectorState) bool
- 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 ContractDealMonitor
- type CurrentDealInfo
- type DagstoreShardRegistry
- 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) CancelOfflineDealAwaitingImport(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, delAfterImport bool) (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 SealingPipelineCache
- type TransferLimiterConfig
- type TransferPoint
Constants ¶
const (
// DealCancelled means that a deal has been cancelled by the caller
DealCancelled = "Cancelled"
)
const DealMaxLabelSize = 256
const OneGib = 1024 * 1024 * 1024
Variables ¶
var ( ErrDealNotFound = fmt.Errorf("deal not found") ErrDealHandlerNotFound = errors.New("deal handler not found") ErrDealNotSealed = errors.New("storage failed - deal not found in sector") )
var DealClientABI = `` /* 5453-byte string literal not displayed */
var ErrCommpMismatch = fmt.Errorf("commp mismatch")
var (
TopicHash = paddedEthHash(ethTopicHash("DealProposalCreate(bytes32,uint64,bool,uint256)")) // deals published on chain
)
Functions ¶
func GenerateCommP ¶
GenerateCommP calculates commp locally
func IsFinalSealingState ¶ added in v1.7.3
func IsFinalSealingState(state lapi.SectorState) bool
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 // Cleanup deal logs from DB older than this many number of days DealLogDurationDays int // Cache timeout for Sealing Pipeline status SealingPipelineCacheTimeout time.Duration StorageFilter string }
type ContractDealMonitor ¶ added in v1.6.0
type ContractDealMonitor struct {
// contains filtered or unexported fields
}
func NewContractDealMonitor ¶ added in v1.6.0
func NewContractDealMonitor(p *Provider, a api.FullNode, subCh *gateway.EthSubHandler, cfg *config.ContractDealsConfig, maddr address.Address) *ContractDealMonitor
func (*ContractDealMonitor) Start ¶ added in v1.6.0
func (c *ContractDealMonitor) Start(ctx context.Context) error
func (*ContractDealMonitor) Stop ¶ added in v1.6.0
func (c *ContractDealMonitor) Stop() error
type CurrentDealInfo ¶
type DagstoreShardRegistry ¶ added in v1.7.0
type DagstoreShardRegistry interface {
RegisterShard(ctx context.Context, pieceCid cid.Cid, carPath string, eagerInit bool, resch chan dagstore.ShardResult) error
}
DagstoreShardRegistry provides the one method from the Dagstore that we use in deal execution: registering a shard
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 DagstoreShardRegistry, 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) CancelOfflineDealAwaitingImport ¶ added in v1.7.3
CancelOfflineDealAwaitingImport moves an offline deal from waiting for data state to the failed state
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, delAfterImport bool) (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 SealingPipelineCache ¶ added in v1.5.2
type SealingPipelineCache struct { Status sealingpipeline.Status CacheTime time.Time CacheError error }
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
Package mock is a generated GoMock package.
|
Package mock is a generated GoMock package. |
mock_types
Package mock_types is a generated GoMock package.
|
Package mock_types is a generated GoMock package. |