-
Notifications
You must be signed in to change notification settings - Fork 140
Closed
Description
Description: I encountered an issue while using the example "Addressing a file by CID with UnixFS". The CID of a specific file calculated in JavaScript does not match the result from the Go implementation. Additionally, I encountered an error while attempting to export the file.
Expected Behavior: The CID generated in JavaScript should match the CID generated in Go
Go: bafybeidcrqr5y44vp6tw6haladhxs3wc6kdi3ttvlfg37o7slddmayrvqm.
JS: bafybeifg4jtuuqlhjskm6oqq3usq23opono4ggjxkckzteazucnfu76thq
Actual Behavior: The CID generated in JavaScript is different from the expected CID. Moreover, I encountered the following error when trying to export the file:
Uncaught (in promise) NotUnixFSError: invalid wire type 4 at offset 26
Code
const file = event.target.files[0]
const helia = await createHelia()
const fs = unixfs(helia)
const blockstore = helia.blockstore
const cid = await fs.addFile({
content: file.stream(),
path: file.name,
})
console.log(cid.toString())
const block = await blockstore.get(cid)
const node = dagPb.decode(block)
console.log(node)
const entry = await exporter(cid, blockstore)
console.info(entry)
File : Mega
Metadata
Metadata
Assignees
Labels
No labels
