Closed Zippersk closed 4 years ago
This conforms to the new Block
interface, not the old js-ipld
interface. You can see how the usage works in the README https://github.com/ipld/js-dag-json#json-directed-acrylic-graph-for-ipld .
Are you using js-ipfs
? I don’t think we have an up to date dag-json
for the old interface that js-ipfs
uses.
Thanks for answer! Yes, I am using js-ifps
. Does it mean that this repo is unusable with js-ipfs
as a codec for now? Is it usable with some other implementation of ipfs?
I think it would be really helpful (not only for me) to show in readme how to store data serialized with this codec in IPFS.
I’m actually not sure how to load new/custom codecs into js-ipfs
’s DAG API.
Maybe this is something @achingbrain or @alanshaw knows how to do. dag-json
is definitely not loaded by default.
You may just want to use dag-cbor
. It’s included by default and works a bit better than dag-json
(the representation is smaller, mainly due to native binary support).
Use https://github.com/ipfs/js-ipfs/tree/master/packages/ipfs#optionsipld and pass in the loadFormat
option.
Ah, scratch that, drive by comment! Like @mikeal said it won't work this is module. ipld-dag-cbor
looks like your best bet for now...or maybe you could use the output of this module with the IPFS block API?
I do not understand this repo. Is it format for IPLD like cbor or pb? If so, why does it have a different interface? How can I load this to IPLD?
I want to store JSON object in
dag-json
format to IPLD. This is my code:But it ends with error
Missing IPLD format "297"
. Which isdag-json
. I already tried to load this format to IPLD by specifying it in config when starting ipfs node, but it has a different interface as others formats. So I ends with error: