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: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

AskMigrations are migrations for the providers's retrieval ask

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

View Source
var ProviderMigrations = versioned.BuilderList{
	versioned.NewVersionedBuilder(MigrateProviderDealState0To1, "1").
		FilterKeys([]string{"/retrieval-ask", "/retrieval-ask/latest", "/retrieval-ask/1/latest", "/retrieval-ask/versions/current"}),
	versioned.NewVersionedBuilder(MigrateProviderDealState1To2, "2").OldVersion("1"),
}

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

Functions

func MigrateAsk0To1

func MigrateAsk0To1(oldAsk *Ask0) (*retrievalmarket.Ask, error)

MigrateAsk0To1 migrates a tuple encoded deal state to a map encoded deal state

func MigrateClientDealState0To1

func MigrateClientDealState0To1(oldDs *ClientDealState0) (*maptypes.ClientDealState1, error)

MigrateClientDealState0To1 migrates a tuple encoded deal state to a map encoded deal state

func MigrateClientDealState1To2

func MigrateClientDealState1To2(oldDs *maptypes.ClientDealState1) (*retrievalmarket.ClientDealState, error)

MigrateClientDealState1To2 migrates from v1 to v2 of a ClientDealState. The difference is that in v2 the ChannelID is a pointer, because the ChannelID is not set until the data transfer has started, so it should initially be nil.

func MigrateDealPayment0To1

func MigrateDealPayment0To1(oldDp DealPayment0) retrievalmarket.DealPayment

MigrateDealPayment0To1 migrates a tuple encoded DealPayment to a map encoded deal payment

func MigrateDealProposal0To1

func MigrateDealProposal0To1(oldDp DealProposal0) retrievalmarket.DealProposal

MigrateDealProposal0To1 migrates a tuple encoded DealProposal to a map encoded deal proposal

func MigrateDealResponse0To1

func MigrateDealResponse0To1(oldDr DealResponse0) retrievalmarket.DealResponse

MigrateDealResponse0To1 migrates a tuple encoded DealResponse to a map encoded deal response

func MigrateParams0To1

func MigrateParams0To1(oldParams Params0) retrievalmarket.Params

MigrateParams0To1 migrates tuple encoded deal params to map encoded deal params

func MigratePaymentInfo0To1

func MigratePaymentInfo0To1(oldPi *PaymentInfo0) *retrievalmarket.PaymentInfo

MigratePaymentInfo0To1 migrates an optional payment info tuple encoded struct to a map encoded struct

func MigrateProviderDealState0To1

func MigrateProviderDealState0To1(oldDs *ProviderDealState0) (*maptypes.ProviderDealState1, error)

MigrateProviderDealState0To1 migrates a tuple encoded deal state to a map encoded deal state

func MigrateProviderDealState1To2

func MigrateProviderDealState1To2(oldDs *maptypes.ProviderDealState1) (*retrievalmarket.ProviderDealState, error)

MigrateProviderDealState0To1 migrates from v1 to v2 of a MigrateProviderDealState. The difference is that in v2 the ChannelID is a pointer, because the ChannelID is not set until the data transfer has started, so it should initially be nil.

func MigrateQuery0To1

func MigrateQuery0To1(oldQuery Query0) retrievalmarket.Query

MigrateQuery0To1 migrates tuple encoded query to map encoded query

func MigrateQueryParams0To1

func MigrateQueryParams0To1(oldParams QueryParams0) retrievalmarket.QueryParams

MigrateQueryParams0To1 migrates tuple encoded query params to map encoded query params

func MigrateQueryResponse0To1

func MigrateQueryResponse0To1(oldQr QueryResponse0) retrievalmarket.QueryResponse

MigrateQueryResponse0To1 migrates tuple encoded query response to map encoded query response

Types

type Ask0

type Ask0 struct {
	PricePerByte            abi.TokenAmount
	UnsealPrice             abi.TokenAmount
	PaymentInterval         uint64
	PaymentIntervalIncrease uint64
}

Ask0 is version 0 of Ask

func (*Ask0) MarshalCBOR

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

func (*Ask0) UnmarshalCBOR

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

type ClientDealState0

type ClientDealState0 struct {
	DealProposal0
	StoreID              *uint64
	ChannelID            datatransfer.ChannelID
	LastPaymentRequested bool
	AllBlocksReceived    bool
	TotalFunds           abi.TokenAmount
	ClientWallet         address.Address
	MinerWallet          address.Address
	PaymentInfo          *PaymentInfo0
	Status               retrievalmarket.DealStatus
	Sender               peer.ID
	TotalReceived        uint64
	Message              string
	BytesPaidFor         uint64
	CurrentInterval      uint64
	PaymentRequested     abi.TokenAmount
	FundsSpent           abi.TokenAmount
	UnsealFundsPaid      abi.TokenAmount
	WaitMsgCID           *cid.Cid // the CID of any message the client deal is waiting for
	VoucherShortfall     abi.TokenAmount
}

ClientDealState0 is version 0 of ClientDealState

func (*ClientDealState0) MarshalCBOR

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

func (*ClientDealState0) UnmarshalCBOR

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

type DealPayment0

type DealPayment0 struct {
	ID             retrievalmarket.DealID
	PaymentChannel address.Address
	PaymentVoucher *paychtypes.SignedVoucher
}

DealPayment0 is version 0 of DealPayment

func (*DealPayment0) MarshalCBOR

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

func (*DealPayment0) Type

Type method makes DealPayment0 usable as a voucher

func (*DealPayment0) UnmarshalCBOR

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

type DealProposal0

type DealProposal0 struct {
	PayloadCID cid.Cid
	ID         retrievalmarket.DealID
	Params0
}

DealProposal0 is version 0 of DealProposal

func (*DealProposal0) MarshalCBOR

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

func (*DealProposal0) Type

Type method makes DealProposal0 usable as a voucher

func (*DealProposal0) UnmarshalCBOR

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

type DealResponse0

type DealResponse0 struct {
	Status retrievalmarket.DealStatus
	ID     retrievalmarket.DealID

	// payment required to proceed
	PaymentOwed abi.TokenAmount

	Message string
}

DealResponse0 is version 0 of DealResponse

func (*DealResponse0) MarshalCBOR

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

func (*DealResponse0) Type

Type method makes DealResponse0 usable as a voucher result

func (*DealResponse0) UnmarshalCBOR

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

type Params0

type Params0 struct {
	Selector                *cbg.Deferred // V1
	PieceCID                *cid.Cid
	PricePerByte            abi.TokenAmount
	PaymentInterval         uint64 // when to request payment
	PaymentIntervalIncrease uint64
	UnsealPrice             abi.TokenAmount
}

Params0 is version 0 of Params

func (*Params0) MarshalCBOR

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

func (*Params0) UnmarshalCBOR

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

type PaymentInfo0

type PaymentInfo0 struct {
	PayCh address.Address
	Lane  uint64
}

PaymentInfo0 is version 0 of PaymentInfo

func (*PaymentInfo0) MarshalCBOR

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

func (*PaymentInfo0) UnmarshalCBOR

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

type ProviderDealState0

type ProviderDealState0 struct {
	DealProposal0
	StoreID         uint64
	ChannelID       datatransfer.ChannelID
	PieceInfo       *piecemigrations.PieceInfo0
	Status          retrievalmarket.DealStatus
	Receiver        peer.ID
	TotalSent       uint64
	FundsReceived   abi.TokenAmount
	Message         string
	CurrentInterval uint64
}

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 Query0

type Query0 struct {
	PayloadCID   cid.Cid // V0
	QueryParams0         // V1
}

Query0 is version 0 of Query

func (*Query0) MarshalCBOR

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

func (*Query0) UnmarshalCBOR

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

type QueryParams0

type QueryParams0 struct {
	PieceCID *cid.Cid // optional, query if miner has this cid in this piece. some miners may not be able to respond.

}

QueryParams0 is version 0 of QueryParams

func (*QueryParams0) MarshalCBOR

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

func (*QueryParams0) UnmarshalCBOR

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

type QueryResponse0

type QueryResponse0 struct {
	Status        retrievalmarket.QueryResponseStatus
	PieceCIDFound retrievalmarket.QueryItemStatus // V1 - if a PieceCID was requested, the result

	Size uint64 // Total size of piece in bytes

	PaymentAddress             address.Address // address to send funds to -- may be different than miner addr
	MinPricePerByte            abi.TokenAmount
	MaxPaymentInterval         uint64
	MaxPaymentIntervalIncrease uint64
	Message                    string
	UnsealPrice                abi.TokenAmount
}

QueryResponse0 is version 0 of QueryResponse

func (*QueryResponse0) MarshalCBOR

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

func (*QueryResponse0) UnmarshalCBOR

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

type RetrievalPeer0

type RetrievalPeer0 struct {
	Address  address.Address
	ID       peer.ID // optional
	PieceCID *cid.Cid
}

RetrievalPeer0 is version 0 of RetrievalPeer

func (*RetrievalPeer0) MarshalCBOR

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

func (*RetrievalPeer0) UnmarshalCBOR

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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