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

Tool that converts CIDv0 to CIDv1 #17

Closed
flyingzumwalt opened this issue Feb 7, 2017 · 4 comments
Closed

Tool that converts CIDv0 to CIDv1 #17

flyingzumwalt opened this issue Feb 7, 2017 · 4 comments
Assignees
Labels

Comments

@flyingzumwalt
Copy link
Contributor

flyingzumwalt commented Feb 7, 2017

This relates to the discussion of origin domains in #6

@flyingzumwalt
Copy link
Contributor Author

If you're trying to get a CIDv0 and the node has a CIDv1 the node will not be happy.

@whyrusleeping
Copy link
Member

The issue is that right now, requesting a protobuf object with cidv1 doesnt fetch an object from disk that was stored as a cidv0. I can add in a translation layer that checks cidV0 when certain formats of cidV1s are encountered.

@ghost
Copy link

ghost commented Mar 28, 2017

Has there been progress on this?

@ghost ghost added the developers label Apr 18, 2017
@daviddias daviddias added the status/ready Ready to be worked label Dec 13, 2017
@lidel
Copy link
Member

lidel commented Nov 5, 2018

Both js-ipfs >= v0.33.0 and go-ipfs >= v0.4.18 support ipfs cid subcommand :

# cidv0(b58) → cidv1(b32)
$ ipfs cid base32 QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR
bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi

# cidv1(b58) → cidv1(b32)
$ ipfs cid base32 zb2rhk6GMPQF3hfzwXTaNYFLKomMeC6UXdUt6jZKPpeVirLtV
bafkreigh2akiscaildcqabsyg3dfr6chu3fgpregiymsck7e7aqa4s52zy

There is also a standalone js-cid-tool for converting, formatting and discovering properties of CIDs.

go-ipfs >= v0.4.18 ships with:

A hack to allow locally looking up blocks associated with a CIDv0 CID using the equivalent CIDv1 CID (or the reverse). This hack will eventually be replaced with a multihash indexed blockstore, which is agnostic to both the CID version and multicodec content type.
Release Notes for go-ipfs v0.4.18

js-ipfs will be able to do the same in near future – tracked in ipfs/js-ipfs#1440

@lidel lidel closed this as completed Nov 5, 2018
@ghost ghost removed the status/ready Ready to be worked label Nov 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants