migrations

package
v1.26.7 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2023 License: Apache-2.0, MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

ClientMigrations are migrations for the client's store of storage deals

View Source
var ProviderMigrations = versioned.BuilderList{
	versioned.NewVersionedBuilder(MigrateMinerDeal0To1, versioning.VersionKey("1")).FilterKeys([]string{
		"/latest-ask", "/storage-ask/latest", "/storage-ask/1/latest", "/storage-ask/versions/current"}),
	versioned.NewVersionedBuilder(MigrateMinerDeal1To2, versioning.VersionKey("2")).FilterKeys([]string{
		"/latest-ask", "/storage-ask/latest", "/storage-ask/1/latest", "/storage-ask/versions/current"}).OldVersion("1"),
}

ProviderMigrations are migrations for the providers's store of storage deals

Functions

func GetMigrateSignedStorageAsk0To1

func GetMigrateSignedStorageAsk0To1(sign func(ctx context.Context, ask *storagemarket.StorageAsk) (*crypto.Signature, error)) func(*SignedStorageAsk0) (*storagemarket.SignedStorageAsk, error)

GetMigrateSignedStorageAsk0To1 returns a function that migrates a tuple encoded signed storage ask to a map encoded signed storage ask It needs a signing function to resign the ask -- there's no way around that

func MigrateClientDeal0To1

func MigrateClientDeal0To1(oldCd *ClientDeal0) (*storagemarket.ClientDeal, error)

MigrateClientDeal0To1 migrates a tuple encoded client deal to a map encoded client deal

func MigrateDataRef0To1

func MigrateDataRef0To1(oldDr *DataRef0) *storagemarket.DataRef

MigrateDataRef0To1 migrates a tuple encoded data tref to a map encoded data ref

func MigrateMinerDeal1To2

func MigrateMinerDeal1To2(oldCd *MinerDeal1) (*storagemarket.MinerDeal, error)

MigrateMinerDeal1To2 migrates a miner deal label to the new format

func MigrateStorageAsk0To1

func MigrateStorageAsk0To1(oldSa *StorageAsk0) *storagemarket.StorageAsk

MigrateStorageAsk0To1 migrates a tuple encoded storage ask to a map encoded storage ask

Types

type AskRequest0

type AskRequest0 struct {
	Miner address.Address
}

AskRequest0 is version 0 of AskRequest

func (*AskRequest0) MarshalCBOR

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

func (*AskRequest0) UnmarshalCBOR

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

type AskResponse0

type AskResponse0 struct {
	Ask *SignedStorageAsk0
}

AskResponse0 is version 0 of AskResponse

func (*AskResponse0) MarshalCBOR

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

func (*AskResponse0) UnmarshalCBOR

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

type Balance0

type Balance0 struct {
	Locked    abi.TokenAmount
	Available abi.TokenAmount
}

Balance0 is version 0 of Balance

func (*Balance0) MarshalCBOR

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

func (*Balance0) UnmarshalCBOR

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

type ClientDeal0

type ClientDeal0 struct {
	market.ClientDealProposal
	ProposalCid    cid.Cid
	AddFundsCid    *cid.Cid
	State          storagemarket.StorageDealStatus
	Miner          peer.ID
	MinerWorker    address.Address
	DealID         abi.DealID
	DataRef        *DataRef0
	Message        string
	PublishMessage *cid.Cid
	SlashEpoch     abi.ChainEpoch
	PollRetryCount uint64
	PollErrorCount uint64
	FastRetrieval  bool
	StoreID        *uint64
	FundsReserved  abi.TokenAmount
	CreationTime   cbg.CborTime
}

ClientDeal0 is version 0 of ClientDeal

func (*ClientDeal0) MarshalCBOR

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

func (*ClientDeal0) UnmarshalCBOR

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

type DataRef0

type DataRef0 struct {
	TransferType string
	Root         cid.Cid
	PieceCid     *cid.Cid
	PieceSize    abi.UnpaddedPieceSize
}

DataRef0 is version 0 of DataRef

func (*DataRef0) MarshalCBOR

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

func (*DataRef0) UnmarshalCBOR

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

type DealStatusRequest0

type DealStatusRequest0 struct {
	Proposal  cid.Cid
	Signature crypto.Signature
}

DealStatusRequest0 is version 0 of DealStatusRequest

func (*DealStatusRequest0) MarshalCBOR

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

func (*DealStatusRequest0) UnmarshalCBOR

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

type DealStatusResponse0

type DealStatusResponse0 struct {
	DealState ProviderDealState0
	Signature crypto.Signature
}

DealStatusResponse0 is version 0 of DealStatusResponse

func (*DealStatusResponse0) MarshalCBOR

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

func (*DealStatusResponse0) UnmarshalCBOR

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

type MinerDeal0

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

	DealID       abi.DealID
	CreationTime cbg.CborTime
}

MinerDeal0 is version 0 of MinerDeal

func (*MinerDeal0) MarshalCBOR

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

func (*MinerDeal0) UnmarshalCBOR

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

type MinerDeal1

type MinerDeal1 struct {
	marketOld.ClientDealProposal
	ProposalCid           cid.Cid
	AddFundsCid           *cid.Cid
	PublishCid            *cid.Cid
	Miner                 peer.ID
	Client                peer.ID
	State                 storagemarket.StorageDealStatus
	PiecePath             filestore.Path
	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
	SectorNumber      abi.SectorNumber

	InboundCAR string
}

MinerDeal1 is version 1 of MinerDeal

func MigrateMinerDeal0To1

func MigrateMinerDeal0To1(oldCd *MinerDeal0) (*MinerDeal1, error)

MigrateMinerDeal0To1 migrates a tuple encoded miner deal to a map encoded miner deal

func (*MinerDeal1) MarshalCBOR

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

func (*MinerDeal1) UnmarshalCBOR

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

type Proposal0

type Proposal0 struct {
	DealProposal  *market.ClientDealProposal
	Piece         *DataRef0
	FastRetrieval bool
}

Proposal0 is version 0 of Proposal

func (*Proposal0) MarshalCBOR

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

func (*Proposal0) UnmarshalCBOR

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

type Proposal1

type Proposal1 struct {
	DealProposal  *marketOld.ClientDealProposal
	Piece         *storagemarket.DataRef
	FastRetrieval bool
}

Proposal1 is version 1 of Proposal (used by deal proposal protocol v1.1.0)

func (*Proposal1) MarshalCBOR

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

func (*Proposal1) UnmarshalCBOR

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

type ProviderDealState0

type ProviderDealState0 struct {
	State         storagemarket.StorageDealStatus
	Message       string
	Proposal      *market.DealProposal
	ProposalCid   *cid.Cid
	AddFundsCid   *cid.Cid
	PublishCid    *cid.Cid
	DealID        abi.DealID
	FastRetrieval bool
}

ProviderDealState0 is version 0 of ProviderDealState

func (*ProviderDealState0) MarshalCBOR

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

func (*ProviderDealState0) UnmarshalCBOR

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

type Response0

type Response0 struct {
	State storagemarket.StorageDealStatus

	// DealProposalRejected
	Message  string
	Proposal cid.Cid

	// StorageDealProposalAccepted
	PublishMessage *cid.Cid
}

Response0 is version 0 of Response

func (*Response0) MarshalCBOR

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

func (*Response0) UnmarshalCBOR

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

type SignedResponse0

type SignedResponse0 struct {
	Response  Response0
	Signature *crypto.Signature
}

SignedResponse0 is version 0 of SignedResponse

func (*SignedResponse0) MarshalCBOR

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

func (*SignedResponse0) UnmarshalCBOR

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

type SignedStorageAsk0

type SignedStorageAsk0 struct {
	Ask       *StorageAsk0
	Signature *crypto.Signature
}

SignedStorageAsk0 is version 0 of SignedStorageAsk

func (*SignedStorageAsk0) MarshalCBOR

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

func (*SignedStorageAsk0) UnmarshalCBOR

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

type StorageAsk0

type StorageAsk0 struct {
	Price         abi.TokenAmount
	VerifiedPrice abi.TokenAmount

	MinPieceSize abi.PaddedPieceSize
	MaxPieceSize abi.PaddedPieceSize
	Miner        address.Address
	Timestamp    abi.ChainEpoch
	Expiry       abi.ChainEpoch
	SeqNo        uint64
}

StorageAsk0 is version 0 of StorageAsk

func (*StorageAsk0) MarshalCBOR

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

func (*StorageAsk0) UnmarshalCBOR

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

Jump to

Keyboard shortcuts

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