Skip to content
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

ipfs id --offline <peerid> does not work offline #8481

Closed
3 tasks done
lidel opened this issue Oct 1, 2021 · 4 comments · Fixed by #8626
Closed
3 tasks done

ipfs id --offline <peerid> does not work offline #8481

lidel opened this issue Oct 1, 2021 · 4 comments · Fixed by #8626
Assignees
Labels
kind/bug A bug in existing code (including security flaws) P2 Medium: Good to have, but can wait until someone steps up topic/api Topic api

Comments

@lidel
Copy link
Member

lidel commented Oct 1, 2021

Checklist

Installation method

built from source

Version

0.10.0

Config

(default)

Description

ipfs id --peerid-base base36 --offline <peerid> does not work – it requires connection and hangs until one is established.

Rationale why this should be prioritized

We would like to have an easy way for converting peerids to a CIDv1 in arbitrary multibase.
Right now, there is no universal way that works for all peerid types and is easy to use.
Example: https://discuss.ipfs.io/t/command-line-to-transform-base58-peerid-to-subdomain-friendly-base36/12330/3?u=lidel

ipfs id --peerid-base base36 --offline $PEERID | jq --raw-output .ID nearly does the job, but it does not respect --offline flag and requires connection to the peer.

@lidel lidel added kind/bug A bug in existing code (including security flaws) topic/api Topic api P2 Medium: Good to have, but can wait until someone steps up labels Oct 1, 2021
@lidel lidel changed the title ipfs id --offline <peerid> does not work ipfs id --offline <peerid> does not work offline Oct 1, 2021
@schomatis schomatis self-assigned this Dec 23, 2021
@schomatis
Copy link
Contributor

Agreed with triage and working on this. It seems to me that if we only need encoding conversion this should live in an independent command maybe. Regardless, I'll implement it here and we can decouple it later if we want.

@schomatis
Copy link
Contributor

@lidel There is no --offline option in this command (not even in the form of documentation or a fixme, just an error message). My interpretation of it and please correct/complete if wrong is: do not attempt to connect to the peer (no matter if the daemon is running or not) and just print whatever information we have in the peer address book (which will likely be nothing except for the converted peer ID).

@schomatis
Copy link
Contributor

(Is the daemon's --offline option supposed to apply here? I'm getting a collision when adding a local --offline option so I'm assuming there is a global one up in the hierarchy which is the one referred in this issue.)

@schomatis
Copy link
Contributor

The global offline option is in:

https://github.com/ipfs/go-ipfs/blob/91c52657166bcf86f2476926e4fe56694dc26562/core/commands/root.go#L25

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws) P2 Medium: Good to have, but can wait until someone steps up topic/api Topic api
Projects
No open projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants