Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ResponseProtocolID core.ProtocolID = "/fil/secondary-retrieval/response/0.0.1"
View Source
var RetrievalProtocolID core.ProtocolID = "/fil/secondary-retrieval/0.0.1"
Functions ¶
func StringToAddrInfo ¶
StringToAddrInfo converts a multiaddress string with peer ID to AddrInfo
Types ¶
type Params ¶
type Params struct { PayloadCID cid.Cid PieceCID *cid.Cid }
Params is the query parameters
func (*Params) MustString ¶
MustString returns Params as a string It panics if it fails to marshal the Params
type Query ¶
type Query struct { Params Params `json:"params"` // Requested data ClientAddrs []string `json:"clientAddrs"` // List of multiaddrs of the client }
Query is submitted by clients and observed by providers
type QueryResponse ¶
type QueryResponse struct { Params Params `json:"params"` // Requested data // TODO: Do we need their FIL address as well? Provider peer.ID `json:"provider"` // List of multiaddrs of the provider PricePerByte abi.TokenAmount `json:"pricePerByte"` PaymentInterval uint64 `json:"paymentInterval"` PaymentIntervalIncrease uint64 `json:"paymentIntervalIncrease"` }
QueryResponse is returned from a provider to a client if the provider has the requested data
func (*QueryResponse) Marshal ¶
func (q *QueryResponse) Marshal() ([]byte, error)
Marshal returns the JSON marshalled QueryResponse
func (*QueryResponse) String ¶
func (q *QueryResponse) String() string
func (*QueryResponse) Unmarshal ¶
func (q *QueryResponse) Unmarshal(bz []byte) error
Unmarshal JSON unmarshals the input into a QueryResponse
Click to show internal directories.
Click to hide internal directories.