market

package
v1.3.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2022 License: Apache-2.0, MIT Imports: 25 Imported by: 37

Documentation

Index

Constants

View Source
const (
	Undefine = "Undefine"
	Assigned = "Assigned"
	Packing  = "Packing"
	Proving  = "Proving"
)
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
	// 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
}

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 *paych.SignedVoucher) (bool, error)

func (*ChannelInfo) InfoForVoucher

func (ci *ChannelInfo) InfoForVoucher(sv *paych.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 *paych.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) error

func (*ChannelInfo) WasVoucherSubmitted

func (ci *ChannelInfo) WasVoucherSubmitted(sv *paych.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
	market.ClientDealProposal

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

type DealInfoIncludePath

type DealInfoIncludePath struct {
	Offset          abi.PaddedPieceSize
	Length          abi.PaddedPieceSize
	PayloadSize     abi.UnpaddedPieceSize
	DealID          abi.DealID
	TotalStorageFee abi.TokenAmount
	market7.DealProposal
	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 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
}

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) error

type GetDealSpec

type GetDealSpec struct {
	MaxPiece     int
	MaxPieceSize uint64
}

type MarketBalance

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

type MinerAddress

type MinerAddress = address.Address

type MinerDeal

type MinerDeal struct {
	market.ClientDealProposal
	ProposalCid           cid.Cid
	AddFundsCid           *cid.Cid
	PublishCid            *cid.Cid
	Miner                 peer.ID
	Client                peer.ID
	State                 storagemarket.StorageDealStatus
	PiecePath             filestore.Path
	PayloadSize           abi.UnpaddedPieceSize
	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 string

	InboundCAR string
}

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) 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
}

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) error

type PendingDealInfo

type PendingDealInfo struct {
	Deals              []market.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 *market7.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 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
}

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) error

type RetrievalAsk

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

func (*RetrievalAsk) MarshalCBOR

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

func (*RetrievalAsk) UnmarshalCBOR

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

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 User

type User struct {
	Addr    address.Address
	Account string
}

type VoucherInfo

type VoucherInfo struct {
	Voucher   *paych.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) 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