-
Notifications
You must be signed in to change notification settings - Fork 106
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
Exporting a CAR with @helia/car
of a @helia/json
encoded CID throws an error
#375
Comments
In order to export a complete DAG as a CAR file, we need to know how to get a list of blocks that are linked to from the current block. To do this we need to know how to interpret the current block in order to extract and CIDs contained therein. From the error message there's a CID with the codec 512 (0x200) in a block being parsed but no DAGWalker has been configured for that codec. Helia comes with DAGWalkers for common codecs preconfigured (used for pinning operations), A short term fix would be to copy the JSON codec DAGWalker from Helia to |
I had a look at the code, and it seems that the default dag walkers are instantiated by the
Sorry for the novice questions, I'd love to help with a PR, but wanna make sure I follow the established practices for the repo. |
This, I think - that way people can augment the list with their own configurations.
No problem! |
To allow modules like `@helia/car` to re-use configured dag walkers instead of having to bundle their own, expose configured dag walkers and hashers on the helia interface and have them consume those. Fixes #375
To allow modules like `@helia/car` to re-use configured dag walkers instead of having to bundle their own, expose configured dag walkers and hashers on the helia interface and have them consume those. Fixes #375
) To allow modules like `@helia/car` to re-use configured dag walkers instead of having to bundle their own, expose configured dag walkers and hashers on the helia interface and have them consume those. Fixes #375
As per @achingbrain recommendation, I tried the
@helia/json
library to try out some simple utf-8 encoded JSON as an alternative to UnixFS.The APIs are indeed nicer to work with(adding and getting CIDs is an async operation rather than an async iterator), but exporting a CAR fails with the following error:
The source that produces this looks as follows
I tested this using
@helia/dag-json
and this works. So for now that's what I'm using since it gives the same return type.The text was updated successfully, but these errors were encountered: