Documentation ¶
Overview ¶
Package fcrmessages - stores all the p2p messages.
Package fcrmessages - stores all the p2p messages.
Package fcrmessages - stores all the p2p messages.
Package fcrmessages - stores all the p2p messages.
Package fcrmessages - stores all the p2p messages.
Package fcrmessages - stores all the p2p messages.
Package fcrmessages - stores all the messages.
Package fcrmessages - stores all the messages.
Package fcrmessages - stores all the p2p messages.
Package fcrmessages - stores all the p2p messages.
Package fcrmessages - stores all the p2p messages.
Package fcrmessages - stores all the p2p messages.
Index ¶
- Constants
- func DecodeDHTOfferDiscoveryRequest(fcrMsg *FCRReqMsg) (uint64, string, *cid.ContentID, uint32, uint32, string, string, error)
- func DecodeDHTOfferDiscoveryResponse(fcrMsg *FCRACKMsg) (uint64, map[string]FCRACKMsg, string, error)
- func DecodeDataRetrievalRequest(fcrMsg *FCRReqMsg) (uint64, string, *cidoffer.SubCIDOffer, string, string, error)
- func DecodeDataRetrievalResponse(fcrMsg *FCRACKMsg) (uint64, string, []byte, error)
- func DecodeEstablishmentRequest(fcrMsg *FCRReqMsg) (uint64, string, string, error)
- func DecodeEstablishmentResponse(fcrMsg *FCRACKMsg) (uint64, string, error)
- func DecodeOfferPublishRequest(fcrMsg *FCRReqMsg) (uint64, string, *cidoffer.CIDOffer, error)
- func DecodeStandardOfferDiscoveryRequest(fcrMsg *FCRReqMsg) (uint64, string, *cid.ContentID, uint32, string, string, error)
- func DecodeStandardOfferDiscoveryResponse(fcrMsg *FCRACKMsg) (uint64, []cidoffer.SubCIDOffer, string, error)
- type FCRACKMsg
- func CreateFCRACKErrorMsg(nonce uint64, err error) *FCRACKMsg
- func CreateFCRACKMsg(nonce uint64, msgBody []byte) *FCRACKMsg
- func EncodeDHTOfferDiscoveryResponse(nonce uint64, contacted map[string]*FCRACKMsg, refundVoucher string) (*FCRACKMsg, error)
- func EncodeDataRetrievalResponse(nonce uint64, tag string, data []byte) (*FCRACKMsg, error)
- func EncodeEstablishmentResponse(nonce uint64, challenge string) (*FCRACKMsg, error)
- func EncodeStandardOfferDiscoveryResponse(nonce uint64, offers []cidoffer.SubCIDOffer, refundVoucher string) (*FCRACKMsg, error)
- func (fcrMsg *FCRACKMsg) ACK() bool
- func (fcrMsg *FCRACKMsg) Body() []byte
- func (fcrMsg *FCRACKMsg) Error() string
- func (fcrMsg *FCRACKMsg) FromBytes(data []byte) error
- func (fcrMsg *FCRACKMsg) Nonce() uint64
- func (fcrMsg *FCRACKMsg) Sign(privKey string, keyVer byte) error
- func (fcrMsg *FCRACKMsg) Signature() string
- func (fcrMsg *FCRACKMsg) ToBytes() ([]byte, error)
- func (fcrMsg *FCRACKMsg) Verify(pubKey string, keyVer byte) error
- type FCRReqMsg
- func CreateFCRReqMsg(msgType byte, nonce uint64, msgBody []byte) *FCRReqMsg
- func EncodeDHTOfferDiscoveryRequest(nonce uint64, NodeID string, pieceCID *cid.ContentID, numDHT uint32, ...) (*FCRReqMsg, error)
- func EncodeDataRetrievalRequest(nonce uint64, senderID string, offer *cidoffer.SubCIDOffer, accountAddr string, ...) (*FCRReqMsg, error)
- func EncodeEstablishmentRequest(nonce uint64, nodeID string, challenge string) (*FCRReqMsg, error)
- func EncodeOfferPublishRequest(nonce uint64, nodeID string, offer *cidoffer.CIDOffer) (*FCRReqMsg, error)
- func EncodeStandardOfferDiscoveryRequest(nonce uint64, NodeID string, pieceCID *cid.ContentID, maxOfferRequested uint32, ...) (*FCRReqMsg, error)
- func (fcrMsg *FCRReqMsg) Body() []byte
- func (fcrMsg *FCRReqMsg) FromBytes(data []byte) error
- func (fcrMsg *FCRReqMsg) Nonce() uint64
- func (fcrMsg *FCRReqMsg) Sign(privKey string, keyVer byte) error
- func (fcrMsg *FCRReqMsg) Signature() string
- func (fcrMsg *FCRReqMsg) ToBytes() ([]byte, error)
- func (fcrMsg *FCRReqMsg) Type() byte
- func (fcrMsg *FCRReqMsg) Verify(pubKey string, keyVer byte) error
- func (fcrMsg *FCRReqMsg) VerifyByID(id string) error
Constants ¶
Variables ¶
This section is empty.
Functions ¶
func DecodeDHTOfferDiscoveryRequest ¶
func DecodeDHTOfferDiscoveryRequest(fcrMsg *FCRReqMsg) ( uint64, string, *cid.ContentID, uint32, uint32, string, string, error, )
DecodeDHTOfferDiscoveryRequest is used to get the fields from FCRMessage of dhtOfferDiscoveryRequestJson It returns the nonce, nodeID, pieceCID, numDHT, maxOfferRequestedPerDHT, account address and voucher.
func DecodeDHTOfferDiscoveryResponse ¶
func DecodeDHTOfferDiscoveryResponse(fcrMsg *FCRACKMsg) ( uint64, map[string]FCRACKMsg, string, error, )
DecodeDHTOfferDiscoveryResponse is used to get the fields from FCRMessage of dhtOfferDiscoveryResponseJson. It returns nonce, a map of contacted nodes -> contacted messages, refund account address and voucher.
func DecodeDataRetrievalRequest ¶
func DecodeDataRetrievalRequest(fcrMsg *FCRReqMsg) ( uint64, string, *cidoffer.SubCIDOffer, string, string, error, )
DecodeDataRetrievalRequest is used to get the fields from FCRMessage of dataRetrievalRequest. It returns the nonce, offer, account address and voucher.
func DecodeDataRetrievalResponse ¶
DecodeDataRetrievalResponse is used to get the fields from FCRMessage of dataRetrievalResponseJson. It returns the nonce, tag, and file data and error.
func DecodeEstablishmentRequest ¶
DecodeEstablishmentRequest is used to get the fields from FCRMessage of establishmentRequestJson It returns the nonce and challenge string in this establishment request.
func DecodeEstablishmentResponse ¶
DecodeEstablishmentResponse is used to get the fields from FCRMessage of establishmentResponseJson It returns the nonce and challenge string in this establishment request.
func DecodeOfferPublishRequest ¶
DecodeOfferPublishRequest is used to get the fields from FCRMessage of offerPublishRequestJson. It returns the nonce, nodeID and the offer.
func DecodeStandardOfferDiscoveryRequest ¶
func DecodeStandardOfferDiscoveryRequest(fcrMsg *FCRReqMsg) ( uint64, string, *cid.ContentID, uint32, string, string, error, )
DecodeStandardOfferDiscoveryRequest is used to get the fields from FCRMessage of standardOfferDiscoveryRequestJson. It returns the nonce, nodeID, pieceCID, maxOfferRequested, account address and voucher.
func DecodeStandardOfferDiscoveryResponse ¶
func DecodeStandardOfferDiscoveryResponse(fcrMsg *FCRACKMsg) ( uint64, []cidoffer.SubCIDOffer, string, error, )
DecodeStandardOfferDiscoveryResponse is used to get the fields from FCRMessage of standardOfferDiscoveryResponseJson. It returns nonce, a list of offers, refund account address and voucher.
Types ¶
type FCRACKMsg ¶
type FCRACKMsg struct {
// contains filtered or unexported fields
}
FCRACKMsg is the response used in communication between filecoin retrieval entities.
func CreateFCRACKErrorMsg ¶
CreateFCRACKErrorMsg is used to create an unsigned error message
func CreateFCRACKMsg ¶
CreateFCRACKMsg is used to create an unsigned ack message
func EncodeDHTOfferDiscoveryResponse ¶
func EncodeDHTOfferDiscoveryResponse( nonce uint64, contacted map[string]*FCRACKMsg, refundVoucher string, ) (*FCRACKMsg, error)
EncodeDHTOfferDiscoveryResponse is used to get the FCRMessage of dhtOfferDiscoveryResponseJson.
func EncodeDataRetrievalResponse ¶
EncodeDataRetrievalResponse is used to get the FCRMessage of dataRetrievalResponseJson.
func EncodeEstablishmentResponse ¶
EncodeEstablishmentResponse is used to get the FCRMessage of establishmentResponseJson
func EncodeStandardOfferDiscoveryResponse ¶
func EncodeStandardOfferDiscoveryResponse( nonce uint64, offers []cidoffer.SubCIDOffer, refundVoucher string, ) (*FCRACKMsg, error)
EncodeStandardOfferDiscoveryResponse is used to get the FCRMessage of standardOfferDiscoveryResponseJson.
func (*FCRACKMsg) Sign ¶
Sign is used to sign the message with a given private key and a key version.
type FCRReqMsg ¶
type FCRReqMsg struct {
// contains filtered or unexported fields
}
FCRReqMsg is the request used in communication between filecoin retrieval entities.
func CreateFCRReqMsg ¶
CreateFCRReqMsg is used to create an unsigned message
func EncodeDHTOfferDiscoveryRequest ¶
func EncodeDHTOfferDiscoveryRequest( nonce uint64, NodeID string, pieceCID *cid.ContentID, numDHT uint32, maxOfferRequestedPerDHT uint32, accountAddr string, voucher string, ) (*FCRReqMsg, error)
EncodeDHTOfferDiscoveryRequest is used to get the FCRMessage of dhtOfferDiscoveryRequestJson
func EncodeDataRetrievalRequest ¶
func EncodeDataRetrievalRequest( nonce uint64, senderID string, offer *cidoffer.SubCIDOffer, accountAddr string, voucher string, ) (*FCRReqMsg, error)
EncodeDataRetrievalRequest is used to get the FCRMessage of dataRetrievalRequest.
func EncodeEstablishmentRequest ¶
func EncodeEstablishmentRequest( nonce uint64, nodeID string, challenge string, ) (*FCRReqMsg, error)
EncodeEstablishmentRequest is used to get the FCRMessage of establishmentRequestJson
func EncodeOfferPublishRequest ¶
func EncodeOfferPublishRequest( nonce uint64, nodeID string, offer *cidoffer.CIDOffer, ) (*FCRReqMsg, error)
EncodeOfferPublishRequest is used to get the FCRMessage of offerPublishRequestJson.
func EncodeStandardOfferDiscoveryRequest ¶
func EncodeStandardOfferDiscoveryRequest( nonce uint64, NodeID string, pieceCID *cid.ContentID, maxOfferRequested uint32, accountAddr string, voucher string, ) (*FCRReqMsg, error)
EncodeStandardOfferDiscoveryRequest is used to get the FCRMessage of standardOfferDiscoveryRequestJson.
func (*FCRReqMsg) Sign ¶
Sign is used to sign the message with a given private key and a key version.
func (*FCRReqMsg) VerifyByID ¶
VerifyByID is used to verify the offer with a given id (hashed public key).