Skip to content

Commit 86c839f

Browse files
authored
fix: withCDN data set creation (#145)
* fix: withCDN data set creation Signed-off-by: Miroslav Bajtoš <[email protected]> * fixup! npm run lint:fix Signed-off-by: Miroslav Bajtoš <[email protected]> --------- Signed-off-by: Miroslav Bajtoš <[email protected]>
1 parent 7c610a3 commit 86c839f

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

src/add/add.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ export async function runAdd(options: AddOptions): Promise<AddResult> {
108108

109109
// Parse authentication options from CLI and environment
110110
const config = parseCLIAuth(options)
111+
if (withCDN) config.withCDN = true
111112

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

src/core/synapse/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ const DEFAULT_DATA_SET_METADATA = {
2828
* Default configuration for creating storage contexts
2929
*/
3030
const DEFAULT_STORAGE_CONTEXT_CONFIG = {
31-
withCDN: false, // CDN not needed for Filecoin Pin currently
3231
withIpni: true, // Always filter for IPNI-enabled providers for IPFS indexing
3332
metadata: DEFAULT_DATA_SET_METADATA,
3433
} as const
@@ -72,6 +71,7 @@ export interface SynapseSetupConfig {
7271
rpcUrl?: string | undefined
7372
/** Optional override for WarmStorage contract address */
7473
warmStorageAddress?: string | undefined
74+
withCDN?: boolean | undefined
7575
}
7676

7777
/**
@@ -265,6 +265,9 @@ export async function initializeSynapse(config: SynapseSetupConfig, logger: Logg
265265
rpcURL,
266266
withIpni: true, // Always filter for IPNI-enabled providers
267267
}
268+
if (config.withCDN) {
269+
synapseOptions.withCDN = true
270+
}
268271
if (config.warmStorageAddress) {
269272
synapseOptions.warmStorageAddress = config.warmStorageAddress
270273
}

src/import/import.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ export async function runCarImport(options: ImportOptions): Promise<ImportResult
179179

180180
// Parse authentication options from CLI and environment
181181
const config = parseCLIAuth(options)
182+
if (withCDN) config.withCDN = true
182183

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

0 commit comments

Comments
 (0)