storageadapter

package
v0.0.0-...-0d2a5dc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 7, 2020 License: Apache-2.0, MIT Imports: 34 Imported by: 0

Documentation

Index

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 ClientDealFunds funds.DealFunds

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

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL