File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff 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 ) ;
You can’t perform that action at this time.
0 commit comments