Skip to content

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

@kevina

Description

@kevina

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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions