filecoin-pin
    Preparing search index...

    Interface SynapseUploadOptions

    interface SynapseUploadOptions {
        contextId?: string;
        contexts?: StorageContext[];
        copies?: number;
        dataSetIds?: bigint[];
        excludeProviderIds?: bigint[];
        metadata?: Record<string, string>;
        onProgress?: ProgressEventHandler<UploadProgressEvents>;
        pieceMetadata?: Record<string, string>;
        providerIds?: bigint[];
        signal?: AbortSignal;
    }
    Index

    Properties

    contextId?: string

    Context identifier for logging (e.g., pinId, import job ID)

    contexts?: StorageContext[]

    Pre-created storage contexts to use directly. When provided, the SDK skips provider selection and uses these contexts as-is.

    Mutually exclusive with providerIds, dataSetIds, and copies.

    const [ctx] = await synapse.storage.createContexts({ providerIds: [9n] })
    uploadToSynapse(synapse, carData, rootCid, logger, { contexts: [ctx] })
    copies?: number

    Number of storage copies to create (default determined by SDK).

    dataSetIds?: bigint[]

    Specific existing data set IDs to target. Mutually exclusive with providerIds and contexts.

    Use only when resuming into a known data set from a prior operation. For first-time uploads to specific providers, use providerIds instead.

    excludeProviderIds?: bigint[]

    Provider IDs to exclude from selection.

    metadata?: Record<string, string>

    Data set metadata applied when creating or matching contexts.

    Optional callbacks for monitoring upload progress

    pieceMetadata?: Record<string, string>

    Optional metadata to associate with the upload (per-piece)

    providerIds?: bigint[]

    Specific provider IDs to upload to. The SDK resolves or creates data sets on each provider automatically. Mutually exclusive with dataSetIds and contexts.

    This is the recommended way to target specific providers. Do not call createContext() to resolve data sets first. Pass provider IDs here and the SDK handles the rest.

    uploadToSynapse(synapse, carData, rootCid, logger, { providerIds: [4n, 9n] })
    
    signal?: AbortSignal

    Optional AbortSignal to cancel the upload operation.