client

package
v1.15.2 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0, MIT Imports: 13 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientOfflineDeal added in v1.12.0

type ClientOfflineDeal struct {
	types.ClientDealProposal

	ProposalCID    cid.Cid
	DataRef        *storagemarket.DataRef
	Message        string
	State          uint64
	DealID         uint64
	AddFundsCid    *cid.Cid
	PublishMessage *cid.Cid
	FastRetrieval  bool
	SlashEpoch     abi.ChainEpoch
	CreatedAt      time.Time
	UpdatedAt      time.Time
}

func (*ClientOfflineDeal) DealInfo added in v1.12.0

func (d *ClientOfflineDeal) DealInfo() *DealInfo

type CommPRet

type CommPRet struct {
	Root cid.Cid
	Size abi.UnpaddedPieceSize
}

type DagSpec

type DagSpec struct {
	// DataSelector matches data to be retrieved
	// - when using textselector, the path specifies subtree
	// - the matched graph must have a single root
	DataSelector *DataSelector

	// ExportMerkleProof is applicable only when exporting to a CAR file via a path textselector
	// When true, in addition to the selection target, the resulting CAR will contain every block along the
	// path back to, and including the original root
	// When false the resulting CAR contains only the blocks of the target subdag
	ExportMerkleProof bool
}

type DataCIDSize

type DataCIDSize struct {
	PayloadSize int64
	PieceSize   abi.PaddedPieceSize
	PieceCID    cid.Cid
}

type DataSelector

type DataSelector string

DataSelector specifies ipld selector string

type DataSize

type DataSize struct {
	PayloadSize int64
	PieceSize   abi.PaddedPieceSize
}

type DealDistribution added in v1.12.0

type DealDistribution struct {
	ProvidersDistribution []*ProviderDistribution
	ReplicasDistribution  []*ReplicaDistribution
}

type DealInfo

type DealInfo struct {
	ProposalCid cid.Cid
	State       storagemarket.StorageDealStatus
	Message     string // more information about deal state, particularly errors
	DealStages  *storagemarket.DealStages
	Provider    address.Address

	DataRef  *storagemarket.DataRef
	PieceCID cid.Cid
	Size     uint64

	PricePerEpoch types.BigInt
	Duration      uint64

	DealID abi.DealID

	CreationTime time.Time
	Verified     bool

	TransferChannelID *datatransfer.ChannelID
	DataTransfer      *market.DataTransferChannel
}

type DealParams added in v1.12.0

type DealParams struct {
	Data               *storagemarket.DataRef
	Wallet             address.Address
	Miner              address.Address
	EpochPrice         types.BigInt
	MinBlocksDuration  uint64
	ProviderCollateral types.BigInt
	DealStartEpoch     abi.ChainEpoch
	FastRetrieval      bool
	VerifiedDeal       bool
}

type DealResult added in v1.12.0

type DealResult struct {
	ProposalCID cid.Cid
	// Create deal failed
	Message string
}

type DealResults added in v1.12.0

type DealResults struct {
	Results []*DealResult
}

type ExportRef

type ExportRef struct {
	Root cid.Cid

	// DAGs array specifies a list of DAGs to export
	// - If exporting into unixfs files, only one DAG is supported, DataSelector is only used to find the targeted root node
	// - If exporting into a car file
	//   - When exactly one text-path DataSelector is specified exports the subgraph and its full merkle-path from the original root
	//   - Otherwise ( multiple paths and/or JSON selector specs) determines each individual subroot and exports the subtrees as a multi-root car
	// - When not specified defaults to a single DAG:
	//   - Data - the entire DAG: `{"R":{"l":{"none":{}},":>":{"a":{">":{"@":{}}}}}}`
	DAGs []DagSpec

	FromLocalCAR string // if specified, get data from a local CARv2 file.
	DealID       retrievalmarket.DealID
}

type FileRef

type FileRef struct {
	Path  string
	IsCAR bool
}

type Import

type Import struct {
	Key ImportID
	Err string

	Root *cid.Cid

	// Source is the provenance of the import, e.g. "import", "unknown", else.
	// Currently useless but may be used in the future.
	Source string

	// FilePath is the path of the original file. It is important that the file
	// is retained at this path, because it will be referenced during
	// the transfer (when we do the UnixFS chunking, we don't duplicate the
	// leaves, but rather point to chunks of the original data through
	// positional references).
	FilePath string

	// CARPath is the path of the CAR file containing the DAG for this import.
	CARPath string
}

type ImportID

type ImportID uint64

func (ImportID) DsKey

func (id ImportID) DsKey() datastore.Key

type ImportRes

type ImportRes struct {
	Root     cid.Cid
	ImportID ImportID
}

type ProviderDistribution added in v1.12.0

type ProviderDistribution struct {
	Provider address.Address
	// Total deal
	Total uint64
	// Uniq deal
	Uniq uint64
	// May be too large
	UniqPieces map[string]uint64
	// (Total-Uniq) / Total
	DuplicationPercentage float64
}

type QueryOffer

type QueryOffer struct {
	Err string

	Root  cid.Cid
	Piece *cid.Cid

	Size                    uint64
	MinPrice                types.BigInt
	UnsealPrice             types.BigInt
	PricePerByte            abi.TokenAmount
	PaymentInterval         uint64
	PaymentIntervalIncrease uint64
	Miner                   address.Address
	MinerPeer               retrievalmarket.RetrievalPeer
}

func (*QueryOffer) Order

func (o *QueryOffer) Order(client address.Address) RetrievalOrder

type RemoteStoreID added in v1.9.0

type RemoteStoreID = uuid.UUID

type ReplicaDistribution added in v1.12.0

type ReplicaDistribution struct {
	// Datacap address
	Client address.Address
	// Total deal
	Total uint64
	// Uniq deal
	Uniq uint64
	// (Total-Uniq) / Uniq
	DuplicationPercentage float64
	// ProviderTotalDeal / Total
	ReplicasPercentage   map[string]float64
	ReplicasDistribution []*ProviderDistribution
}

type RestrievalRes

type RestrievalRes struct {
	DealID retrievalmarket.DealID
}

type RetrievalInfo

type RetrievalInfo struct {
	PayloadCID   cid.Cid
	ID           retrievalmarket.DealID
	PieceCID     *cid.Cid
	PricePerByte abi.TokenAmount
	UnsealPrice  abi.TokenAmount

	Status        retrievalmarket.DealStatus
	Message       string // more information about deal state, particularly errors
	Provider      peer.ID
	BytesReceived uint64
	BytesPaidFor  uint64
	TotalPaid     abi.TokenAmount

	TransferChannelID *datatransfer.ChannelID
	DataTransfer      *market.DataTransferChannel

	// optional event if part of ClientGetRetrievalUpdates
	Event *retrievalmarket.ClientEvent
}

type RetrievalOrder

type RetrievalOrder struct {
	// TODO: make this less unixfs specific
	Root         cid.Cid
	Piece        *cid.Cid
	DataSelector *DataSelector

	Size  uint64
	Total types.BigInt

	UnsealPrice             types.BigInt
	PaymentInterval         uint64
	PaymentIntervalIncrease uint64
	Client                  address.Address
	Miner                   address.Address
	MinerPeer               *retrievalmarket.RetrievalPeer

	RemoteStore *RemoteStoreID `json:"RemoteStore,omitempty"`
}

Jump to

Keyboard shortcuts

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