api

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2023 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIVersion

type APIVersion struct {
	Version    string
	APIVersion Version
	BlockDelay uint64
}

type ChainEpoch

type ChainEpoch int64

type Claim

type Claim struct {
	// Sum of raw byte power for a miner's sectors.
	RawBytePower abi2.StoragePower

	// Sum of quality adjusted power for a miner's sectors.
	QualityAdjPower abi2.StoragePower
}

type Client

type Client interface {
	ClientDealPieceCID(context.Context, cid.Cid) (DataCIDSize, error)
	ClientExport(context.Context, ExportRef, FileRef) error
	ClientGetDealUpdates(ctx context.Context) (<-chan DealInfo, error)
	ClientListImports(context.Context) ([]Import, error)
	ClientImport(context.Context, FileRef) (*ImportRes, error)
	ClientQueryAsk(context.Context, peer.ID, address.Address) (*StorageAsk, error)
	ClientStartDeal(context.Context, *StartDealParams) (*cid.Cid, error)
	StateGetNetworkParams(context.Context) (*NetworkParams, error)
	StateListMiners(context.Context, TipSetKey) ([]address.Address, error)
	StateMinerInfo(context.Context, address.Address, TipSetKey) (MinerInfo, error)
	StateMinerPower(context.Context, address.Address, TipSetKey) (*MinerPower, error)
	Version(context.Context) (APIVersion, error)
	WalletDefaultAddress(context.Context) (address.Address, error)

	Close() error
}

func NewClient

func NewClient(ctx context.Context, host string, token string) (Client, error)

func NewClientFromConfigDir

func NewClientFromConfigDir(ctx context.Context, dir string) (Client, error)

type DagSpec

type DagSpec struct {
	DataSelector      *Selector
	ExportMerkleProof bool
}

type DataCIDSize

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

type DataRef

type DataRef struct {
	TransferType string
	Root         cid.Cid

	PieceCid     *cid.Cid               // Optional for non-manual transfer, will be recomputed from the data if not given
	PieceSize    abi2.UnpaddedPieceSize // Optional for non-manual transfer, will be recomputed from the data if not given
	RawBlockSize uint64                 // Optional: used as the denominator when calculating transfer %
}

type DealInfo

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

	DataRef  *storagemarket.DataRef
	PieceCID cid.Cid
	Size     uint64

	PricePerEpoch big2.Int
	Duration      uint64

	DealID abi2.DealID

	CreationTime time.Time
	Verified     bool
}

type ExportRef

type ExportRef struct {
	Root         cid.Cid
	DAGs         []DagSpec
	FromLocalCAR string
	DealID       retrievalmarket.DealID
}

type FIL

type FIL big2.Int

type FileRef

type FileRef struct {
	Path  string
	IsCAR bool
}

type ID

type ID uint64

type Import

type Import struct {
	Key      ID
	Err      string
	Root     *cid.Cid
	Source   string
	FilePath string
	CARPath  string
}

type ImportRes

type ImportRes struct {
	Root     cid.Cid
	ImportID ID
}

type MinerInfo

type MinerInfo struct {
	Owner                      address.Address   // Must be an ID-address.
	Worker                     address.Address   // Must be an ID-address.
	NewWorker                  address.Address   // Must be an ID-address.
	ControlAddresses           []address.Address // Must be an ID-addresses.
	WorkerChangeEpoch          int64
	PeerId                     *peer.ID
	Multiaddrs                 [][]byte
	WindowPoStProofType        int64
	SectorSize                 uint64
	WindowPoStPartitionSectors uint64
	ConsensusFaultElapsed      int64
	Beneficiary                address.Address
	BeneficiaryTerm            *miner.BeneficiaryTerm
	PendingBeneficiaryTerm     *miner.PendingBeneficiaryChange
}

type MinerPower

type MinerPower struct {
	MinerPower  Claim
	TotalPower  Claim
	HasMinPower bool
}

type NetworkParams

type NetworkParams struct {
	NetworkName    string
	BlockDelaySecs uint64
}

type Selector

type Selector string

type StartDealParams

type StartDealParams struct {
	Data               *DataRef
	Wallet             address.Address
	Miner              address.Address
	EpochPrice         big2.Int
	MinBlocksDuration  uint64
	ProviderCollateral big2.Int
	DealStartEpoch     ChainEpoch
	FastRetrieval      bool
	VerifiedDeal       bool
}

type StorageAsk

type StorageAsk struct {
	Response *storagemarket.StorageAsk

	DealProtocols []string
}

type TipSetKey

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

func (TipSetKey) CIDs

func (k TipSetKey) CIDs() []cid.Cid

func (TipSetKey) MarshalJSON

func (k TipSetKey) MarshalJSON() ([]byte, error)

type Version

type Version uint32

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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