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

Should use base32 as default in the "ipfs add -q --only-hash" command #7852

Closed
danimesq opened this issue Jan 7, 2021 · 8 comments
Closed
Labels
kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization

Comments

@danimesq
Copy link

danimesq commented Jan 7, 2021

Instead, its outdated and still using CIDv0.

@danimesq danimesq added kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization labels Jan 7, 2021
@danimesq
Copy link
Author

danimesq commented Jan 7, 2021

@Stebalien

@aschmahmann
Copy link
Contributor

This isn't a bug and is covered in the issue for the migration from CIDv0 to (b32) CIDv1 #5358.

@danimesq
Copy link
Author

danimesq commented Jan 9, 2021

@aschmahmann what is the workaround to get the base32 hash of an file?

@danimesq
Copy link
Author

danimesq commented Jan 12, 2021

Conclusion:

Ok, the pipelines command to get the CIDv1 of an file is: ipfs add -q --only-hash <file.extension> | ipfs cid base32

via: #5358 (comment)

@danimesq
Copy link
Author

@aschmahmann when this workaround will be implemented in the ipfs add -q --only-hash command?

As newer applications should support CIDv1, some commands should be updated to default into it.

@danimesq
Copy link
Author

@lidel, will this command be updated to use CIDv1 by default?

@lidel
Copy link
Member

lidel commented Jan 14, 2021

@DaniellMesquita you can opt-in to using CIDv1 at the time of file import by passing: ipfs add --cid-version 1

Note that defaulting to CIDv1 via --cid-version 1 implies --raw-leaves=true, which will produce different DAG than --raw-leaves=true, which is the default for CIDv0. We are still trying to find good time to make the switch, ideally will group all changes of the defaults like this into a single release.

For now, just pass --cid-version 1, it will save you the conversion step.

@danimesq
Copy link
Author

@lidel, So, its ipfs add -q --cid-version 1 --only-hash?

Is it bad to produce an different merkletree/DAG? Then, how to keep compatibility?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization
Projects
None yet
Development

No branches or pull requests

3 participants