Skip to content

Storage Operations

Data Set: A logical container of pieces stored with one provider. When a data set is created, a payment rail is established with that provider. All pieces in the data set share this single payment rail and are verified together via PDP proofs.

PieceCID: Content-addressed identifier for your data (format: bafkzcib...). Automatically calculated during upload and used to retrieve data from any provider.

Metadata: Optional key-value pairs for organization:

  • Data Set Metadata: Max 10 keys (e.g., project, environment)
  • Piece Metadata: Max 3 keys per piece (e.g., filename, contentType)

Copies and Durability: By default, upload() stores your data with 2 independent providers. Each provider maintains its own data set with separate PDP proofs and payment rails. If one provider goes down, your data is still available from the other.

Storage Manager: The main entry point for storage operations (synapse.storage). Handles provider selection, multi-copy orchestration, data set management, and provider-agnostic downloads.

Storage contexts represent a connection to a specific provider and data set. The SDK creates and manages contexts internally during upload(), but you can create them explicitly for data set management, retrieval, or split operations.

import { class SynapseSynapse } from "@filoz/synapse-sdk"
import { function privateKeyToAccount(privateKey: Hex, options?: PrivateKeyToAccountOptions): PrivateKeyAccount
@descriptionCreates an Account from a private key.@returnsA Private Key Account.
privateKeyToAccount
} from "viem/accounts"
const const synapse: Synapsesynapse = class SynapseSynapse.Synapse.create(options: SynapseOptions): Synapsecreate({ SynapseOptions.account: `0x${string}` | Accountaccount: function privateKeyToAccount(privateKey: Hex, options?: PrivateKeyToAccountOptions): PrivateKeyAccount
@descriptionCreates an Account from a private key.@returnsA Private Key Account.
privateKeyToAccount
("0x..."), SynapseOptions.source: string | nullsource: "my-app" })
// All options are optional await const synapse: Synapsesynapse.Synapse.storage: StorageManagerstorage.StorageManager.createContext(options?: StorageServiceOptions): Promise<StorageContext>createContext({ StorageServiceOptions.providerId?: bigint | undefinedproviderId: 1n, // specific provider (optional) StorageServiceOptions.dataSetId?: bigint | undefineddataSetId: 42n, // specific data set (optional) BaseContextOptions.metadata?: Record<string, string> | undefinedmetadata: { source: stringsource: "my-app" }, // data set metadata for matching/creation BaseContextOptions.withCDN?: boolean | undefinedwithCDN: true, // enable fast-retrieval (paid, optional) StorageServiceOptions.excludeProviderIds?: bigint[] | undefinedexcludeProviderIds: [3n], // skip specific providers (optional) })

For multi-copy replication, use createContexts():

const const contexts: StorageContext[]contexts = await const synapse: Synapsesynapse.Synapse.storage: StorageManagerstorage.StorageManager.createContexts(options?: CreateContextsOptions): Promise<StorageContext[]>createContexts({
  CreateContextsOptions.copies?: number | undefinedcopies: 3,                   // number of contexts (default: 2)
  CreateContextsOptions.providerIds?: bigint[] | undefinedproviderIds: [1n, 2n, 3n],   // specific providers (mutually exclusive with dataSetIds)
  CreateContextsOptions.dataSetIds?: bigint[] | undefineddataSetIds: [10n, 20n, 30n], // specific data sets (mutually exclusive with providerIds)
})
const [const primary: StorageContextprimary, const secondary: StorageContextsecondary] = const contexts: StorageContext[]contexts

View creation options for createContext()

View creation options for createContexts()

To benefit from compact piece storage, explicitly switch future uploads to new data sets, then reuse them. Matching an old data set continues using its legacy piece storage; the SDK does not migrate it automatically.

The SDK intelligently manages data sets to minimize on-chain transactions. The selection behavior depends on the parameters you provide:

Selection Scenarios:

  1. Explicit data set ID: If you specify dataSetId, that exact data set is used (must exist and be accessible)
  2. Specific provider: If you specify providerId, the SDK searches for matching data sets only within that provider’s existing data sets
  3. Automatic selection: Without specific parameters, the SDK searches across all your data sets with any approved provider

Exact Metadata Matching: In scenarios 2 and 3, the SDK will reuse an existing data set only if it has exactly the same metadata keys and values as requested. This ensures data sets remain organized according to your specific requirements.

Selection Priority: When multiple data sets match your criteria:

  • Data sets with existing pieces are preferred over empty ones
  • Within each group (with pieces vs. empty), the oldest data set (lowest ID) is selected

Provider Selection (when no matching data sets exist):

  • If you specify a provider (via providerId), that provider is used
  • Otherwise, the SDK selects from endorsed providers for the primary copy and any approved provider for secondaries
  • Before finalizing selection, the SDK verifies the provider is reachable via a ping test
  • If a provider fails the ping test, the SDK tries the next candidate
  • A new data set will be created automatically during the first commit

Download from any provider that has the piece. The SDK resolves the provider automatically:

import { class SynapseSynapse } from "@filoz/synapse-sdk"
import { function privateKeyToAccount(privateKey: Hex, options?: PrivateKeyToAccountOptions): PrivateKeyAccount
@descriptionCreates an Account from a private key.@returnsA Private Key Account.
privateKeyToAccount
} from "viem/accounts"
const const synapse: Synapsesynapse = class SynapseSynapse.Synapse.create(options: SynapseOptions): Synapsecreate({ SynapseOptions.account: `0x${string}` | Accountaccount: function privateKeyToAccount(privateKey: Hex, options?: PrivateKeyToAccountOptions): PrivateKeyAccount
@descriptionCreates an Account from a private key.@returnsA Private Key Account.
privateKeyToAccount
("0x..."), SynapseOptions.source: string | nullsource: 'my-app' })
// Download using PieceCID from a previous upload const const pieceCid: "bafkzcib..."pieceCid = "bafkzcib..." // from upload result const const bytes: Uint8Array<ArrayBufferLike>bytes = await const synapse: Synapsesynapse.Synapse.storage: StorageManagerstorage.StorageManager.download(options: StorageManagerDownloadOptions): Promise<Uint8Array>download({ pieceCid: string | PieceCIDpieceCid }) const const text: stringtext = new var TextDecoder: new (label?: string, options?: TextDecoderOptions) => TextDecoder
The **`TextDecoder`** interface represents a decoder for a specific text encoding, such as UTF-8, ISO-8859-2, or GBK. A decoder takes an array of bytes as input and returns a JavaScript string. [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoder)
TextDecoder
().TextDecoder.decode(input?: AllowSharedBufferSource, options?: TextDecodeOptions): string
The **`TextDecoder.decode()`** method returns a string containing text decoded from the buffer passed as a parameter. [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoder/decode)
decode
(const bytes: Uint8Array<ArrayBufferLike>bytes)
var console: Consoleconsole.Console.log(...data: any[]): void
The **`console.log()`** static method outputs a message to the console. [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/log_static)
log
("Downloaded:", const text: stringtext)
import { class SynapseSynapse } from "@filoz/synapse-sdk"
import { function privateKeyToAccount(privateKey: Hex, options?: PrivateKeyToAccountOptions): PrivateKeyAccount
@descriptionCreates an Account from a private key.@returnsA Private Key Account.
privateKeyToAccount
} from "viem/accounts"
// Enable CDN globally const const synapse: Synapsesynapse = class SynapseSynapse.Synapse.create(options: SynapseOptions): Synapsecreate({ SynapseOptions.account: `0x${string}` | Accountaccount: function privateKeyToAccount(privateKey: Hex, options?: PrivateKeyToAccountOptions): PrivateKeyAccount
@descriptionCreates an Account from a private key.@returnsA Private Key Account.
privateKeyToAccount
("0x..."),
SynapseOptions.source: string | nullsource: 'my-app', SynapseOptions.withCDN?: boolean | undefinedwithCDN: true, }) const const bytes: Uint8Array<ArrayBufferLike>bytes = await const synapse: Synapsesynapse.Synapse.storage: StorageManagerstorage.StorageManager.download(options: StorageManagerDownloadOptions): Promise<Uint8Array>download({ pieceCid: string | PieceCIDpieceCid: "bafkzcib..." }) // Or per-download: const const bytes2: Uint8Array<ArrayBufferLike>bytes2 = await const synapse: Synapsesynapse.Synapse.storage: StorageManagerstorage.StorageManager.download(options: StorageManagerDownloadOptions): Promise<Uint8Array>download({ pieceCid: string | PieceCIDpieceCid: "bafkzcib...", withCDN?: boolean | undefinedwithCDN: true, })

When using a StorageContext, downloads are restricted to that specific provider:

import { class SynapseSynapse, type class PieceCIDPieceCID } from "@filoz/synapse-sdk"
import { function privateKeyToAccount(privateKey: Hex, options?: PrivateKeyToAccountOptions): PrivateKeyAccount
@descriptionCreates an Account from a private key.@returnsA Private Key Account.
privateKeyToAccount
} from "viem/accounts"
const const synapse: Synapsesynapse = class SynapseSynapse.Synapse.create(options: SynapseOptions): Synapsecreate({ SynapseOptions.account: `0x${string}` | Accountaccount: function privateKeyToAccount(privateKey: Hex, options?: PrivateKeyToAccountOptions): PrivateKeyAccount
@descriptionCreates an Account from a private key.@returnsA Private Key Account.
privateKeyToAccount
("0x..."), SynapseOptions.source: string | nullsource: "my-app" })
const const ctx: StorageContextctx = await const synapse: Synapsesynapse.Synapse.storage: StorageManagerstorage.StorageManager.createContext(options?: StorageServiceOptions): Promise<StorageContext>createContext({ BaseContextOptions.metadata?: Record<string, string> | undefinedmetadata: { source: stringsource: "my-app" }, }) const const pieceCid: PieceCIDpieceCid = null as unknown as class PieceCIDPieceCID; // Downloads from the provider associated with this context const const data: Uint8Array<ArrayBufferLike>data = await const ctx: StorageContextctx.StorageContext.download(options: DownloadOptions): Promise<Uint8Array>download({ pieceCid: string | PieceCIDpieceCid })

The withCDN option follows a clear inheritance hierarchy:

  1. Synapse level: Default setting for all operations
  2. StorageContext level: Can override Synapse’s default
  3. Method level: Can override instance settings
await const synapse: Synapsesynapse.Synapse.storage: StorageManagerstorage.StorageManager.download(options: StorageManagerDownloadOptions): Promise<Uint8Array>download({ pieceCid: string | PieceCIDpieceCid })                // Uses Synapse's withCDN: true
await const ctx: StorageContextctx.StorageContext.download(options: DownloadOptions): Promise<Uint8Array>download({ pieceCid: string | PieceCIDpieceCid })                            // Uses context's withCDN: false
await const synapse: Synapsesynapse.Synapse.storage: StorageManagerstorage.StorageManager.download(options: StorageManagerDownloadOptions): Promise<Uint8Array>download({ pieceCid: string | PieceCIDpieceCid, withCDN?: boolean | undefinedwithCDN: false }) // Method override: CDN disabled

When withCDN: true is set, it adds { withCDN: '' } to the data set’s metadata, ensuring CDN-enabled and non-CDN data sets remain separate.

Retrieve all data sets owned by your account to inspect piece presence, CDN status, and metadata:

import { class SynapseSynapse } from "@filoz/synapse-sdk";
import { function privateKeyToAccount(privateKey: Hex, options?: PrivateKeyToAccountOptions): PrivateKeyAccount
@descriptionCreates an Account from a private key.@returnsA Private Key Account.
privateKeyToAccount
} from 'viem/accounts'
const const synapse: Synapsesynapse = class SynapseSynapse.Synapse.create(options: SynapseOptions): Synapsecreate({ SynapseOptions.account: `0x${string}` | Accountaccount: function privateKeyToAccount(privateKey: Hex, options?: PrivateKeyToAccountOptions): PrivateKeyAccount
@descriptionCreates an Account from a private key.@returnsA Private Key Account.
privateKeyToAccount
('0x...'), SynapseOptions.source: string | nullsource: 'my-app' });
const const dataSets: EnhancedDataSetInfo[]dataSets = await const synapse: Synapsesynapse.Synapse.storage: StorageManagerstorage.
StorageManager.findDataSets(options?: {
    address?: Address;
}): Promise<EnhancedDataSetInfo[]>
findDataSets
();
for (const const ds: EnhancedDataSetInfods of const dataSets: EnhancedDataSetInfo[]dataSets) { var console: Consoleconsole.Console.log(...data: any[]): void
The **`console.log()`** static method outputs a message to the console. [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/log_static)
log
(`Dataset ${const ds: EnhancedDataSetInfods.EnhancedDataSetInfo.pdpVerifierDataSetId: bigintpdpVerifierDataSetId}:`, {
live: booleanlive: const ds: EnhancedDataSetInfods.EnhancedDataSetInfo.isLive: booleanisLive, cdn: booleancdn: const ds: EnhancedDataSetInfods.EnhancedDataSetInfo.withCDN: booleanwithCDN, hasActivePieces: booleanhasActivePieces: const ds: EnhancedDataSetInfods.EnhancedDataSetInfo.hasActivePieces: booleanhasActivePieces, metadata: Record<string, string>metadata: const ds: EnhancedDataSetInfods.EnhancedDataSetInfo.metadata: Record<string, string>metadata }); }

List all pieces stored in a specific data set by iterating through a context:

const const context: StorageContextcontext = await const synapse: Synapsesynapse.Synapse.storage: StorageManagerstorage.StorageManager.createContext(options?: StorageServiceOptions): Promise<StorageContext>createContext({ StorageServiceOptions.dataSetId?: bigint | undefineddataSetId });

const const pieces: any[]pieces = [];
for await (const const piece: PieceRecordpiece of const context: StorageContextcontext.
StorageContext.getPieces(options?: {
    batchSize?: bigint;
}): AsyncGenerator<PieceRecord>
getPieces
()) {
const pieces: any[]pieces.Array<any>.push(...items: any[]): number
Appends new elements to the end of an array, and returns the new length of the array.
@paramitems New elements to add to the array.
push
(const piece: PieceRecordpiece);
} var console: Consoleconsole.Console.log(...data: any[]): void
The **`console.log()`** static method outputs a message to the console. [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/log_static)
log
(`Found ${const pieces: any[]pieces.Array<any>.length: number
Gets or sets the length of the array. This is a number one higher than the highest index in the array.
length
} pieces`);

Extract the size directly from a PieceCID using Synapse Core:

import * as import PiecePiece from "@filoz/synapse-core/piece";

const const pieceCid: "bafkzcib..."pieceCid = "bafkzcib...";
const const size: numbersize = import PiecePiece.
function from(input: Piece.PieceCIDInput): Piece.PieceCID
export from
from
(const pieceCid: "bafkzcib..."pieceCid).PieceCID.size: numbersize;
var console: Consoleconsole.Console.log(...data: any[]): void
The **`console.log()`** static method outputs a message to the console. [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/log_static)
log
(`Piece size: ${const size: numbersize} bytes`);

Query service-wide pricing, available providers, and network parameters:

const const info: StorageInfoinfo = await const synapse: Synapsesynapse.Synapse.storage: StorageManagerstorage.StorageManager.getStorageInfo(): Promise<StorageInfo>getStorageInfo();
var console: Consoleconsole.Console.log(...data: any[]): void
The **`console.log()`** static method outputs a message to the console. [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/log_static)
log
("Price/TiB/month:", const info: StorageInfoinfo.
StorageInfo.pricing: {
    noCDN: {
        perTiBPerMonth: bigint;
        perTiBPerDay: bigint;
        perTiBPerEpoch: bigint;
    };
    withCDN: {
        perTiBPerMonth: bigint;
        perTiBPerDay: bigint;
        perTiBPerEpoch: bigint;
    };
    tokenAddress: Address;
    tokenSymbol: string;
    priceList: getPriceList.OutputType;
}
pricing
.
noCDN: {
    perTiBPerMonth: bigint;
    perTiBPerDay: bigint;
    perTiBPerEpoch: bigint;
}
noCDN
.perTiBPerMonth: bigintperTiBPerMonth);
var console: Consoleconsole.Console.log(...data: any[]): void
The **`console.log()`** static method outputs a message to the console. [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/log_static)
log
("Providers:", const info: StorageInfoinfo.StorageInfo.providers: PDPProvider[]providers.Array<PDPProvider>.length: number
Gets or sets the length of the array. This is a number one higher than the highest index in the array.
length
);
const const providerInfo: PDPProviderproviderInfo = await const synapse: Synapsesynapse.Synapse.getProviderInfo(providerAddress: Address | bigint): Promise<PDPProvider>getProviderInfo("0x..."); var console: Consoleconsole.Console.log(...data: any[]): void
The **`console.log()`** static method outputs a message to the console. [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/log_static)
log
("PDP URL:", const providerInfo: PDPProviderproviderInfo.PDPProvider.pdp: PDPOfferingpdp.PDPOffering.serviceURL: stringserviceURL);

Irreversible Operation

Termination cannot be undone. Once initiated:

  • The termination transaction is irreversible
  • When the service ends, the provider may delete all data
  • Payment rails associated with the data set will be terminated
  • You cannot cancel the termination

Only terminate when you’re certain you no longer need the data.

To end the storage service for a data set and discontinue its payments, call context.terminate(), or synapse.storage.terminateService({ dataSetId }) when the data set ID is known (a context is not necessary).

There are two ways to terminate, chosen with the skipProvider option. The provider-mediated path is the recommended default: you sign an authorization, the provider relays it on chain, and if your account can settle in full the service and payment terminate immediately.

The direct on-chain path is an independent fallback. It is useful if the provider-mediated request is unavailable, account doesn’t have available funds to settle in full or you need to submit the transaction yourself. It does not require provider cooperation, but it uses the standard lockup wind-down: the service and payment continues until endEpoch, typically about 30 days, while the provider settles and winds down the data set before cleanup.

Recommended default (via provider) Fallback (skipProvider: true)
Who submits the transaction The provider relays your signed authorization You
Effect Can terminate immediately and allow cleanup to begin Service runs to the end of the lockup period, typically ~30 days
Cost to you Small termination fee (USDFC, drawn from your account) Transaction gas (FIL)
Requires Provider online, your account able to settle in full A funded wallet
Use when Preferred path for ordinary termination Provider-mediated termination cannot be completed, or you need independent submission

Provider-relayed termination never silently degrades: it either takes effect immediately or fails. The most common failure is an account that cannot cover full settlement; deposit funds or use skipProvider: true in that case. The result’s endEpoch reports the actual epoch at which the service stops; on the on-chain path this can be sooner than 30 days if your account stopped settling some time ago.

In both cases termination ends the service and its payments. The data set’s remaining on-chain state is cleaned up afterwards by the provider; that cleanup is not part of this call.

import { class SynapseSynapse } from "@filoz/synapse-sdk"
import { function privateKeyToAccount(privateKey: Hex, options?: PrivateKeyToAccountOptions): PrivateKeyAccount
@descriptionCreates an Account from a private key.@returnsA Private Key Account.
privateKeyToAccount
} from "viem/accounts"
const const synapse: Synapsesynapse = class SynapseSynapse.Synapse.create(options: SynapseOptions): Synapsecreate({ SynapseOptions.account: `0x${string}` | Accountaccount: function privateKeyToAccount(privateKey: Hex, options?: PrivateKeyToAccountOptions): PrivateKeyAccount
@descriptionCreates an Account from a private key.@returnsA Private Key Account.
privateKeyToAccount
("0x..."), SynapseOptions.source: string | nullsource: "my-app" })
const const ctx: StorageContextctx = await const synapse: Synapsesynapse.Synapse.storage: StorageManagerstorage.StorageManager.createContext(options?: StorageServiceOptions): Promise<StorageContext>createContext({ BaseContextOptions.metadata?: Record<string, string> | undefinedmetadata: { source: stringsource: "my-app" }, }) // Via context: relayed through this context's provider, immediate const const result: TerminateServiceResultresult = await const ctx: StorageContextctx.StorageContext.terminate(options?: Pick<TerminateServiceOptions, "skipProvider" | "onSubmitted">): Promise<TerminateServiceResult>terminate() var console: Consoleconsole.Console.log(...data: any[]): void
The **`console.log()`** static method outputs a message to the console. [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/log_static)
log
("Service terminated, ends at epoch", const result: TerminateServiceResultresult.TerminateServiceResult.endEpoch: bigintendEpoch)
// Or directly by data set ID const const result2: TerminateServiceResultresult2 = await const synapse: Synapsesynapse.Synapse.storage: StorageManagerstorage.StorageManager.terminateService(options: TerminateServiceOptions): Promise<TerminateServiceResult>terminateService({ TerminateServiceOptions.dataSetId: bigintdataSetId: 42n }) // Or submit independently on chain (winds down over the lockup period) const const result3: TerminateServiceResultresult3 = await const synapse: Synapsesynapse.Synapse.storage: StorageManagerstorage.StorageManager.terminateService(options: TerminateServiceOptions): Promise<TerminateServiceResult>terminateService({ TerminateServiceOptions.dataSetId: bigintdataSetId: 42n, TerminateServiceOptions.skipProvider?: boolean | undefinedskipProvider: true, TerminateServiceOptions.onSubmitted?: ((txHash: Hex) => void) | undefinedonSubmitted: (txHash: `0x${string}`txHash) => var console: Consoleconsole.Console.log(...data: any[]): void
The **`console.log()`** static method outputs a message to the console. [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/log_static)
log
("Submitted:", txHash: `0x${string}`txHash),
}) var console: Consoleconsole.Console.log(...data: any[]): void
The **`console.log()`** static method outputs a message to the console. [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/log_static)
log
("Service ends at epoch", const result3: TerminateServiceResultresult3.TerminateServiceResult.endEpoch: bigintendEpoch)

To delete an individual piece from the data set, call context.deletePiece(). This method submits an on-chain transaction to initiate the deletion process.

Important: Piece deletion is irreversible and cannot be canceled once initiated.

import { class SynapseSynapse } from "@filoz/synapse-sdk"
import { function privateKeyToAccount(privateKey: Hex, options?: PrivateKeyToAccountOptions): PrivateKeyAccount
@descriptionCreates an Account from a private key.@returnsA Private Key Account.
privateKeyToAccount
} from "viem/accounts"
const const synapse: Synapsesynapse = class SynapseSynapse.Synapse.create(options: SynapseOptions): Synapsecreate({ SynapseOptions.account: `0x${string}` | Accountaccount: function privateKeyToAccount(privateKey: Hex, options?: PrivateKeyToAccountOptions): PrivateKeyAccount
@descriptionCreates an Account from a private key.@returnsA Private Key Account.
privateKeyToAccount
("0x..."), SynapseOptions.source: string | nullsource: "my-app" })
const const ctx: StorageContextctx = await const synapse: Synapsesynapse.Synapse.storage: StorageManagerstorage.StorageManager.createContext(options?: StorageServiceOptions): Promise<StorageContext>createContext({ BaseContextOptions.metadata?: Record<string, string> | undefinedmetadata: { source: stringsource: "my-app" }, }) // List all pieces in the data set const const pieces: any[]pieces = [] for await (const const piece: PieceRecordpiece of const ctx: StorageContextctx.
StorageContext.getPieces(options?: {
    batchSize?: bigint;
}): AsyncGenerator<PieceRecord>
getPieces
()) {
const pieces: any[]pieces.Array<any>.push(...items: any[]): number
Appends new elements to the end of an array, and returns the new length of the array.
@paramitems New elements to add to the array.
push
(const piece: PieceRecordpiece)
} if (const pieces: any[]pieces.Array<any>.length: number
Gets or sets the length of the array. This is a number one higher than the highest index in the array.
length
> 0) {
await const ctx: StorageContextctx.
StorageContext.deletePiece(options: {
    piece: string | PieceCID | bigint;
}): Promise<Hash>
deletePiece
({ piece: string | bigint | PieceCIDpiece: const pieces: PieceRecord[]pieces[0].PieceRecord.pieceId: bigintpieceId })
var console: Consoleconsole.Console.log(...data: any[]): void
The **`console.log()`** static method outputs a message to the console. [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/log_static)
log
(
`Piece ${const pieces: PieceRecord[]pieces[0].PieceRecord.pieceCid: PieceCIDpieceCid} (ID: ${const pieces: PieceRecord[]pieces[0].PieceRecord.pieceId: bigintpieceId}) deleted successfully` ) } // Delete by PieceCID await const ctx: StorageContextctx.
StorageContext.deletePiece(options: {
    piece: string | PieceCID | bigint;
}): Promise<Hash>
deletePiece
({ piece: string | bigint | PieceCIDpiece: "bafkzcib..." })
  • Upload Pipeline - Upload data with multi-copy durability, from simple one-liner to manual store/pull/commit.

  • Storage Costs - Calculate your monthly costs and understand funding requirements.

  • Payment Management - Manage deposits, approvals, and payment rails.