ipfs / helia

An implementation of IPFS in TypeScript
https://helia.io
Other
953 stars 104 forks source link

Pinning doesn't work with @helia/json #246

Closed juliangruber closed 1 year ago

juliangruber commented 1 year ago
import { createHelia } from 'helia'
import { json } from '@helia/json'

const helia = await createHelia()
const j = json(helia)

const cid = await j.add([{foo:'bar'}])
await helia.pins.add(cid)

Uncaught Error: No dag walker found for cid codec 512 at #walkDag (file:///Users/julian/dev/meridian-ie/measure-service/node_modules/helia/dist/src/pins.js:96:19) at file:///Users/julian/dev/meridian-ie/measure-service/node_modules/helia/dist/src/pins.js:53:32 at file:///Users/julian/dev/meridian-ie/measure-service/node_modules/p-queue/dist/index.js:111:37 at PQueue._PQueue_tryToStartAnother (file:///Users/julian/dev/meridian-ie/measure-service/node_modules/p-queue/dist/index.js:285:13)

I'm trying to pin data that I imported using @helia/json. Am I doing something wrong?

juliangruber commented 1 year ago

The same does work with @helia/dag-cbor

achingbrain commented 1 year ago

Am I doing something wrong?

No, there's no dag walker configured for the json codec - one is added by #247 which should resolve this issue.