Documentation ¶
Index ¶
- func InitRetrievalClient(params *mutils.MarketParams) (retrievalmarket.RetrievalClient, error)
- func NewRetrievalClientNode() retrievalmarket.RetrievalClientNode
- func RetrievalClient(h host.Host, mds dtypes.ClientMultiDstore, dt dtypes.ClientDataTransfer, ...) (retrievalmarket.RetrievalClient, error)
- type ClientNodeAdapter
- func (c *ClientNodeAdapter) AllocateLane(paymentChannel address.Address) (uint64, error)
- func (c *ClientNodeAdapter) CreatePaymentVoucher(ctx context.Context, paymentChannel address.Address, amount abi.TokenAmount, ...) (*paych.SignedVoucher, error)
- func (c *ClientNodeAdapter) GetChainHead(ctx context.Context) (shared.TipSetToken, abi.ChainEpoch, error)
- func (c *ClientNodeAdapter) GetKnownAddresses(ctx context.Context, p retrievalmarket.RetrievalPeer, tok shared.TipSetToken) ([]multiaddr.Multiaddr, error)
- func (c *ClientNodeAdapter) GetOrCreatePaymentChannel(ctx context.Context, clientAddress, minerAddress address.Address, ...) (address.Address, cid.Cid, error)
- func (c *ClientNodeAdapter) WaitForPaymentChannelAddFunds(messageCID cid.Cid) error
- func (c *ClientNodeAdapter) WaitForPaymentChannelCreation(messageCID cid.Cid) (address.Address, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitRetrievalClient ¶
func InitRetrievalClient(params *mutils.MarketParams) (retrievalmarket.RetrievalClient, error)
func NewRetrievalClientNode ¶
func NewRetrievalClientNode() retrievalmarket.RetrievalClientNode
func RetrievalClient ¶
func RetrievalClient(h host.Host, mds dtypes.ClientMultiDstore, dt dtypes.ClientDataTransfer, resolver retrievalmarket.PeerResolver, ds dtypes.MetadataDS, adapter retrievalmarket.RetrievalClientNode) (retrievalmarket.RetrievalClient, error)
Types ¶
type ClientNodeAdapter ¶
type ClientNodeAdapter struct { nodeapi.StateManager nodeapi.Chain nodeapi.PaymentManager nodeapi.State }
func (*ClientNodeAdapter) AllocateLane ¶
func (c *ClientNodeAdapter) AllocateLane(paymentChannel address.Address) (uint64, error)
Allocate late creates a lane within a payment channel so that calls to CreatePaymentVoucher will automatically make vouchers only for the difference in total
func (*ClientNodeAdapter) CreatePaymentVoucher ¶
func (c *ClientNodeAdapter) CreatePaymentVoucher(ctx context.Context, paymentChannel address.Address, amount abi.TokenAmount, lane uint64, tok shared.TipSetToken) (*paych.SignedVoucher, error)
CreatePaymentVoucher creates a new payment voucher in the given lane for a given payment channel so that all the payment vouchers in the lane add up to the given amount (so the payment voucher will be for the difference)
func (*ClientNodeAdapter) GetChainHead ¶
func (c *ClientNodeAdapter) GetChainHead(ctx context.Context) (shared.TipSetToken, abi.ChainEpoch, error)
GetChainHead gets the current chain head. Return its TipSetToken and its abi.ChainEpoch.
func (*ClientNodeAdapter) GetKnownAddresses ¶
func (c *ClientNodeAdapter) GetKnownAddresses(ctx context.Context, p retrievalmarket.RetrievalPeer, tok shared.TipSetToken) ([]multiaddr.Multiaddr, error)
func (*ClientNodeAdapter) GetOrCreatePaymentChannel ¶
func (c *ClientNodeAdapter) GetOrCreatePaymentChannel(ctx context.Context, clientAddress, minerAddress address.Address, clientFundsAvailable abi.TokenAmount, tok shared.TipSetToken) (address.Address, cid.Cid, error)
GetOrCreatePaymentChannel sets up a new payment channel if one does not exist between a client and a miner and ensures the client has the given amount of funds available in the channel.
func (*ClientNodeAdapter) WaitForPaymentChannelAddFunds ¶
func (c *ClientNodeAdapter) WaitForPaymentChannelAddFunds(messageCID cid.Cid) error
WaitForPaymentChannelAddFunds waits messageCID to appear on chain. If it doesn't appear within defaultMsgWaitTimeout it returns error
func (*ClientNodeAdapter) WaitForPaymentChannelCreation ¶
func (c *ClientNodeAdapter) WaitForPaymentChannelCreation(messageCID cid.Cid) (address.Address, error)
WaitForPaymentChannelCreation waits for a message on chain with CID messageCID that a payment channel has been created.