retrievaladapter

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: 24 Imported by: 0

Documentation

Index

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

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

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.

Jump to

Keyboard shortcuts

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