small updates to README to get demo to work#21
small updates to README to get demo to work#21DougAnderson444 wants to merge 2 commits intoceramicnetwork:mainfrom
Conversation
Cool library, just need some readme tweaks for those trying to follow along: Chg `blockcodec-to-ipld-format` to `ipld-format-to-blockcodec` Chg `formats` to `codecs`
|
I'm pretty sure this is not correct, you're converting it the wrong way. But I think what you're encountering is that the lastest js-ipfs now uses the new |
|
Thanks Rod! Yep, what you suggested totally works. Don't even need to load the codecs, looks like Multicodecs auto loads that for us? import * as dagJose from 'dag-jose';
let ipfs = await createIpfs();
const cid = await this.ipfs.dag.put(jwe, {
format: dagJose.codec,
hashAlg: 'sha2-256'
});I'll modify the PR to just remove that config code that doesn't work anymore. |
Changes based on Rod's conversation
|
Yeah, blockcodec-to-ipld-format and ipld-format-to-blockcodec were for bridging old and new codec formats, but we've since entirely deprecated the old codec formats, even in js-ipfs, and just use the new ones now which follow the js-multiformats |
| // IPLD & IPFS | ||
| import { create as createIpfs } from 'ipfs' | ||
| import { convert as toLegacyIpld } from 'blockcodec-to-ipld-format' | ||
| import { convert } from 'ipld-format-to-blockcodec'; |
There was a problem hiding this comment.
| import { convert } from 'ipld-format-to-blockcodec'; |
| When using DAG-JOSE (for JWE or JWS) with js-IPFS, you will need to convert it from a raw multiformats style codec to a legacy IPLD codec using [ipld-format-to-blockcodec](https://github.com/ipld/js-ipld-format-to-blockcodec). | ||
|
|
There was a problem hiding this comment.
| When using DAG-JOSE (for JWE or JWS) with js-IPFS, you will need to convert it from a raw multiformats style codec to a legacy IPLD codec using [ipld-format-to-blockcodec](https://github.com/ipld/js-ipld-format-to-blockcodec). |
|
Also note that even this change is going to be breaking soon thanks to a change in the DAG API in go-ipfs v0.10 where |
|
Perhaps it should wait until #3917 is merged then? My whole point with this note was to bring the README up to speed for anyone else looking at this so they can understand what's going on |
Cool library, just need some readme tweaks for those trying to follow along:
Chg
blockcodec-to-ipld-formattoipld-format-to-blockcodecto get it to work properlyChg
formatstocodecsas per docs