migrations

package
v1.2.12 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2021 License: Apache-2.0, MIT Imports: 17 Imported by: 0

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, versioning.VersionKey("1")).
		FilterKeys([]string{"/retrieval-ask", "/retrieval-ask/latest", "/retrieval-ask/1/latest", "/retrieval-ask/versions/current"}),
}

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) (*retrievalmarket.ClientDealState, error)

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

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) (*retrievalmarket.ProviderDealState, error)

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

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

type ClientDealState0

type ClientDealState0 struct {
	DealProposal0
	StoreID              *multistore.StoreID
	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) error

type DealPayment0

type DealPayment0 struct {
	ID             retrievalmarket.DealID
	PaymentChannel address.Address
	PaymentVoucher *paych.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) 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) 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) 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) 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) error

type ProviderDealState0

type ProviderDealState0 struct {
	DealProposal0
	StoreID         multistore.StoreID
	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) 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) 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) 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) 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) error

Jump to

Keyboard shortcuts

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