Documentation ¶
Index ¶
- Constants
- Variables
- type ChannelInfo
- func (ci *ChannelInfo) From() address.Address
- func (ci *ChannelInfo) HasVoucher(sv *types.SignedVoucher) (bool, error)
- func (ci *ChannelInfo) InfoForVoucher(sv *types.SignedVoucher) (*VoucherInfo, error)
- func (ci *ChannelInfo) MarkVoucherSubmitted(sv *types.SignedVoucher) error
- func (t *ChannelInfo) MarshalCBOR(w io.Writer) error
- func (ci *ChannelInfo) To() address.Address
- func (t *ChannelInfo) UnmarshalCBOR(r io.Reader) (err error)
- func (ci *ChannelInfo) WasVoucherSubmitted(sv *types.SignedVoucher) (bool, error)
- type DagstoreInitializeAllEvent
- type DagstoreInitializeAllParams
- type DagstoreShardInfo
- type DagstoreShardResult
- type DataTransferChannel
- type DealInfo
- type DealInfoIncludePath
- type DealInfoV2
- type DirectDeal
- type DirectDealInfo
- type DirectDealParam
- type DirectDealParams
- type DirectDealQueryParams
- type DirectDealState
- type FsStorage
- type FundedAddressState
- type GetDealSpec
- type ImportDataRef
- type ImportDataRefs
- type ImportDataResult
- type MarketBalance
- type MinerAddress
- type MinerDeal
- type MinerID
- type MsgInfo
- type Page
- type PendingDealInfo
- type PieceInfo
- type PieceStatus
- type PieceStorageInfos
- type ProviderDealState
- func (deal ProviderDealState) Identifier() retrievalmarket.ProviderDealIdentifier
- func (deal *ProviderDealState) IntervalLowerBound() uint64
- func (t *ProviderDealState) MarshalCBOR(w io.Writer) error
- func (deal *ProviderDealState) NextInterval() uint64
- func (deal *ProviderDealState) TotalPaidFor() uint64
- func (t *ProviderDealState) UnmarshalCBOR(r io.Reader) (err error)
- type RetrievalAsk
- type RetrievalDealQueryParams
- type RetrievalDealStatistic
- type S3Storage
- type SectorSize
- type SignInfo
- type SignedStorageAsk
- type StorageDealQueryParams
- type StorageDealStatistic
- type StorageStatus
- type TimeStamp
- type User
- type VoucherInfo
- type VoucherInfos
Constants ¶
const ( ShardStateNew = "ShardStateNew" ShardStateInitializing = "ShardStateInitializing" ShardStateAvailable = "ShardStateAvailable" ShardStateServing = "ShardStateServing" ShardStateRecovering = "ShardStateRecovering" ShardStateErrored = "ShardStateErrored" ShardStateUnknown = "ShardStateUnknown" )
refer: https://github.com/filecoin-project/dagstore/blob/master/shard_state.go#L37
const ( DirInbound = 1 DirOutbound = 2 )
Variables ¶
var ErrChannelNotFound = fmt.Errorf("channel not found")
Functions ¶
This section is empty.
Types ¶
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 DagstoreShardInfo ¶
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 ¶
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 DealInfoV2 ¶ added in v1.15.0
type DealInfoV2 struct { DealID abi.DealID PublishCid cid.Cid AllocationID types.AllocationId PieceCID cid.Cid PieceSize abi.PaddedPieceSize Client address.Address Provider address.Address Offset abi.PaddedPieceSize Length abi.PaddedPieceSize PayloadSize uint64 StartEpoch abi.ChainEpoch EndEpoch abi.ChainEpoch }
func (*DealInfoV2) IsBuiltinMarket ¶ added in v1.15.0
func (d *DealInfoV2) IsBuiltinMarket() bool
type DirectDeal ¶ added in v1.15.0
type DirectDeal struct { ID uuid.UUID PieceCID cid.Cid PieceSize abi.PaddedPieceSize Client address.Address Provider address.Address PayloadSize uint64 State DirectDealState AllocationID uint64 ClaimID uint64 SectorID abi.SectorNumber Offset abi.PaddedPieceSize Length abi.PaddedPieceSize StartEpoch abi.ChainEpoch EndEpoch abi.ChainEpoch Message string TimeStamp }
type DirectDealInfo ¶ added in v1.15.0
type DirectDealInfo struct { AllocationID types.AllocationId PieceCID cid.Cid PieceSize abi.PaddedPieceSize Client address.Address Provider address.Address Offset abi.PaddedPieceSize Length abi.PaddedPieceSize PayloadSize uint64 StartEpoch abi.ChainEpoch EndEpoch abi.ChainEpoch }
type DirectDealParam ¶ added in v1.15.0
type DirectDealParam struct { // FilePath and PayloadSize cannot both be empty FilePath string PayloadSize uint64 DealUUID uuid.UUID AllocationID uint64 PieceCID cid.Cid Client address.Address StartEpoch abi.ChainEpoch EndEpoch abi.ChainEpoch }
type DirectDealParams ¶ added in v1.15.0
type DirectDealParams struct { // Commp will not be calculated and verified SkipCommP bool // not copy car file to piece storage NoCopyCarFile bool // skip generate index SkipGenerateIndex bool DealParams []DirectDealParam }
type DirectDealQueryParams ¶ added in v1.15.0
type DirectDealQueryParams struct { Provider address.Address Client address.Address State *DirectDealState Page Asc bool }
type DirectDealState ¶ added in v1.15.0
type DirectDealState int
const ( DealAllocated DirectDealState = iota + 1 DealSealing DealActive DealExpired DealSlashed DealError )
func (DirectDealState) String ¶ added in v1.15.0
func (d DirectDealState) String() string
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 // Filter by sector lifetime, for snapdeal SectorExpiration *abi.ChainEpoch }
type ImportDataRef ¶ added in v1.12.0
type ImportDataRefs ¶ added in v1.12.0
type ImportDataRefs struct { Refs []*ImportDataRef SkipCommP bool }
type ImportDataResult ¶ added in v1.12.0
type MinerAddress ¶
type MinerAddress = address.Address
type MinerDeal ¶
type MinerDeal struct { ID uuid.UUID 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
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
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 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 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 ¶
func (deal ProviderDealState) Identifier() retrievalmarket.ProviderDealIdentifier
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 RetrievalDealQueryParams ¶ added in v1.11.0
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 SectorSize ¶
type SectorSize = abi.SectorSize
type SignedStorageAsk ¶ added in v1.8.0
type SignedStorageAsk struct { Ask *storagemarket.StorageAsk Signature *crypto.Signature TimeStamp }
SignedStorageAsk use to record provider's requirement in database
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 (sa *SignedStorageAsk) ToChainAsk() *storagemarket.SignedStorageAsk
func (*SignedStorageAsk) UnmarshalCBOR ¶ added in v1.8.0
func (t *SignedStorageAsk) UnmarshalCBOR(r io.Reader) (err error)
type StorageDealQueryParams ¶ added in v1.11.0
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 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