add flag to "ipfs key gen" to output keys in b36/CIDv1, also make it …#7531
add flag to "ipfs key gen" to output keys in b36/CIDv1, also make it …#7531aschmahmann merged 7 commits intomasterfrom
Conversation
core/commands/keystore.go
Outdated
| Options: []cmds.Option{ | ||
| cmds.StringOption(keyStoreTypeOptionName, "t", "type of the key to create: rsa, ed25519").WithDefault("rsa"), | ||
| cmds.IntOption(keyStoreSizeOptionName, "s", "size of the key to generate"), | ||
| cmds.BoolOption(cidOptionName, "c", "return a base-36 CIDv1 encoding of the key").WithDefault(true), |
There was a problem hiding this comment.
Given that we're planning on using b36 as the default the documentation and style of this flag doesn't really make much sense. i.e. what does it mean if "return a base-36 CIDv1 encoding of the key" is false, how is it encoded?
We could do the opposite sort of flag (e.g. "--b58Mh"), but that leaves us slightly exposed in the event we ever want to change the default going forward (hopefully not for a long time 🤞). WDYT?
There was a problem hiding this comment.
I think, there should be explicit flags for every supported variant, because it sounds like the default may flip-flop. So how about a flag with mutually-exclusive variants: --format b58mh | b36cid?
There was a problem hiding this comment.
I think that seems reasonable. If someone wants anything else they can pass the b36cid into the ipfs cid function. I'm not sure whether the cid option should be called b36cid or just cid, with a comment saying it's currently b36, both seem fine so your call.
There was a problem hiding this comment.
I like b58mh and b36cid, because they have the same schema.
…default