Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/add/add.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ export async function runAdd(options: AddOptions): Promise<AddResult> {

// Parse authentication options from CLI and environment
const config = parseCLIAuth(options)
if (withCDN) config.withCDN = true

// Initialize just the Synapse SDK
const synapse = await initializeSynapse(config, logger)
Expand Down
5 changes: 4 additions & 1 deletion src/core/synapse/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ const DEFAULT_DATA_SET_METADATA = {
* Default configuration for creating storage contexts
*/
const DEFAULT_STORAGE_CONTEXT_CONFIG = {
withCDN: false, // CDN not needed for Filecoin Pin currently
withIpni: true, // Always filter for IPNI-enabled providers for IPFS indexing
metadata: DEFAULT_DATA_SET_METADATA,
} as const
Expand Down Expand Up @@ -72,6 +71,7 @@ export interface SynapseSetupConfig {
rpcUrl?: string | undefined
/** Optional override for WarmStorage contract address */
warmStorageAddress?: string | undefined
withCDN?: boolean | undefined
}

/**
Expand Down Expand Up @@ -265,6 +265,9 @@ export async function initializeSynapse(config: SynapseSetupConfig, logger: Logg
rpcURL,
withIpni: true, // Always filter for IPNI-enabled providers
}
if (config.withCDN) {
synapseOptions.withCDN = true
}
if (config.warmStorageAddress) {
synapseOptions.warmStorageAddress = config.warmStorageAddress
}
Expand Down
1 change: 1 addition & 0 deletions src/import/import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ export async function runCarImport(options: ImportOptions): Promise<ImportResult

// Parse authentication options from CLI and environment
const config = parseCLIAuth(options)
if (withCDN) config.withCDN = true

// Initialize just the Synapse SDK
const synapse = await initializeSynapse(config, logger)
Expand Down