market

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2022 License: Apache-2.0, MIT Imports: 23 Imported by: 37

Documentation

Index

Constants

View Source
const (
	DirInbound  = 1
	DirOutbound = 2
)

Variables

View Source
var ErrChannelNotFound = fmt.Errorf("channel not found")

Functions

This section is empty.

Types

type AddrUse

type AddrUse int
const (
	PreCommitAddr AddrUse = iota
	CommitAddr
	DealPublishAddr
	PoStAddr

	TerminateSectorsAddr
)

type ChannelInfo

type ChannelInfo struct {
	// ChannelID is a uuid set at channel creation
	ChannelID string
	// Channel address - may be nil if the channel hasn't been created yet
	Channel *address.Address
	// Control is the address of the local node
	Control address.Address
	// Target is the address of the remote node (on the other end of the channel)
	Target address.Address
	// Direction indicates if the channel is inbound (Control is the "to" address)
	// or outbound (Control is the "from" address)
	Direction uint64
	// Vouchers is a list of all vouchers sent on the channel
	Vouchers []*VoucherInfo
	// NextLane is the number of the next lane that should be used when the
	// client requests a new lane (eg to create a voucher for a new deal)
	NextLane uint64
	// Amount added to the channel.
	// Note: This amount is only used by GetPaych to keep track of how much
	// has locally been added to the channel. It should reflect the channel's
	// Balance on chain as long as all operations occur on the same datastore.
	Amount big.Int
	// AvailableAmount indicates how much afil is non-reserved
	AvailableAmount big.Int
	// PendingAvailableAmount is available amount that we're awaiting confirmation of
	PendingAvailableAmount big.Int
	// PendingAmount is the amount that we're awaiting confirmation of
	PendingAmount big.Int
	// CreateMsg is the CID of a pending create message (while waiting for confirmation)
	CreateMsg *cid.Cid
	// AddFundsMsg is the CID of a pending add funds message (while waiting for confirmation)
	AddFundsMsg *cid.Cid
	// Settling indicates whether the channel has entered into the settling state
	Settling bool

	TimeStamp
}

ChannelInfo keeps track of information about a channel

func (*ChannelInfo) From

func (ci *ChannelInfo) From() address.Address

func (*ChannelInfo) HasVoucher

func (ci *ChannelInfo) HasVoucher(sv *types.SignedVoucher) (bool, error)

func (*ChannelInfo) InfoForVoucher

func (ci *ChannelInfo) InfoForVoucher(sv *types.SignedVoucher) (*VoucherInfo, error)

infoForVoucher gets the VoucherInfo for the given voucher. returns nil if the channel doesn't have the voucher.

func (*ChannelInfo) MarkVoucherSubmitted

func (ci *ChannelInfo) MarkVoucherSubmitted(sv *types.SignedVoucher) error

markVoucherSubmitted marks the voucher, and any vouchers of lower nonce in the same lane, as being submitted. Note: This method doesn't write anything to the store.

func (*ChannelInfo) MarshalCBOR

func (t *ChannelInfo) MarshalCBOR(w io.Writer) error

func (*ChannelInfo) To

func (ci *ChannelInfo) To() address.Address

func (*ChannelInfo) UnmarshalCBOR

func (t *ChannelInfo) UnmarshalCBOR(r io.Reader) (err error)

func (*ChannelInfo) WasVoucherSubmitted

func (ci *ChannelInfo) WasVoucherSubmitted(sv *types.SignedVoucher) (bool, error)

wasVoucherSubmitted returns true if the voucher has been submitted

type DagstoreInitializeAllEvent

type DagstoreInitializeAllEvent struct {
	Key     string
	Event   string // "start", "end"
	Success bool
	Error   string
	Total   int
	Current int
}

DagstoreInitializeAllEvent represents an initialization event.

type DagstoreInitializeAllParams

type DagstoreInitializeAllParams struct {
	MaxConcurrency int
	IncludeSealed  bool
}

type DagstoreShardInfo

type DagstoreShardInfo struct {
	Key   string
	State string
	Error string
}

DagstoreShardInfo is the serialized form of dagstore.DagstoreShardInfo that we expose through JSON-RPC to avoid clients having to depend on the dagstore lib.

type DagstoreShardResult

type DagstoreShardResult struct {
	Key     string
	Success bool
	Error   string
}

DagstoreShardResult enumerates results per shard.

type DataTransferChannel

type DataTransferChannel struct {
	TransferID  datatransfer.TransferID
	Status      datatransfer.Status
	BaseCID     cid.Cid
	IsInitiator bool
	IsSender    bool
	Voucher     string
	Message     string
	OtherPeer   peer.ID
	Transferred uint64
	Stages      *datatransfer.ChannelStages
}

func NewDataTransferChannel

func NewDataTransferChannel(hostID peer.ID, channelState datatransfer.ChannelState) DataTransferChannel

NewDataTransferChannel constructs an API DataTransferChannel type from full channel state snapshot and a host id

type DealInfo

type DealInfo struct {
	piecestore.DealInfo
	types.ClientDealProposal

	TransferType  string
	Root          cid.Cid
	PublishCid    cid.Cid
	FastRetrieval bool
	Status        PieceStatus
}

type DealInfoIncludePath

type DealInfoIncludePath struct {
	types.DealProposal
	Offset          abi.PaddedPieceSize
	Length          abi.PaddedPieceSize
	PayloadSize     uint64
	DealID          abi.DealID
	TotalStorageFee abi.TokenAmount
	FastRetrieval   bool
	PublishCid      cid.Cid
}

type DealSchedule

type DealSchedule struct {
	StartEpoch abi.ChainEpoch
	EndEpoch   abi.ChainEpoch
}

DealSchedule communicates the time interval of a piecestorage deal. The deal must appear in a sealed (proven) sector no later than StartEpoch, otherwise it is invalid.

type FsStorage added in v1.6.1

type FsStorage struct {
	Path     string
	Name     string
	ReadOnly bool
	Status   StorageStatus
}

type FundedAddressState

type FundedAddressState struct {
	Addr address.Address
	// AmtReserved is the amount that must be kept in the address (cannot be
	// withdrawn)
	AmtReserved abi.TokenAmount
	// MsgCid is the cid of an in-progress on-chain message
	MsgCid *cid.Cid
	TimeStamp
}

FundedAddressState keeps track of the state of an address with funds in the datastore

func (*FundedAddressState) MarshalCBOR

func (t *FundedAddressState) MarshalCBOR(w io.Writer) error

func (*FundedAddressState) UnmarshalCBOR

func (t *FundedAddressState) UnmarshalCBOR(r io.Reader) (err error)

type GetDealSpec

type GetDealSpec struct {
	// max limit of deal count
	MaxPiece int

	// max limit of date size in one single deal
	MaxPieceSize uint64

	// min limit of deal count
	MinPiece int

	// min limit of data size in one single deal
	MinPieceSize uint64

	// min limit of total space used by deals
	MinUsedSpace uint64

	// start epoch limit of the chosen deals
	// if set, the deals should not be activated before or equal than the this epoch
	StartEpoch abi.ChainEpoch

	// end epoch limit of the chosen deals
	// if set, the deals should not be alive after or equal than the this epoch
	EndEpoch abi.ChainEpoch
}

type MarketBalance

type MarketBalance struct {
	Escrow big.Int
	Locked big.Int
}

type MinerAddress

type MinerAddress = address.Address

type MinerDeal

type MinerDeal struct {
	types.ClientDealProposal
	ProposalCid           cid.Cid
	AddFundsCid           *cid.Cid
	PublishCid            *cid.Cid
	Miner                 peer.ID
	Client                peer.ID
	State                 storagemarket.StorageDealStatus
	PiecePath             filestore.Path
	PayloadSize           uint64
	MetadataPath          filestore.Path
	SlashEpoch            abi.ChainEpoch
	FastRetrieval         bool
	Message               string
	FundsReserved         abi.TokenAmount
	Ref                   *storagemarket.DataRef
	AvailableForRetrieval bool

	DealID       abi.DealID
	CreationTime cbg.CborTime

	TransferChannelID *datatransfer.ChannelID `json:"TransferChannelId"`
	SectorNumber      abi.SectorNumber

	Offset      abi.PaddedPieceSize
	PieceStatus PieceStatus

	InboundCAR string

	TimeStamp
}

func (*MinerDeal) FilMarketMinerDeal

func (deal *MinerDeal) FilMarketMinerDeal() *storagemarket.MinerDeal

func (*MinerDeal) MarshalCBOR

func (t *MinerDeal) MarshalCBOR(w io.Writer) error

func (*MinerDeal) UnmarshalCBOR

func (t *MinerDeal) UnmarshalCBOR(r io.Reader) (err error)

type MinerID

type MinerID = abi.ActorID

type MsgInfo

type MsgInfo struct {
	// ChannelID links the message to a channel
	ChannelID string
	// MsgCid is the CID of the message
	MsgCid cid.Cid
	// Received indicates whether a response has been received
	Received bool
	// Err is the error received in the response
	Err string
	TimeStamp
}

MsgInfo stores information about a create channel / add funds message that has been sent

func (*MsgInfo) MarshalCBOR

func (t *MsgInfo) MarshalCBOR(w io.Writer) error

func (*MsgInfo) UnmarshalCBOR

func (t *MsgInfo) UnmarshalCBOR(r io.Reader) (err error)

type PendingDealInfo

type PendingDealInfo struct {
	Deals              []types.ClientDealProposal
	PublishPeriodStart time.Time
	PublishPeriod      time.Duration
}

PendingDealInfo has info about pending deals and when they are due to be published

type PieceDealInfo

type PieceDealInfo struct {
	PublishCid   *cid.Cid
	DealID       abi.DealID
	DealProposal *types.DealProposal
	DealSchedule DealSchedule
	KeepUnsealed bool
}

DealInfo is a tuple of deal identity and its schedule

type PieceInfo

type PieceInfo struct {
	PieceCID cid.Cid
	Deals    []*DealInfo
}

type PieceStatus added in v1.2.4

type PieceStatus string
const (
	Undefine PieceStatus = "Undefine"
	Assigned PieceStatus = "Assigned"
	Packing  PieceStatus = "Packing"
	Proving  PieceStatus = "Proving"
)

type PieceStorageInfos added in v1.6.1

type PieceStorageInfos struct {
	FsStorage []FsStorage
	S3Storage []S3Storage
}

type ProviderDealState

type ProviderDealState struct {
	retrievalmarket.DealProposal
	StoreID               uint64
	SelStorageProposalCid cid.Cid
	ChannelID             *datatransfer.ChannelID
	Status                retrievalmarket.DealStatus
	Receiver              peer.ID
	TotalSent             uint64
	FundsReceived         abi.TokenAmount
	Message               string
	CurrentInterval       uint64
	LegacyProtocol        bool
	TimeStamp
}

ProviderDealState is the current state of a deal from the point of view of a retrieval provider

func (ProviderDealState) Identifier

Identifier provides a unique id for this provider deal

func (*ProviderDealState) IntervalLowerBound

func (deal *ProviderDealState) IntervalLowerBound() uint64

func (*ProviderDealState) MarshalCBOR

func (t *ProviderDealState) MarshalCBOR(w io.Writer) error

func (*ProviderDealState) NextInterval

func (deal *ProviderDealState) NextInterval() uint64

func (*ProviderDealState) TotalPaidFor

func (deal *ProviderDealState) TotalPaidFor() uint64

func (*ProviderDealState) UnmarshalCBOR

func (t *ProviderDealState) UnmarshalCBOR(r io.Reader) (err error)

type RetrievalAsk

type RetrievalAsk struct {
	Miner                   address.Address
	PricePerByte            abi.TokenAmount
	UnsealPrice             abi.TokenAmount
	PaymentInterval         uint64
	PaymentIntervalIncrease uint64
	TimeStamp
}

func (*RetrievalAsk) MarshalCBOR

func (t *RetrievalAsk) MarshalCBOR(w io.Writer) error

func (*RetrievalAsk) UnmarshalCBOR

func (t *RetrievalAsk) UnmarshalCBOR(r io.Reader) (err error)

type RetrievalDealStatistic added in v1.7.0

type RetrievalDealStatistic struct {
	DealsStatus map[retrievalmarket.DealStatus]int64
}

RetrievalDealStatistic storage statistical information The struct is used here for statistical information that may need to be added in the future

type S3Storage added in v1.6.1

type S3Storage struct {
	Name     string
	ReadOnly bool
	EndPoint string
	Bucket   string
	SubDir   string
	Status   StorageStatus
}

type SealSeed

type SealSeed struct {
	Value abi.InteractiveSealRandomness
	Epoch abi.ChainEpoch
}

type SealTicket

type SealTicket struct {
	Value abi.SealRandomness
	Epoch abi.ChainEpoch
}

type SealedRef

type SealedRef struct {
	SectorID abi.SectorNumber
	Offset   abi.PaddedPieceSize
	Size     abi.UnpaddedPieceSize
}

type SealedRefs

type SealedRefs struct {
	Refs []SealedRef
}

type SectorInfo

type SectorInfo struct {
	SectorID     abi.SectorNumber
	State        SectorState
	CommD        *cid.Cid
	CommR        *cid.Cid
	Proof        []byte
	Deals        []abi.DealID
	Ticket       SealTicket
	Seed         SealSeed
	PreCommitMsg *cid.Cid
	CommitMsg    *cid.Cid
	Retries      uint64
	ToUpgrade    bool

	LastErr string

	Log []SectorLog

	// On Chain Info
	SealProof          abi.RegisteredSealProof // The seal proof type implies the PoSt proof/s
	Activation         abi.ChainEpoch          // Epoch during which the sector proof was accepted
	Expiration         abi.ChainEpoch          // Epoch during which the sector expires
	DealWeight         abi.DealWeight          // Integral of active deals over sector lifetime
	VerifiedDealWeight abi.DealWeight          // Integral of active verified deals over sector lifetime
	InitialPledge      abi.TokenAmount         // Pledge collected to commit this sector
	// Expiration Info
	OnTime abi.ChainEpoch
	// non-zero if sector is faulty, epoch at which it will be permanently
	// removed if it doesn't recover
	Early abi.ChainEpoch
}

type SectorLog

type SectorLog struct {
	Kind      string
	Timestamp uint64

	Trace string

	Message string
}

type SectorOffset

type SectorOffset struct {
	Sector abi.SectorNumber
	Offset abi.PaddedPieceSize
}

type SectorSize

type SectorSize = abi.SectorSize

type SectorState

type SectorState string

type SignInfo

type SignInfo struct {
	Data interface{}
	Type types.MsgType
	Addr address.Address
}

type SignedStorageAsk added in v1.8.0

type SignedStorageAsk struct {
	Ask       *storagemarket.StorageAsk
	Signature *crypto.Signature
	TimeStamp
}

func FromChainAsk added in v1.8.0

func (*SignedStorageAsk) MarshalCBOR added in v1.8.0

func (t *SignedStorageAsk) MarshalCBOR(w io.Writer) error

func (*SignedStorageAsk) ToChainAsk added in v1.8.0

func (*SignedStorageAsk) UnmarshalCBOR added in v1.8.0

func (t *SignedStorageAsk) UnmarshalCBOR(r io.Reader) (err error)

type StorageDealStatistic added in v1.7.0

type StorageDealStatistic struct {
	DealsStatus map[storagemarket.StorageDealStatus]int64
}

StorageDealStatistic storage statistical information The struct is used here for statistical information that may need to be added in the future

type StorageStatus added in v1.7.0

type StorageStatus struct {
	Capacity  int64
	Available int64
	Reserved  int64
}

type TimeStamp added in v1.7.0

type TimeStamp struct {
	CreatedAt uint64
	UpdatedAt uint64
}

func (*TimeStamp) MarshalCBOR added in v1.7.0

func (t *TimeStamp) MarshalCBOR(w io.Writer) error

func (*TimeStamp) UnmarshalCBOR added in v1.7.0

func (t *TimeStamp) UnmarshalCBOR(r io.Reader) (err error)

type User

type User struct {
	Addr    address.Address
	Account string
}

type VoucherInfo

type VoucherInfo struct {
	Voucher   *types.SignedVoucher
	Proof     []byte // ignored
	Submitted bool
}

func (*VoucherInfo) MarshalCBOR

func (t *VoucherInfo) MarshalCBOR(w io.Writer) error

func (*VoucherInfo) UnmarshalCBOR

func (t *VoucherInfo) UnmarshalCBOR(r io.Reader) (err error)

type VoucherInfos

type VoucherInfos []*VoucherInfo

func (*VoucherInfos) Scan

func (info *VoucherInfos) Scan(value interface{}) error

func (VoucherInfos) Value

func (info VoucherInfos) Value() (driver.Value, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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