Add global option to specify the multibase encoding.#5464
Add global option to specify the multibase encoding.#5464
Conversation
675738c to
de63fbc
Compare
de63fbc to
b50f7a7
Compare
|
@Stebalien this is still a WIP but I have something I want to double check on: Is it really okay to set a global variable when translating the Cid client side. It does make things easier but I want be 100% sure the client code (in
|
f7d408d to
6f145f2
Compare
|
This depends on ipfs/go-cidutil#8 and ipfs/go-mfs#5 This should be ready for initial review. I added support for as many commands as I could: |
|
@kevina could you explain what the use case is for |
|
@kevina does this PR also allow |
caea23f to
8c4460c
Compare
I am not sure The idea is that when a user uses |
|
@kevina does this PR also allow ?cid-base to be passed to the equivalent HTTP API routes? It allows it, but the JSON output of the request will remain unchanged except in the cases I marked as |
|
Could you add some comments (especially godoc comments)? |
Yeah that would be a good idea. :) I work on that tomorrow. I am also unhappy with the choice of |
c6690dd to
9a795e4
Compare
Also add tests for both `files ls -l` and `files stat`. 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>
License: MIT Signed-off-by: Kevin Atkinson <k@kevina.org>
ead12ce to
0a4fb1f
Compare
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>
|
@Stebalien rebased and documentation added. |
djdv
left a comment
There was a problem hiding this comment.
Mostly just pedantic text changes.
I'm curious if 1 case can be simplified, but I may be understanding things wrong.
I'll likely put together a patch that can be cherry-picked if desired for documentation changes.
There are some that I have not highlighted, mostly just comma additions.
As for the code itself, it seems sensible to me. No strong opinions on anything at the moment.
License: MIT Signed-off-by: Kevin Atkinson <k@kevina.org>
License: MIT Signed-off-by: Kevin Atkinson <k@kevina.org>
|
This needs to be redone, but is also blocked now on the switch to the new commands library of the affected commands. |
|
@Stebalien it's not blocking it's conflicting, so it just makes more work for me. |
|
Redoing this P.R., see #5777. With the massive switch to the new command line API it is easier to just redo this p.r. then try to rebase it. The interface for reading the |
|
@kevina should I be expecting to see base32 CIDs in the output here: |
Yes. |
This p.r. is being redone (again) please see #5777 and #5789
This is a redo of #5289. It depends on ipfs/go-cidutil#8 and ipfs/go-mfs#5
It adds a
--cid-baseoption for specifying the multibase. It also provides a--upgrade-cidv0--output-cidv1option to upgrade CidV0 to CidV1 for display. Specifying--cid-baseenables--upgrade-cidv0--output-cidv1by default.Unlike the last attempt, this does most of the conversion client side. The exception to the rule is that as
Paths are meant to be strings the server creates new paths with the correct base when a CID is part of the path.When a use provides a hash on the command line, this p.r. attempts to preserve that string when returning information on the same hash unless
--cid-baseis used. For example inipfs pin.The multibase of a CID, is now preserved in
ipfs resolve. Other commands will need to be reviewed on a case by case basis.Not every command honers--cid-baseyet. The implementation details may still change and a large part of the helper code will likely get moved togo-cidutil.Closes #5233. Closes #5234. Closes #5349.