-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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-base
option for specifying the multibase. It also provides a--upgrade-cidv0
--output-cidv1
option to upgrade CidV0 to CidV1 for display. Specifying--cid-base
enables--upgrade-cidv0
--output-cidv1
by default.Unlike the last attempt, this does most of the conversion client side. The exception to the rule is that as
Path
s 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-base
is 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-base
yet. 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.