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

make it possible to change the codec with the ipfs cid subcommand #6817

Merged
merged 2 commits into from Jan 8, 2020

Conversation

Stebalien
Copy link
Member

This will be useful when testing refs local, repo gc, and repo verify` commands once we store blocks by multihash instead of by CID. At that point, these commands will return raw v1 CIDs as the blockstore won't actually remember the codec used to store the block.

Flags choice:

  • Ideally, we'd use the -f, --format flags like every other command but we're already using -f (format) for the format string.
  • Alternatively, I'd like to use -c. However, we're using that for a global --config flag (bit of a waste given that it doesn't work...).

--codec will have to do for now.

Note: this patch also fixes ipfs cid format -v 0 SOME_BASE32_CID by implicitly converting to base58 (likely what the user intended).

This will be useful when testing `refs local, `repo gc`, and `repo verify`
commands once we store blocks by multihash instead of by CID. At that point,
these commands will return raw v1 CIDs as the blockstore won't actually remember
the codec used to store the block.

Flags choice:

* Ideally, we'd use the `-f, --format` flags like every other command but we're
  already using `-f` (format) for the format string.
* Alternatively, I'd like to use `-c`. However, we're using _that_ for a global
  `--config` flag (bit of a waste given that it doesn't work...).

`--codec` will have to do for now.
Copy link
Contributor

@dirkmc dirkmc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@Stebalien Stebalien merged commit 7d2f39b into master Jan 8, 2020
@hacdias hacdias deleted the feat/cid-codec-convert branch May 9, 2023 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants