Documentation
¶
Index ¶
Constants ¶
const TagPriority = 100
TagPriority is the priority for deal streams -- they should generally be preserved above all else
Variables ¶
var AskRequestUndefined = AskRequest{}
var AskResponseUndefined = AskResponse{}
var ProposalUndefined = Proposal{}
var SignedResponseUndefined = SignedResponse{}
Functions ¶
This section is empty.
Types ¶
type AskRequest ¶
type AskRequest struct {
Miner address.Address
}
AskRequest is a request for current ask parameters for a given miner
func (*AskRequest) MarshalCBOR ¶
func (t *AskRequest) MarshalCBOR(w io.Writer) error
func (*AskRequest) UnmarshalCBOR ¶
func (t *AskRequest) UnmarshalCBOR(r io.Reader) error
type AskResponse ¶
type AskResponse struct {
Ask *storagemarket.SignedStorageAsk
}
AskResponse is the response sent over the network in response to an ask request
func (*AskResponse) MarshalCBOR ¶
func (t *AskResponse) MarshalCBOR(w io.Writer) error
func (*AskResponse) UnmarshalCBOR ¶
func (t *AskResponse) UnmarshalCBOR(r io.Reader) error
type Proposal ¶
type Proposal struct { DealProposal *market.ClientDealProposal Piece *storagemarket.DataRef }
Proposal is the data sent over the network from client to provider when proposing a deal
type Response ¶
type Response struct { State storagemarket.StorageDealStatus // DealProposalRejected Message string Proposal cid.Cid // StorageDealProposalAccepted PublishMessage *cid.Cid }
Response is a response to a proposal sent over the network
type SignedResponse ¶
SignedResponse is a response that is signed
func (*SignedResponse) MarshalCBOR ¶
func (t *SignedResponse) MarshalCBOR(w io.Writer) error
func (*SignedResponse) UnmarshalCBOR ¶
func (t *SignedResponse) UnmarshalCBOR(r io.Reader) error
type StorageAskStream ¶
type StorageAskStream interface { ReadAskRequest() (AskRequest, error) WriteAskRequest(AskRequest) error ReadAskResponse() (AskResponse, error) WriteAskResponse(AskResponse) error Close() error }
StorageAskStream is a stream for reading/writing requests & responses on the Storage Ask protocol
type StorageDealStream ¶
type StorageDealStream interface { ReadDealProposal() (Proposal, error) WriteDealProposal(Proposal) error ReadDealResponse() (SignedResponse, error) WriteDealResponse(SignedResponse) error RemotePeer() peer.ID TagProtectedConnection(identifier string) UntagProtectedConnection(identifier string) Close() error }
StorageDealStream is a stream for reading and writing requests and responses on the storage deal protocol
type StorageMarketNetwork ¶
type StorageMarketNetwork interface { NewAskStream(peer.ID) (StorageAskStream, error) NewDealStream(peer.ID) (StorageDealStream, error) SetDelegate(StorageReceiver) error StopHandlingRequests() error ID() peer.ID }
StorageMarketNetwork is a network abstraction for the storage market
func NewFromLibp2pHost ¶
func NewFromLibp2pHost(h host.Host) StorageMarketNetwork
NewFromLibp2pHost builds a storage market network on top of libp2p
type StorageReceiver ¶
type StorageReceiver interface { HandleAskStream(StorageAskStream) HandleDealStream(StorageDealStream) }
StorageReceiver implements functions for receiving incoming data on storage protocols