Documentation ¶
Index ¶
- func NewClientNodeAdapter(mctx helpers.MetricsCtx, lc fx.Lifecycle, stateapi full.StateAPI, ...) (storagemarket.StorageClientNode, error)
- func NewDealPublisher(feeConfig *config.MinerFeeConfig, publishMsgCfg PublishMsgConfig) ...
- func NewFixedBlockstoreAccessor(bs blockstore.Blockstore) storagemarket.BlockstoreAccessor
- func NewProviderNodeAdapter(fc *config.MinerFeeConfig, dc *config.DealmakingConfig) ...
- type ClientNodeAdapter
- func (c *ClientNodeAdapter) AddFunds(ctx context.Context, addr address.Address, amount abi.TokenAmount) (cid.Cid, error)
- func (c *ClientNodeAdapter) DealProviderCollateralBounds(ctx context.Context, size abi.PaddedPieceSize, isVerified bool) (abi.TokenAmount, abi.TokenAmount, error)
- func (c *ClientNodeAdapter) GetBalance(ctx context.Context, addr address.Address, encodedTs shared.TipSetToken) (storagemarket.Balance, error)
- func (c *ClientNodeAdapter) GetChainHead(ctx context.Context) (shared.TipSetToken, abi.ChainEpoch, error)
- func (c *ClientNodeAdapter) GetDefaultWalletAddress(ctx context.Context) (address.Address, error)
- func (c *ClientNodeAdapter) GetMinerInfo(ctx context.Context, addr address.Address, encodedTs shared.TipSetToken) (*storagemarket.StorageProviderInfo, error)
- func (c *ClientNodeAdapter) ListStorageProviders(ctx context.Context, encodedTs shared.TipSetToken) ([]*storagemarket.StorageProviderInfo, error)
- func (c *ClientNodeAdapter) OnDealExpiredOrSlashed(ctx context.Context, dealID abi.DealID, ...) error
- func (c *ClientNodeAdapter) OnDealSectorCommitted(ctx context.Context, provider address.Address, dealID abi.DealID, ...) error
- func (c *ClientNodeAdapter) OnDealSectorPreCommitted(ctx context.Context, provider address.Address, dealID abi.DealID, ...) error
- func (c *ClientNodeAdapter) ReleaseFunds(ctx context.Context, addr address.Address, amt abi.TokenAmount) error
- func (c *ClientNodeAdapter) ReserveFunds(ctx context.Context, wallet, addr address.Address, amt abi.TokenAmount) (cid.Cid, error)
- func (c *ClientNodeAdapter) SignBytes(ctx context.Context, signer address.Address, b []byte) (*crypto.Signature, error)
- func (c *ClientNodeAdapter) SignProposal(ctx context.Context, signer address.Address, proposal markettypes.DealProposal) (*markettypes.ClientDealProposal, error)
- func (c *ClientNodeAdapter) ValidatePublishedDeal(ctx context.Context, deal storagemarket.ClientDeal) (abi.DealID, error)
- func (c *ClientNodeAdapter) VerifySignature(ctx context.Context, sig crypto.Signature, addr address.Address, input []byte, ...) (bool, error)
- func (c *ClientNodeAdapter) WaitForMessage(ctx context.Context, mcid cid.Cid, ...) error
- type DealPublisher
- type ImportsBlockstoreAccessor
- type ProviderNodeAdapter
- func (n *ProviderNodeAdapter) AddFunds(ctx context.Context, addr address.Address, amount abi.TokenAmount) (cid.Cid, error)
- func (n *ProviderNodeAdapter) DealProviderCollateralBounds(ctx context.Context, size abi.PaddedPieceSize, isVerified bool) (abi.TokenAmount, abi.TokenAmount, error)
- func (n *ProviderNodeAdapter) GetBalance(ctx context.Context, addr address.Address, encodedTs shared.TipSetToken) (storagemarket.Balance, error)
- func (n *ProviderNodeAdapter) GetChainHead(ctx context.Context) (shared.TipSetToken, abi.ChainEpoch, error)
- func (n *ProviderNodeAdapter) GetDataCap(ctx context.Context, addr address.Address, encodedTs shared.TipSetToken) (*abi.StoragePower, error)
- func (n *ProviderNodeAdapter) GetMinerWorkerAddress(ctx context.Context, maddr address.Address, tok shared.TipSetToken) (address.Address, error)
- func (n *ProviderNodeAdapter) GetProofType(ctx context.Context, maddr address.Address, tok shared.TipSetToken) (abi.RegisteredSealProof, error)
- func (n *ProviderNodeAdapter) LocatePieceForDealWithinSector(ctx context.Context, dealID abi.DealID, encodedTs shared.TipSetToken) (sectorID abi.SectorNumber, offset abi.PaddedPieceSize, ...)
- func (n *ProviderNodeAdapter) OnDealComplete(ctx context.Context, deal storagemarket.MinerDeal, ...) (*storagemarket.PackingResult, error)
- func (n *ProviderNodeAdapter) OnDealExpiredOrSlashed(ctx context.Context, dealID abi.DealID, ...) error
- func (n *ProviderNodeAdapter) OnDealSectorCommitted(ctx context.Context, provider address.Address, dealID abi.DealID, ...) error
- func (n *ProviderNodeAdapter) OnDealSectorPreCommitted(ctx context.Context, provider address.Address, dealID abi.DealID, ...) error
- func (n *ProviderNodeAdapter) PublishDeals(ctx context.Context, deal storagemarket.MinerDeal) (cid.Cid, error)
- func (n *ProviderNodeAdapter) ReleaseFunds(ctx context.Context, addr address.Address, amt abi.TokenAmount) error
- func (n *ProviderNodeAdapter) ReserveFunds(ctx context.Context, wallet, addr address.Address, amt abi.TokenAmount) (cid.Cid, error)
- func (n *ProviderNodeAdapter) SignBytes(ctx context.Context, signer address.Address, b []byte) (*crypto.Signature, error)
- func (n *ProviderNodeAdapter) VerifySignature(ctx context.Context, sig crypto.Signature, addr address.Address, input []byte, ...) (bool, error)
- func (n *ProviderNodeAdapter) WaitForMessage(ctx context.Context, mcid cid.Cid, ...) error
- func (n *ProviderNodeAdapter) WaitForPublishDeals(ctx context.Context, publishCid cid.Cid, proposal markettypes.DealProposal) (*storagemarket.PublishDealsWaitResult, error)
- type ProxyBlockstoreAccessor
- type PublishMsgConfig
- type SectorCommittedManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewClientNodeAdapter ¶
func NewClientNodeAdapter(mctx helpers.MetricsCtx, lc fx.Lifecycle, stateapi full.StateAPI, chain full.ChainAPI, mpool full.MpoolAPI, fundmgr *market.FundManager) (storagemarket.StorageClientNode, error)
func NewDealPublisher ¶
func NewDealPublisher( feeConfig *config.MinerFeeConfig, publishMsgCfg PublishMsgConfig, ) func(lc fx.Lifecycle, full api.FullNode, as *ctladdr.AddressSelector) *DealPublisher
func NewFixedBlockstoreAccessor ¶
func NewFixedBlockstoreAccessor(bs blockstore.Blockstore) storagemarket.BlockstoreAccessor
func NewProviderNodeAdapter ¶
func NewProviderNodeAdapter(fc *config.MinerFeeConfig, dc *config.DealmakingConfig) func(mctx helpers.MetricsCtx, lc fx.Lifecycle, secb *sectorblocks.SectorBlocks, full v1api.FullNode, dealPublisher *DealPublisher) (storagemarket.StorageProviderNode, error)
Types ¶
type ClientNodeAdapter ¶
type ClientNodeAdapter struct {
// contains filtered or unexported fields
}
func (*ClientNodeAdapter) AddFunds ¶
func (c *ClientNodeAdapter) AddFunds(ctx context.Context, addr address.Address, amount abi.TokenAmount) (cid.Cid, error)
Adds funds with the StorageMinerActor for a storage participant. Used by both providers and clients.
func (*ClientNodeAdapter) DealProviderCollateralBounds ¶
func (c *ClientNodeAdapter) DealProviderCollateralBounds(ctx context.Context, size abi.PaddedPieceSize, isVerified bool) (abi.TokenAmount, abi.TokenAmount, error)
func (*ClientNodeAdapter) GetBalance ¶
func (c *ClientNodeAdapter) GetBalance(ctx context.Context, addr address.Address, encodedTs shared.TipSetToken) (storagemarket.Balance, error)
func (*ClientNodeAdapter) GetChainHead ¶
func (c *ClientNodeAdapter) GetChainHead(ctx context.Context) (shared.TipSetToken, abi.ChainEpoch, error)
func (*ClientNodeAdapter) GetDefaultWalletAddress ¶
func (c *ClientNodeAdapter) GetDefaultWalletAddress(ctx context.Context) (address.Address, error)
func (*ClientNodeAdapter) GetMinerInfo ¶
func (c *ClientNodeAdapter) GetMinerInfo(ctx context.Context, addr address.Address, encodedTs shared.TipSetToken) (*storagemarket.StorageProviderInfo, error)
func (*ClientNodeAdapter) ListStorageProviders ¶
func (c *ClientNodeAdapter) ListStorageProviders(ctx context.Context, encodedTs shared.TipSetToken) ([]*storagemarket.StorageProviderInfo, error)
func (*ClientNodeAdapter) OnDealExpiredOrSlashed ¶
func (c *ClientNodeAdapter) OnDealExpiredOrSlashed(ctx context.Context, dealID abi.DealID, onDealExpired storagemarket.DealExpiredCallback, onDealSlashed storagemarket.DealSlashedCallback) error
TODO: Replace dealID parameter with DealProposal
func (*ClientNodeAdapter) OnDealSectorCommitted ¶
func (c *ClientNodeAdapter) OnDealSectorCommitted(ctx context.Context, provider address.Address, dealID abi.DealID, sectorNumber abi.SectorNumber, proposal markettypes.DealProposal, publishCid *cid.Cid, cb storagemarket.DealSectorCommittedCallback) error
TODO: Remove dealID parameter, change publishCid to be cid.Cid (instead of pointer)
func (*ClientNodeAdapter) OnDealSectorPreCommitted ¶
func (c *ClientNodeAdapter) OnDealSectorPreCommitted(ctx context.Context, provider address.Address, dealID abi.DealID, proposal markettypes.DealProposal, publishCid *cid.Cid, cb storagemarket.DealSectorPreCommittedCallback) error
TODO: Remove dealID parameter, change publishCid to be cid.Cid (instead of pointer)
func (*ClientNodeAdapter) ReleaseFunds ¶
func (c *ClientNodeAdapter) ReleaseFunds(ctx context.Context, addr address.Address, amt abi.TokenAmount) error
func (*ClientNodeAdapter) ReserveFunds ¶
func (c *ClientNodeAdapter) ReserveFunds(ctx context.Context, wallet, addr address.Address, amt abi.TokenAmount) (cid.Cid, error)
func (*ClientNodeAdapter) SignProposal ¶
func (c *ClientNodeAdapter) SignProposal(ctx context.Context, signer address.Address, proposal markettypes.DealProposal) (*markettypes.ClientDealProposal, error)
func (*ClientNodeAdapter) ValidatePublishedDeal ¶
func (c *ClientNodeAdapter) ValidatePublishedDeal(ctx context.Context, deal storagemarket.ClientDeal) (abi.DealID, error)
ValidatePublishedDeal validates that the provided deal has appeared on chain and references the same ClientDeal returns the Deal id if there is no error TODO: Don't return deal ID
func (*ClientNodeAdapter) VerifySignature ¶
func (c *ClientNodeAdapter) VerifySignature(ctx context.Context, sig crypto.Signature, addr address.Address, input []byte, encodedTs shared.TipSetToken) (bool, error)
type DealPublisher ¶
type DealPublisher struct { Shutdown context.CancelFunc // contains filtered or unexported fields }
DealPublisher batches deal publishing so that many deals can be included in a single publish message. This saves gas for miners that publish deals frequently. When a deal is submitted, the DealPublisher waits a configurable amount of time for other deals to be submitted before sending the publish message. There is a configurable maximum number of deals that can be included in one message. When the limit is reached the DealPublisher immediately submits a publish message with all deals in the queue.
func (*DealPublisher) ForcePublishPendingDeals ¶
func (p *DealPublisher) ForcePublishPendingDeals()
ForcePublishPendingDeals publishes all pending deals without waiting for the publish period to elapse
func (*DealPublisher) PendingDeals ¶
func (p *DealPublisher) PendingDeals() api.PendingDealInfo
PendingDeals returns the list of deals that are queued up to be published
func (*DealPublisher) Publish ¶
func (p *DealPublisher) Publish(ctx context.Context, deal market.ClientDealProposal) (cid.Cid, error)
type ImportsBlockstoreAccessor ¶
type ImportsBlockstoreAccessor struct {
// contains filtered or unexported fields
}
ImportsBlockstoreAccessor is a blockstore accessor backed by the imports.Manager.
func NewImportsBlockstoreAccessor ¶
func NewImportsBlockstoreAccessor(importmgr *imports.Manager) *ImportsBlockstoreAccessor
func (*ImportsBlockstoreAccessor) Done ¶
func (s *ImportsBlockstoreAccessor) Done(payloadCID storagemarket.PayloadCID) error
func (*ImportsBlockstoreAccessor) Get ¶
func (s *ImportsBlockstoreAccessor) Get(payloadCID storagemarket.PayloadCID) (blockstore.Blockstore, error)
type ProviderNodeAdapter ¶
func (*ProviderNodeAdapter) AddFunds ¶
func (n *ProviderNodeAdapter) AddFunds(ctx context.Context, addr address.Address, amount abi.TokenAmount) (cid.Cid, error)
Adds funds with the StorageMinerActor for a storage participant. Used by both providers and clients.
func (*ProviderNodeAdapter) DealProviderCollateralBounds ¶
func (n *ProviderNodeAdapter) DealProviderCollateralBounds(ctx context.Context, size abi.PaddedPieceSize, isVerified bool) (abi.TokenAmount, abi.TokenAmount, error)
func (*ProviderNodeAdapter) GetBalance ¶
func (n *ProviderNodeAdapter) GetBalance(ctx context.Context, addr address.Address, encodedTs shared.TipSetToken) (storagemarket.Balance, error)
func (*ProviderNodeAdapter) GetChainHead ¶
func (n *ProviderNodeAdapter) GetChainHead(ctx context.Context) (shared.TipSetToken, abi.ChainEpoch, error)
func (*ProviderNodeAdapter) GetDataCap ¶
func (n *ProviderNodeAdapter) GetDataCap(ctx context.Context, addr address.Address, encodedTs shared.TipSetToken) (*abi.StoragePower, error)
func (*ProviderNodeAdapter) GetMinerWorkerAddress ¶
func (n *ProviderNodeAdapter) GetMinerWorkerAddress(ctx context.Context, maddr address.Address, tok shared.TipSetToken) (address.Address, error)
func (*ProviderNodeAdapter) GetProofType ¶
func (n *ProviderNodeAdapter) GetProofType(ctx context.Context, maddr address.Address, tok shared.TipSetToken) (abi.RegisteredSealProof, error)
func (*ProviderNodeAdapter) LocatePieceForDealWithinSector ¶
func (n *ProviderNodeAdapter) LocatePieceForDealWithinSector(ctx context.Context, dealID abi.DealID, encodedTs shared.TipSetToken) (sectorID abi.SectorNumber, offset abi.PaddedPieceSize, length abi.PaddedPieceSize, err error)
TODO: why doesnt this method take in a sector ID?
func (*ProviderNodeAdapter) OnDealComplete ¶
func (n *ProviderNodeAdapter) OnDealComplete(ctx context.Context, deal storagemarket.MinerDeal, pieceSize abi.UnpaddedPieceSize, pieceData shared.ReadSeekStarter) (*storagemarket.PackingResult, error)
func (*ProviderNodeAdapter) OnDealExpiredOrSlashed ¶
func (n *ProviderNodeAdapter) OnDealExpiredOrSlashed(ctx context.Context, dealID abi.DealID, onDealExpired storagemarket.DealExpiredCallback, onDealSlashed storagemarket.DealSlashedCallback) error
func (*ProviderNodeAdapter) OnDealSectorCommitted ¶
func (n *ProviderNodeAdapter) OnDealSectorCommitted(ctx context.Context, provider address.Address, dealID abi.DealID, sectorNumber abi.SectorNumber, proposal markettypes.DealProposal, publishCid *cid.Cid, cb storagemarket.DealSectorCommittedCallback) error
TODO: Remove dealID parameter, change publishCid to be cid.Cid (instead of pointer)
func (*ProviderNodeAdapter) OnDealSectorPreCommitted ¶
func (n *ProviderNodeAdapter) OnDealSectorPreCommitted(ctx context.Context, provider address.Address, dealID abi.DealID, proposal markettypes.DealProposal, publishCid *cid.Cid, cb storagemarket.DealSectorPreCommittedCallback) error
TODO: Remove dealID parameter, change publishCid to be cid.Cid (instead of pointer)
func (*ProviderNodeAdapter) PublishDeals ¶
func (n *ProviderNodeAdapter) PublishDeals(ctx context.Context, deal storagemarket.MinerDeal) (cid.Cid, error)
func (*ProviderNodeAdapter) ReleaseFunds ¶
func (n *ProviderNodeAdapter) ReleaseFunds(ctx context.Context, addr address.Address, amt abi.TokenAmount) error
func (*ProviderNodeAdapter) ReserveFunds ¶
func (n *ProviderNodeAdapter) ReserveFunds(ctx context.Context, wallet, addr address.Address, amt abi.TokenAmount) (cid.Cid, error)
func (*ProviderNodeAdapter) VerifySignature ¶
func (n *ProviderNodeAdapter) VerifySignature(ctx context.Context, sig crypto.Signature, addr address.Address, input []byte, encodedTs shared.TipSetToken) (bool, error)
func (*ProviderNodeAdapter) WaitForMessage ¶
func (*ProviderNodeAdapter) WaitForPublishDeals ¶
func (n *ProviderNodeAdapter) WaitForPublishDeals(ctx context.Context, publishCid cid.Cid, proposal markettypes.DealProposal) (*storagemarket.PublishDealsWaitResult, error)
type ProxyBlockstoreAccessor ¶
type ProxyBlockstoreAccessor struct {
Blockstore blockstore.Blockstore
}
ProxyBlockstoreAccessor is an accessor that returns a fixed blockstore. To be used in combination with IPFS integration.
func (*ProxyBlockstoreAccessor) Done ¶
func (p *ProxyBlockstoreAccessor) Done(cid storagemarket.PayloadCID) error
func (*ProxyBlockstoreAccessor) Get ¶
func (p *ProxyBlockstoreAccessor) Get(cid storagemarket.PayloadCID) (blockstore.Blockstore, error)
type PublishMsgConfig ¶
type PublishMsgConfig struct { // The amount of time to wait for more deals to arrive before // publishing Period time.Duration // The maximum number of deals to include in a single PublishStorageDeals // message MaxDealsPerMsg uint64 // Minimum start epoch buffer to give time for sealing of sector with deal StartEpochSealingBuffer uint64 }
type SectorCommittedManager ¶
type SectorCommittedManager struct {
// contains filtered or unexported fields
}
func NewSectorCommittedManager ¶
func NewSectorCommittedManager(ev eventsCalledAPI, tskAPI pipeline.CurrentDealInfoAPI, dpcAPI diffPreCommitsAPI) *SectorCommittedManager
func (*SectorCommittedManager) OnDealSectorCommitted ¶
func (mgr *SectorCommittedManager) OnDealSectorCommitted(ctx context.Context, provider address.Address, sectorNumber abi.SectorNumber, proposal market.DealProposal, publishCid cid.Cid, callback storagemarket.DealSectorCommittedCallback) error
func (*SectorCommittedManager) OnDealSectorPreCommitted ¶
func (mgr *SectorCommittedManager) OnDealSectorPreCommitted(ctx context.Context, provider address.Address, proposal market.DealProposal, publishCid cid.Cid, callback storagemarket.DealSectorPreCommittedCallback) error