WIP: Add global option to specify the multibase encoding.#5289
WIP: Add global option to specify the multibase encoding.#5289
Conversation
License: MIT Signed-off-by: Kevin Atkinson <k@kevina.org>
7b8bc1c to
7208daf
Compare
Use it in 'ipfs add' and 'ipfs ls'. License: MIT Signed-off-by: Kevin Atkinson <k@kevina.org>
License: MIT Signed-off-by: Kevin Atkinson <k@kevina.org>
7208daf to
324d75a
Compare
Use it for "ipfs ls" and "ipfs resolve". Resolve also reconized the --cid-base option. License: MIT Signed-off-by: Kevin Atkinson <k@kevina.org>
License: MIT Signed-off-by: Kevin Atkinson <k@kevina.org>
License: MIT Signed-off-by: Kevin Atkinson <k@kevina.org>
License: MIT Signed-off-by: Kevin Atkinson <k@kevina.org>
|
This is blocked until #5349 is resolved. |
|
|
I'm in agreement with @Stebalien on these:
Agree no, should just be for output
If I ask for the CIDs to be output using The blockstore should be able to give me back the content anyway if I request something added with CIDv0 with a CIDv1 (as I see has happened in #5285) so it should be fine!? I can see how it would be unexpected to |
|
@alanshaw thanks for your feedback. I am going with your and @Stebalien suggestion for the |
Ah, ok, what problems are we talking about here? |
|
Closing in favor of #5464. |
Any CidV1 will have the same binary representation regardless of what multibase is used. The same can not be said for CidV0 vs CIDv1. A object with CidV0 links will have a different hash than an object with the same links but in CidV1. |
This adds a global option to specify the multibase encoding. It is global as any command that outputs CID's should eventually be taught to respect this flag.
Several questions:
(1) What should it be called. Just
--baseis to generic and will conflict with existing flags. Right now I am using--mbasebut perhaps--cid-baseis more obvious to the end user. Another option is--encodingbut that is also two generic.(2) Should this flag imply that new objects are added using CIDv1? That is should it imply
--cid-version=1for command that support it? I am on the fence for this one.(3) This is related to #5291. If we implement a flag to convert Cidv0 to CIDv1 for display, should this flag imply that. I would vote no.
Depends on ipfs/go-cid#60.
Closes #5233. Closes #5234. Towards https://github.com/ipfs/ipfs/issues/337.