Skip to content

uploadPieceStreaming

function uploadPieceStreaming(options): Promise<UploadPieceResponse>;

Defined in: packages/synapse-core/src/sp.ts:450

Upload piece data using the 3-step CommP-last streaming protocol.

Protocol:

  1. POST /pdp/piece/uploads → get upload session UUID
  2. PUT /pdp/piece/uploads/{uuid} → stream data while calculating CommP
  3. POST /pdp/piece/uploads/{uuid} → finalize with calculated CommP
ParameterTypeDescription
optionsUploadPieceStreamingOptionsUpload options

Promise<UploadPieceResponse>

PieceCID and size of uploaded data

Error if upload fails at any step or if size exceeds MAX_UPLOAD_SIZE