Documentation
¶
Index ¶
- Constants
- Variables
- func ChannelIDFromString(id string) (*datatransfer.ChannelID, error)
- func ComputePrice(askPrice types.BigInt, size abi.PaddedPieceSize, duration abi.ChainEpoch) (*abi.TokenAmount, error)
- func GeneratePieceCommitment(ctx context.Context, payloadCid cid.Cid, bstore blockstore.Blockstore) (cid.Cid, uint64, abi.UnpaddedPieceSize, error)
- func GeneratePieceCommitmentFFI(ctx context.Context, payloadCid cid.Cid, bstore blockstore.Blockstore) (cid.Cid, uint64, abi.UnpaddedPieceSize, error)
- func NewErrLotusError(err error) error
- func NewErrMinerConnectionFailed(err error) error
- func NewErrUnknown(err error) error
- func ZeroPadPieceCommitment(c cid.Cid, curSize abi.UnpaddedPieceSize, toSize abi.UnpaddedPieceSize) (cid.Cid, error)
- type Balance
- type ChannelState
- type Config
- type Error
- type ErrorCode
- type FilClient
- func (fc *FilClient) Balance(ctx context.Context) (*Balance, error)
- func (fc *FilClient) CheckChainDeal(ctx context.Context, dealid abi.DealID) (bool, *api.MarketDeal, error)
- func (fc *FilClient) CheckOngoingTransfer(ctx context.Context, miner address.Address, st *ChannelState) (outerr error)
- func (fc *FilClient) ConnectToMiner(ctx context.Context, maddr address.Address) (peer.ID, error)
- func (fc *FilClient) DealProtocolForMiner(ctx context.Context, miner address.Address) (protocol.ID, error)
- func (fc *FilClient) DealStatus(ctx context.Context, miner address.Address, propCid cid.Cid, ...) (*storagemarket.ProviderDealState, error)
- func (fc *FilClient) GetAsk(ctx context.Context, maddr address.Address) (*network.AskResponse, error)
- func (fc *FilClient) GetDtMgr() datatransfer.Manager
- func (fc *FilClient) GetMinerVersion(ctx context.Context, maddr address.Address) (string, error)
- func (fc *FilClient) GraphSyncStats() graphsync.Stats
- func (fc *FilClient) LockMarketFunds(ctx context.Context, amt types.FIL) (*LockFundsResp, error)
- func (fc *FilClient) MakeDeal(ctx context.Context, miner address.Address, data cid.Cid, price types.BigInt, ...) (*network.Proposal, error)
- func (fc *FilClient) MinerPeer(ctx context.Context, miner address.Address) (peer.AddrInfo, error)
- func (fc *FilClient) MinerTransferDiagnostics(ctx context.Context, miner address.Address) (*MinerTransferDiagnostics, error)
- func (fc *FilClient) OnRetrievalEvent(event rep.RetrievalEvent)
- func (fc *FilClient) RestartTransfer(ctx context.Context, chanid *datatransfer.ChannelID) error
- func (fc *FilClient) RetrievalQuery(ctx context.Context, maddr address.Address, pcid cid.Cid) (*retrievalmarket.QueryResponse, error)
- func (fc *FilClient) RetrievalQueryToPeer(ctx context.Context, minerPeer peer.AddrInfo, pcid cid.Cid) (*retrievalmarket.QueryResponse, error)
- func (fc *FilClient) RetrieveContent(ctx context.Context, miner address.Address, ...) (*RetrievalStats, error)
- func (fc *FilClient) RetrieveContentFromPeerAsync(ctx context.Context, peerID peer.ID, minerWallet address.Address, ...) (result <-chan RetrievalResult, onProgress <-chan uint64, ...)
- func (fc *FilClient) RetrieveContentFromPeerWithProgressCallback(ctx context.Context, peerID peer.ID, minerWallet address.Address, ...) (*RetrievalStats, error)
- func (fc *FilClient) RetrieveContentWithProgressCallback(ctx context.Context, miner address.Address, ...) (*RetrievalStats, error)
- func (fc *FilClient) SendProposalV110(ctx context.Context, netprop network.Proposal, propCid cid.Cid) (bool, error)
- func (fc *FilClient) SendProposalV120(ctx context.Context, dbid uint, netprop network.Proposal, dealUUID uuid.UUID, ...) (bool, error)
- func (fc *FilClient) SetPieceCommFunc(pcf GetPieceCommFunc)
- func (fc *FilClient) StartDataTransfer(ctx context.Context, miner address.Address, propCid cid.Cid, dataCid cid.Cid) (*datatransfer.ChannelID, error)
- func (fc *FilClient) SubscribeToDataTransferEvents(f datatransfer.Subscriber) func()
- func (fc *FilClient) SubscribeToRetrievalEvents(subscriber rep.RetrievalSubscriber)
- func (fc *FilClient) TransferStatus(ctx context.Context, chanid *datatransfer.ChannelID) (*ChannelState, error)
- func (fc *FilClient) TransferStatusByID(ctx context.Context, id string) (*ChannelState, error)
- func (fc *FilClient) TransferStatusForContent(ctx context.Context, content cid.Cid, miner address.Address) (*ChannelState, error)
- func (fc *FilClient) TransfersInProgress(ctx context.Context) (map[string]*ChannelState, error)
- func (fc *FilClient) V110TransfersInProgress(ctx context.Context) (map[datatransfer.ChannelID]datatransfer.ChannelState, error)
- type GetPieceCommFunc
- type GraphSyncDataTransfer
- type LockFundsResp
- type Lp2pDTConfig
- type MinerTransferDiagnostics
- type MsgPusher
- type RetrievalResult
- type RetrievalStats
- type TransferType
Constants ¶
View Source
const DealProtocolv110 = "/fil/storage/mk/1.1.0"
View Source
const DealProtocolv120 = "/fil/storage/mk/1.2.0"
View Source
const DealStatusProtocolv110 = "/fil/storage/status/1.1.0"
View Source
const DealStatusProtocolv120 = "/fil/storage/status/1.2.0"
View Source
const QueryAskProtocol = "/fil/storage/ask/1.1.0"
View Source
const RetrievalQueryProtocol = "/fil/retrieval/qry/1.0.0"
Variables ¶
View Source
var ErrNoTransferFound = fmt.Errorf("no transfer found")
View Source
var Tracer = otel.Tracer("filclient")
Functions ¶
func ChannelIDFromString ¶
func ChannelIDFromString(id string) (*datatransfer.ChannelID, error)
func ComputePrice ¶
func ComputePrice(askPrice types.BigInt, size abi.PaddedPieceSize, duration abi.ChainEpoch) (*abi.TokenAmount, error)
func GeneratePieceCommitment ¶
func GeneratePieceCommitment(ctx context.Context, payloadCid cid.Cid, bstore blockstore.Blockstore) (cid.Cid, uint64, abi.UnpaddedPieceSize, error)
func GeneratePieceCommitmentFFI ¶
func GeneratePieceCommitmentFFI(ctx context.Context, payloadCid cid.Cid, bstore blockstore.Blockstore) (cid.Cid, uint64, abi.UnpaddedPieceSize, error)
func NewErrLotusError ¶
func NewErrUnknown ¶
func ZeroPadPieceCommitment ¶
func ZeroPadPieceCommitment(c cid.Cid, curSize abi.UnpaddedPieceSize, toSize abi.UnpaddedPieceSize) (cid.Cid, error)
Types ¶
type Balance ¶
type Balance struct {
Account address.Address `json:"account"`
Balance types.FIL `json:"balance"`
MarketEscrow types.FIL `json:"marketEscrow"`
MarketLocked types.FIL `json:"marketLocked"`
MarketAvailable types.FIL `json:"marketAvailable"`
VerifiedClientBalance *abi.StoragePower `json:"verifiedClientBalance"`
}
type ChannelState ¶
type ChannelState struct {
// SelfPeer returns the peer this channel belongs to
SelfPeer peer.ID `json:"selfPeer"`
RemotePeer peer.ID `json:"remotePeer"`
// Status is the current status of this channel
Status datatransfer.Status `json:"status"`
StatusStr string `json:"statusMessage"`
// Sent returns the number of bytes sent
Sent uint64 `json:"sent"`
// Received returns the number of bytes received
Received uint64 `json:"received"`
// Message offers additional information about the current status
Message string `json:"message"`
BaseCid string `json:"baseCid"`
ChannelID datatransfer.ChannelID `json:"channelId"`
TransferID string `json:"transferId"`
Stages *datatransfer.ChannelStages
TransferType TransferType
}
func ChannelStateConv ¶
func ChannelStateConv(st datatransfer.ChannelState) *ChannelState
type Config ¶
type Config struct {
DataDir string
GraphsyncOpts []gsimpl.Option
Api api.Gateway
Wallet *wallet.LocalWallet
Addr address.Address
Blockstore blockstore.Blockstore
Datastore datastore.Batching
Host host.Host
ChannelMonitorConfig channelmonitor.Config
RetrievalConfigurer datatransfer.TransportConfigurer
LogRetrievalProgressEvents bool
Lp2pDTConfig Lp2pDTConfig
}
type FilClient ¶
type FilClient struct {
ClientAddr address.Address
Libp2pTransferMgr *libp2pTransferManager
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(h host.Host, api api.Gateway, w *wallet.LocalWallet, addr address.Address, bs blockstore.Blockstore, ds datastore.Batching, ddir string, opts ...func(*Config)) (*FilClient, error)
func NewClientWithConfig ¶
func (*FilClient) CheckChainDeal ¶
func (*FilClient) CheckOngoingTransfer ¶
func (fc *FilClient) CheckOngoingTransfer(ctx context.Context, miner address.Address, st *ChannelState) (outerr error)
func (*FilClient) ConnectToMiner ¶
Errors - ErrMinerConnectionFailed, ErrLotusError
func (*FilClient) DealProtocolForMiner ¶
func (*FilClient) DealStatus ¶
func (fc *FilClient) DealStatus(ctx context.Context, miner address.Address, propCid cid.Cid, dealUUID *uuid.UUID) (*storagemarket.ProviderDealState, error)
func (*FilClient) GetDtMgr ¶ added in v0.3.0
func (fc *FilClient) GetDtMgr() datatransfer.Manager
func (*FilClient) GetMinerVersion ¶
func (*FilClient) GraphSyncStats ¶
func (fc *FilClient) GraphSyncStats() graphsync.Stats
func (*FilClient) LockMarketFunds ¶
func (*FilClient) MinerTransferDiagnostics ¶
func (fc *FilClient) MinerTransferDiagnostics(ctx context.Context, miner address.Address) (*MinerTransferDiagnostics, error)
MinerTransferDiagnostics provides in depth current information on the state of transfers for a given miner, covering running graphsync requests and related data transfers, etc
func (*FilClient) OnRetrievalEvent ¶
func (fc *FilClient) OnRetrievalEvent(event rep.RetrievalEvent)
Implement RetrievalSubscriber
func (*FilClient) RestartTransfer ¶
func (*FilClient) RetrievalQuery ¶
func (fc *FilClient) RetrievalQuery(ctx context.Context, maddr address.Address, pcid cid.Cid) (*retrievalmarket.QueryResponse, error)
func (*FilClient) RetrievalQueryToPeer ¶
func (fc *FilClient) RetrievalQueryToPeer(ctx context.Context, minerPeer peer.AddrInfo, pcid cid.Cid) (*retrievalmarket.QueryResponse, error)
func (*FilClient) RetrieveContent ¶
func (fc *FilClient) RetrieveContent( ctx context.Context, miner address.Address, proposal *retrievalmarket.DealProposal, ) (*RetrievalStats, error)
func (*FilClient) RetrieveContentFromPeerAsync ¶ added in v0.4.0
func (fc *FilClient) RetrieveContentFromPeerAsync( ctx context.Context, peerID peer.ID, minerWallet address.Address, proposal *retrievalmarket.DealProposal, ) (result <-chan RetrievalResult, onProgress <-chan uint64, gracefulShutdown func())
func (*FilClient) RetrieveContentFromPeerWithProgressCallback ¶
func (fc *FilClient) RetrieveContentFromPeerWithProgressCallback( ctx context.Context, peerID peer.ID, minerWallet address.Address, proposal *retrievalmarket.DealProposal, progressCallback func(bytesReceived uint64), ) (*RetrievalStats, error)
func (*FilClient) RetrieveContentWithProgressCallback ¶
func (fc *FilClient) RetrieveContentWithProgressCallback( ctx context.Context, miner address.Address, proposal *retrievalmarket.DealProposal, progressCallback func(bytesReceived uint64), ) (*RetrievalStats, error)
func (*FilClient) SendProposalV110 ¶
func (*FilClient) SendProposalV120 ¶
func (*FilClient) SetPieceCommFunc ¶
func (fc *FilClient) SetPieceCommFunc(pcf GetPieceCommFunc)
func (*FilClient) StartDataTransfer ¶
func (*FilClient) SubscribeToDataTransferEvents ¶
func (fc *FilClient) SubscribeToDataTransferEvents(f datatransfer.Subscriber) func()
func (*FilClient) SubscribeToRetrievalEvents ¶
func (fc *FilClient) SubscribeToRetrievalEvents(subscriber rep.RetrievalSubscriber)
func (*FilClient) TransferStatus ¶
func (fc *FilClient) TransferStatus(ctx context.Context, chanid *datatransfer.ChannelID) (*ChannelState, error)
func (*FilClient) TransferStatusByID ¶
func (*FilClient) TransferStatusForContent ¶
func (fc *FilClient) TransferStatusForContent(ctx context.Context, content cid.Cid, miner address.Address) (*ChannelState, error)
func (*FilClient) TransfersInProgress ¶
func (*FilClient) V110TransfersInProgress ¶
func (fc *FilClient) V110TransfersInProgress(ctx context.Context) (map[datatransfer.ChannelID]datatransfer.ChannelState, error)
type GetPieceCommFunc ¶
type GetPieceCommFunc func(ctx context.Context, payloadCid cid.Cid, bstore blockstore.Blockstore) (cid.Cid, uint64, abi.UnpaddedPieceSize, error)
type GraphSyncDataTransfer ¶
type GraphSyncDataTransfer struct {
// GraphSync request id for this transfer
RequestID graphsync.RequestID `json:"requestID"`
// Graphsync state for this transfer
RequestState string `json:"requestState"`
// If a channel ID is present, indicates whether this is the current graphsync request for this channel
// (could have changed in a restart)
IsCurrentChannelRequest bool `json:"isCurrentChannelRequest"`
// Data transfer channel ID for this transfer
ChannelID *datatransfer.ChannelID `json:"channelID"`
// Data transfer state for this transfer
ChannelState *ChannelState `json:"channelState"`
// Diagnostic information about this request -- and unexpected inconsistencies in
// request state
Diagnostics []string `json:"diagnostics"`
}
type LockFundsResp ¶
type LockFundsResp struct {
MsgCid cid.Cid
}
type Lp2pDTConfig ¶
type Lp2pDTConfig struct {
Server httptransport.ServerConfig
TransferTimeout time.Duration
}
type MinerTransferDiagnostics ¶
type MinerTransferDiagnostics struct {
ReceivingTransfers []*GraphSyncDataTransfer `json:"sendingTransfers"`
SendingTransfers []*GraphSyncDataTransfer `json:"receivingTransfers"`
}
type MsgPusher ¶
type MsgPusher struct {
// contains filtered or unexported fields
}
a simple nonce tracking message pusher that assumes it is the only thing with access to the given key
func NewMsgPusher ¶
func NewMsgPusher(gapi api.Gateway, w *wallet.LocalWallet) *MsgPusher
func (*MsgPusher) MpoolPushMessage ¶
func (mp *MsgPusher) MpoolPushMessage(ctx context.Context, msg *types.Message, maxFee *api.MessageSendSpec) (*types.SignedMessage, error)
type RetrievalResult ¶ added in v0.4.0
type RetrievalResult struct {
*RetrievalStats
Err error
}
type RetrievalStats ¶
type TransferType ¶
type TransferType string
const ( BoostTransfer TransferType = "boost" GraphsyncTransfer TransferType = "graphsync" )
Source Files
¶
Click to show internal directories.
Click to hide internal directories.