client

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2023 License: Apache-2.0, MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const RetrievalQueryProtocol = "/fil/retrieval/qry/1.0.0"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ChannelMonitorConfig dtchannelmonitor.Config
	Datastore            datastore.Batching
	GraphsyncOpts        []graphsync.Option
	Host                 host.Host
	PayChannelManager    PayChannelManager
	RetrievalConfigurer  datatransfer.TransportConfigurer
}

type PayChannelManager

type PayChannelManager interface {
	// lotus > paychmgr > store.go |
	// Allocates a new lane for a given channel
	AllocateLane(ctx context.Context, address address.Address) (uint64, error)

	// lotus > paychmgr > paych.go |
	// createVoucher creates a voucher with the given specification, setting its
	// nonce, signing the voucher and storing it in the local datastore.
	// If there are not enough funds in the channel to create the voucher, returns
	// the shortfall in funds.
	CreateVoucher(ctx context.Context, ch address.Address, voucher paych.SignedVoucher) (*paych.SignedVoucher, big.Int, error)

	// Creates a payment channel with the minimum number of funds required for the retrieval
	GetPayChannelWithMinFunds(ctx context.Context, dest address.Address) (address.Address, error)

	// lotus > paychmgr > manager.go |
	// Restarts tracking of any messages that were sent to chain.
	//
	// lotus > paychmgr > simple.go |
	// restartPending checks the datastore to see if there are any channels that
	// have outstanding create / add funds messages, and if so, waits on the
	// messages.
	// Outstanding messages can occur if a create / add funds message was sent and
	// then the system was shut down or crashed before the result was received.
	Start() error
}

type RetrievalClient

type RetrievalClient struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(datastore datastore.Batching, host host.Host, payChanMgr PayChannelManager, opts ...func(*Config)) (*RetrievalClient, error)

Creates a new RetrievalClient

func NewClientWithConfig

func NewClientWithConfig(cfg *Config) (*RetrievalClient, error)

Creates a new RetrievalClient with the given Config

func (*RetrievalClient) AwaitReady

func (rc *RetrievalClient) AwaitReady() error

func (*RetrievalClient) RetrievalQueryToPeer

func (rc *RetrievalClient) RetrievalQueryToPeer(
	ctx context.Context,
	peerAddr peer.AddrInfo,
	payloadCid cid.Cid,
	onConnected func(),
) (*retrievalmarket.QueryResponse, error)

func (*RetrievalClient) RetrieveFromPeer added in v0.3.0

func (rc *RetrievalClient) RetrieveFromPeer(
	ctx context.Context,
	linkSystem ipld.LinkSystem,
	peerID peer.ID,
	minerWallet address.Address,
	proposal *retrievalmarket.DealProposal,
	eventsCallback datatransfer.Subscriber,
	gracefulShutdownRequested <-chan struct{},
) (*types.RetrievalStats, error)

Jump to

Keyboard shortcuts

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