Skip to content

Commit 42a7c48

Browse files
committed
omfg
1 parent 18d3b9d commit 42a7c48

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

examples/store_big_data.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,15 +259,17 @@ async function main() {
259259

260260
console.log(`Storing DAG...`);
261261
let { rootCid, dagBytes } = await buildUnixFSDagPB(chunks, 0xb220);
262+
// Store with dag-pb codec (0x70) to match rootCid from buildUnixFSDagPB
262263
let { cid } = await store(
263264
bulletinAPI,
264265
signers[0].signer,
265266
dagBytes,
266-
undefined,
267-
undefined,
267+
0x70, // dag-pb codec
268+
0xb220, // blake2b-256
268269
TX_MODE_FINALIZED_BLOCK
269270
);
270271
console.log(`Downloading...${cid} / ${rootCid}`);
272+
assert.deepStrictEqual(cid, rootCid, '❌ CID mismatch between stored and computed DAG root');
271273
let downloadedContent = await fetchCid(HTTP_IPFS_API, rootCid);
272274
console.log(`✅ Reconstructed file size: ${downloadedContent.length} bytes`);
273275
await fileToDisk(downloadedFileByDagPath, downloadedContent);

0 commit comments

Comments
 (0)