Skip to content

pdp

Interface Description
MetadataCapture -
PDPMockOptions -
PieceMetadataCapture -
PullRequestCapture -
Function Description
addPiecesWithMetadataCapture Creates a handler that captures piece metadata from addPieces requests
createAndAddPiecesHandler -
createDataSetWithMetadataCapture Creates a handler that captures metadata from createDataSet requests
createPullResponse Helper to create a complete PullResponse
decodeMetadataFromCreateDataSetExtraData Helper to decode metadata from extraData
decodePieceMetadataFromExtraData Helper to decode piece metadata from extraData Format: (uint256 nonce, string[][] keys, string[][] values, bytes signature)
finalizePieceUploadHandler Creates a handler for finalizing a streaming upload POST /pdp/piece/uploads/:uuid - finalize with PieceCID
findAnyPieceHandler -
findPieceHandler Creates a handler for finding pieces
postPieceHandler Creates a handler that supports only one pieceCid Returns a UUID for 201, or a CID for 200
postPieceUploadsHandler Creates a handler for the streaming upload protocol (commp-last) POST /pdp/piece/uploads - creates upload session, returns UUID Note: This endpoint doesn’t require a request body
pullPiecesErrorHandler Creates a handler that returns an error response
pullPiecesHandler Creates a handler for the pull pieces endpoint that returns a fixed response
pullPiecesPollingHandler Creates a handler that simulates polling, returns pending status N times, then returns the final response
pullPiecesProgressionHandler Creates a handler that simulates a progression through statuses
pullPiecesWithCaptureHandler Creates a handler that captures the request body and returns a response
streamingUploadHandlers Creates handlers for the complete streaming upload flow (all piece CIDs accepted) Returns array of handlers for: POST /pdp/piece/uploads, PUT /pdp/piece/uploads/:uuid, POST /pdp/piece/uploads/:uuid
uploadPieceHandler -
uploadPieceStreamingHandler Creates a handler for uploading piece data via streaming protocol PUT /pdp/piece/uploads/:uuid - streams piece data