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:
- POST /pdp/piece/uploads → get upload session UUID
- PUT /pdp/piece/uploads/{uuid} → stream data while calculating CommP
- POST /pdp/piece/uploads/{uuid} → finalize with calculated CommP
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
options | UploadPieceStreamingOptions | Upload options |
Returns
Section titled “Returns”PieceCID and size of uploaded data
Throws
Section titled “Throws”Error if upload fails at any step or if size exceeds MAX_UPLOAD_SIZE