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

Adds offline key resolution on ipns mount. #2266

Closed
wants to merge 1 commit into from

Conversation

hackergrrl
Copy link
Contributor

Uses the local repo when an online public key resolution fails on mount.
This is particularly useful in tests or other young nodes where its
public key may not yet exist on the network.

License: MIT
Signed-off-by: Stephen Whitmore [email protected]

Uses the local repo when an online public key resolution fails on mount.
This is particularly useful in tests or other young nodes where its
public key may not yet exist on the network.

License: MIT
Signed-off-by: Stephen Whitmore <[email protected]>
@hackergrrl hackergrrl added the need/review Needs a review label Jan 29, 2016
@whyrusleeping
Copy link
Member

this mostly looks good to me... it just feels kinda weird to have a resolve fail, then try again a different way... @jbenet thoughts?

@rht
Copy link
Contributor

rht commented Jan 30, 2016

(~sacrificing C over P?)

@whyrusleeping
Copy link
Member

@rht yeah, exactly

@hackergrrl
Copy link
Contributor Author

This is one of a bunch of different ways we could handle this. I approached this from two UX angles:

  1. make mounting tests less flaky (since we create fresh nodes who aren't yet in the dht)
  2. make the offline (or just-ipfs initd) UX be less unpleasant

Some alternatives to this PR's approach for each:

  1. Require a --local flag to do this kind of local resolution. Lets tests work fine, but creates a divide between "test behaviour" and "production behaviour".
  2. Improve the error message and our tests instead to reflect the desire to have online-only mounting. Error messages should reflect that "you cannot mount because you are offline or your pubkey isn't in the dht yet", and our tests should make an explicit "publish" step.

@jbenet
Copy link
Member

jbenet commented Feb 2, 2016

I think the resolve here should return immediately correctly here. Since there is no network the lookup fails to find any other records beyond the node's own, and thus uses that one.

The solution here (using an offline routing system) is not the right one; we should be fixing the underlying problems in "why resolve is not returning our own record" as valid.

@hackergrrl
Copy link
Contributor Author

Agreed. I'm discussing now how we'll achieve this at the routing level in IRC (#ipfs). Closing this PR, since the fix isn't going to resemble this approach.

@radfish
Copy link

radfish commented Mar 4, 2019

For those landing here via a search: since 0.4.19 offline resolution is supported via --offline flag either to the resolve command or globally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need/review Needs a review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants