libp2p Protocols

Boost exposes libp2p protocols so that clients can initiate storage deals with the SP

Propose Storage Deal Protocol

The client makes a deal proposal over v1.2.0 or v1.2.1 of the Propose Storage Deal Protocol: - /fil/storage/mk/1.2.0 or - /fil/storage/mk/1.2.1

It is a request / response protocol, where the request and response are CBOR-marshalled.

There are two new fields in the request of v1.2.1 of the protocol, described in the table below.

Request

FieldTypeDescription

DealUUID

uuid

A uuid for the deal specified by the client

IsOffline

boolean

Indicates whether the deal is online or offline

ClientDealProposal

ClientDealProposal

Same as <v1 proposal>.DealProposal

DealDataRoot

cid

The root cid of the CAR file. Same as <v1 proposal>.Piece.Root

Transfer.Type

string

eg "http"

Transfer.ClientID

string

Any id the client wants (useful for matching logs between client and server)

Transfer.Params

byte array

Interpreted according to Type. eg for "http" Transfer.Params contains the http headers as JSON

Transfer.Size

integer

The size of the data that is sent across the network

SkipIPNIAnnounce (v1.2.1)

boolean

Whether the provider should announce the deal to IPNI or not (default: false)

RemoveUnsealedCopy (v1.2.1)

boolean

Whether the provider should keep an unsealed copy of the deal (default: false)

Response

FieldTypeDescription

Accepted

boolean

Indicates whether the deal proposal was accepted

Message

string

A message about why the deal proposal was rejected

Storage Deal Status Protocol

The client requests the status of a deal over v1.2.0 of the Storage Deal Status Protocol: /fil/storage/status/1.2.0

It is a request / response protocol, where the request and response are CBOR-marshalled.

Request

FieldTypeDescription

DealUUID

uuid

The uuid of the deal

Signature

A signature over the uuid with the client's wallet

Response

FieldTypeDescription

DealUUID

uuid

The uuid of the deal

Error

string

Non-empty if there's an error getting the deal status

IsOffline

boolean

Indicates whether the deal is online or offline

TransferSize

integer

The total size of the transfer in bytes

NBytesReceived

integer

The number of bytes that have been downloaded

DealStatus.Error

string

Non-empty if the deal has failed

DealStatus.Status

string

The checkpoint that the deal has reached

DealStatus.Proposal

DealProposal

SignedProposalCid

cid

cid of the client deal proposal + signature

PublishCid

cid

The cid of the publish message, if the deal has been published

ChainDealID

integer

The ID of the deal on chain, if it's been published

Last updated