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

RFC: New sub-command ipfs cid-util #5357

Closed
kevina opened this issue Aug 9, 2018 · 2 comments
Closed

RFC: New sub-command ipfs cid-util #5357

kevina opened this issue Aug 9, 2018 · 2 comments
Assignees
Labels
topic/cidv1b32 Topic cidv1b32

Comments

@kevina
Copy link
Contributor

kevina commented Aug 9, 2018

I propose we create a new sub-command to aid in working with Cids. I propose the following sub-commands under it:

  • ipfs cid-util format - format a Cid in various useful ways
    • -f <string>: format string from cid-fmt utility
    • -v 0|1: cid version
    • -b <multibase code>
  • ipfs cid-util base32 - shortcut for ipfs cid-util format -v 1 -b base32 ... to aid in our translation to making base32 CIDv1 the default
  • ipfs cid-util encoding - list available multibase encoding
    • --prefixes - also include the single leter prefixes in addition to the code
    • --numeric - also include the numeric code (ascii value of prefix)
  • ipfs cid-util codecs - list available CID codecs
    • --numeric - also include the numeric code
  • ipfs cid-util hashes - list valid multihash codes (excludes insecure hashes)
    • --numeric - also include the numeric code

This could be a separate command, however I think it is more convenient as a sub-command. For one thing the ipfs binary is guaranteed to be available while extra utilities might not be installed. In addition the encoding, codecs and hashes will be guaranteed to correspond to what is support by go ipfs. If they are in a separate command this is not guaranteed.

Thoughts?

Closes #5229.

@kevina kevina added the topic/cidv1b32 Topic cidv1b32 label Aug 9, 2018
@Stebalien
Copy link
Member

I'm not really a fan of this solution but I see your point. I'd rather have a separate program but we have to support legacy operating systems without package managers.


Maybe just ipfs cid?

@kevina
Copy link
Contributor Author

kevina commented Aug 9, 2018

Maybe just ipfs cid?

Yeah now that I think about it that would be better.

@ghost ghost assigned kevina Aug 15, 2018
@ghost ghost added the status/in-progress In progress label Aug 15, 2018
@ghost ghost removed the status/in-progress In progress label Oct 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic/cidv1b32 Topic cidv1b32
Projects
None yet
Development

No branches or pull requests

2 participants