Documentation ¶
Index ¶
- func InitStorageClient(params *mutils.MarketParams) (storagemarket.StorageClient, error)
- func NewStorageClientNode() storagemarket.StorageClientNode
- func StorageClient(h host.Host, ibs dtypes.ClientBlockstore, mds *multistore.MultiStore, ...) (storagemarket.StorageClient, error)
- type ClientDealFunds
- type ClientNodeAdapter
- func (n *ClientNodeAdapter) AddFunds(ctx context.Context, addr address.Address, amount abi.TokenAmount) (cid.Cid, error)
- func (n *ClientNodeAdapter) DealProviderCollateralBounds(ctx context.Context, size abi.PaddedPieceSize, isVerified bool) (abi.TokenAmount, abi.TokenAmount, error)
- func (n *ClientNodeAdapter) EnsureFunds(ctx context.Context, addr, wallet address.Address, amount abi.TokenAmount, ...) (cid.Cid, error)
- func (n *ClientNodeAdapter) GetBalance(ctx context.Context, addr address.Address, encodedTs shared.TipSetToken) (storagemarket.Balance, error)
- func (n *ClientNodeAdapter) GetChainHead(ctx context.Context) (shared.TipSetToken, abi.ChainEpoch, error)
- func (n *ClientNodeAdapter) GetDefaultWalletAddress(ctx context.Context) (address.Address, error)
- func (n *ClientNodeAdapter) GetMinerInfo(ctx context.Context, maddr address.Address, encodedTs shared.TipSetToken) (*storagemarket.StorageProviderInfo, error)
- func (n *ClientNodeAdapter) ListClientDeals(ctx context.Context, addr address.Address, encodedTs shared.TipSetToken) ([]storagemarket.StorageDeal, error)
- func (n *ClientNodeAdapter) ListStorageProviders(ctx context.Context, encodedTs shared.TipSetToken) ([]*storagemarket.StorageProviderInfo, error)
- func (n *ClientNodeAdapter) OnDealExpiredOrSlashed(ctx context.Context, dealID abi.DealID, ...) error
- func (n *ClientNodeAdapter) OnDealSectorCommitted(ctx context.Context, provider address.Address, dealID abi.DealID, ...) error
- func (n *ClientNodeAdapter) SignBytes(ctx context.Context, signer address.Address, b []byte) (*crypto.Signature, error)
- func (n *ClientNodeAdapter) SignProposal(ctx context.Context, signer address.Address, proposal market.DealProposal) (*market.ClientDealProposal, error)
- func (n *ClientNodeAdapter) ValidateAskSignature(ctx context.Context, ask *storagemarket.SignedStorageAsk, ...) (bool, error)
- func (n *ClientNodeAdapter) ValidatePublishedDeal(ctx context.Context, deal storagemarket.ClientDeal) (abi.DealID, error)
- func (n *ClientNodeAdapter) VerifySignature(ctx context.Context, signature crypto.Signature, signer address.Address, ...) (bool, error)
- func (n *ClientNodeAdapter) WaitForMessage(ctx context.Context, mcid cid.Cid, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitStorageClient ¶
func InitStorageClient(params *mutils.MarketParams) (storagemarket.StorageClient, error)
func NewStorageClientNode ¶
func NewStorageClientNode() storagemarket.StorageClientNode
func StorageClient ¶
func StorageClient(h host.Host, ibs dtypes.ClientBlockstore, mds *multistore.MultiStore, dataTransfer datatransfer.Manager, discovery *discovery.Local, deals dtypes.ClientDatastore, scn storagemarket.StorageClientNode, dealFunds ClientDealFunds) (storagemarket.StorageClient, error)
Types ¶
type ClientDealFunds ¶
type ClientNodeAdapter ¶
type ClientNodeAdapter struct { nodeapi.ChainStore nodeapi.StateManager nodeapi.Chain nodeapi.Mpool nodeapi.State nodeapi.ApiBStore nodeapi.Wallet // contains filtered or unexported fields }
func (*ClientNodeAdapter) AddFunds ¶
func (n *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 (n *ClientNodeAdapter) DealProviderCollateralBounds(ctx context.Context, size abi.PaddedPieceSize, isVerified bool) (abi.TokenAmount, abi.TokenAmount, error)
func (*ClientNodeAdapter) EnsureFunds ¶
func (n *ClientNodeAdapter) EnsureFunds(ctx context.Context, addr, wallet address.Address, amount abi.TokenAmount, tok shared.TipSetToken) (cid.Cid, error)
EnsureFunds ensures that a storage market participant has a certain amount of available funds If additional funds are needed, they will be sent from the 'wallet' address, and a cid for the corresponding chain message is returned
func (*ClientNodeAdapter) GetBalance ¶
func (n *ClientNodeAdapter) GetBalance(ctx context.Context, addr address.Address, encodedTs shared.TipSetToken) (storagemarket.Balance, error)
GetBalance returns locked/unlocked for a storage participant. Used by both providers and clients.
func (*ClientNodeAdapter) GetChainHead ¶
func (n *ClientNodeAdapter) GetChainHead(ctx context.Context) (shared.TipSetToken, abi.ChainEpoch, error)
GetChainHead returns a tipset token for the current chain head
func (*ClientNodeAdapter) GetDefaultWalletAddress ¶
func (n *ClientNodeAdapter) GetDefaultWalletAddress(ctx context.Context) (address.Address, error)
func (*ClientNodeAdapter) GetMinerInfo ¶
func (n *ClientNodeAdapter) GetMinerInfo(ctx context.Context, maddr address.Address, encodedTs shared.TipSetToken) (*storagemarket.StorageProviderInfo, error)
func (*ClientNodeAdapter) ListClientDeals ¶
func (n *ClientNodeAdapter) ListClientDeals(ctx context.Context, addr address.Address, encodedTs shared.TipSetToken) ([]storagemarket.StorageDeal, error)
func (*ClientNodeAdapter) ListStorageProviders ¶
func (n *ClientNodeAdapter) ListStorageProviders(ctx context.Context, encodedTs shared.TipSetToken) ([]*storagemarket.StorageProviderInfo, error)
func (*ClientNodeAdapter) OnDealExpiredOrSlashed ¶
func (n *ClientNodeAdapter) OnDealExpiredOrSlashed(ctx context.Context, dealID abi.DealID, onDealExpired storagemarket.DealExpiredCallback, onDealSlashed storagemarket.DealSlashedCallback) error
func (*ClientNodeAdapter) OnDealSectorCommitted ¶
func (n *ClientNodeAdapter) OnDealSectorCommitted(ctx context.Context, provider address.Address, dealID abi.DealID, cb storagemarket.DealSectorCommittedCallback) error
OnDealSectorCommitted waits for a deal's sector to be sealed and proved, indicating the deal is active
func (*ClientNodeAdapter) SignBytes ¶
func (n *ClientNodeAdapter) SignBytes(ctx context.Context, signer address.Address, b []byte) (*crypto.Signature, error)
SignsBytes signs the given data with the given address's private key
func (*ClientNodeAdapter) SignProposal ¶
func (n *ClientNodeAdapter) SignProposal(ctx context.Context, signer address.Address, proposal market.DealProposal) (*market.ClientDealProposal, error)
func (*ClientNodeAdapter) ValidateAskSignature ¶
func (n *ClientNodeAdapter) ValidateAskSignature(ctx context.Context, ask *storagemarket.SignedStorageAsk, encodedTs shared.TipSetToken) (bool, error)
func (*ClientNodeAdapter) ValidatePublishedDeal ¶
func (n *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
func (*ClientNodeAdapter) VerifySignature ¶
func (n *ClientNodeAdapter) VerifySignature(ctx context.Context, signature crypto.Signature, signer address.Address, plaintext []byte, encodedTs shared.TipSetToken) (bool, error)
VerifySignature verifies a given set of data was signed properly by a given address's private key
func (*ClientNodeAdapter) WaitForMessage ¶
func (n *ClientNodeAdapter) WaitForMessage(ctx context.Context, mcid cid.Cid, onCompletion func(exitcode.ExitCode, []byte, error) error) error
WaitForMessage waits until a message appears on chain. If it is already on chain, the callback is called immediately