sp-fetch
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.
Example
Section titled “Example”import * as spFetch from '@filoz/synapse-core/sp-fetch'Type Aliases
Section titled “Type Aliases”| Type Alias | Description |
|---|---|
| SPFetchPieceInput | Input piece for a fetch request. |
| SPFetchPiecesOptions | Options for fetching pieces from external SPs. |
| SPFetchPieceStatus | Status of a single piece in a fetch response. |
| SPFetchPollOptions | Options for polling fetch status. |
| SPFetchResponse | Response from a fetch request. |
| SPFetchStatus | Status of a fetch operation or individual piece. |
Variables
Section titled “Variables”| Variable | Description |
|---|---|
| FACTOR | - |
| RETRIES | - |
Functions
Section titled “Functions”| Function | Description |
|---|---|
| fetchPieces | Initiate a piece fetch request or get status of an existing one. |
| pollStatus | Poll for fetch completion. |
| setTimeout | - |