Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
juliangruber opened this issue Aug 23, 2023 · 2 comments · Fixed by #247
Closed

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

juliangruber opened this issue Aug 23, 2023 · 2 comments · Fixed by #247

Comments

@juliangruber
Copy link

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
Copy link
Author

juliangruber commented Aug 23, 2023

The same does work with @helia/dag-cbor

achingbrain added a commit that referenced this issue Aug 25, 2023
Since the json codec is bundled with multiformats we should add a
dag walker for it to allow pinning json blocks.

Fixes #246
@achingbrain
Copy link
Member

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.

achingbrain added a commit that referenced this issue Sep 2, 2023
Since the json codec is bundled with multiformats we should add a
dag walker for it to allow pinning json blocks.

Fixes #246
This was referenced Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
2 participants