-
Notifications
You must be signed in to change notification settings - Fork 9
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
small updates to README to get demo to work #21
base: main
Are you sure you want to change the base?
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 |
@@ -114,7 +114,7 @@ _A plain IPLD (without IPFS, for cases where you are managing the block store) v | |||
```js | |||
// 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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-format
toipld-format-to-blockcodec
to get it to work properlyChg
formats
tocodecs
as per docs