Skip to content

SP-to-SP Piece Fetch Operations

Provides functionality to fetch pieces from external storage providers. Uses Curio’s POST /pdp/piece/fetch endpoint which is idempotent - repeated calls with the same extraData return the current status rather than creating duplicate requests.

import * as spFetch from '@filoz/synapse-core/sp-fetch'
Type AliasDescription
SPFetchPieceInputInput piece for a fetch request.
SPFetchPiecesOptionsOptions for fetching pieces from external SPs.
SPFetchPieceStatusStatus of a single piece in a fetch response.
SPFetchPollOptionsOptions for polling fetch status.
SPFetchResponseResponse from a fetch request.
SPFetchStatusStatus of a fetch operation or individual piece.
VariableDescription
FACTOR-
RETRIES-
FunctionDescription
fetchPiecesInitiate a piece fetch request or get status of an existing one.
pollStatusPoll for fetch completion.
setTimeout-