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 node selector #711

Closed
olizilla opened this issue Jul 6, 2018 · 2 comments
Closed

IPFS node selector #711

olizilla opened this issue Jul 6, 2018 · 2 comments
Assignees
Labels
kind/discussion Topical discussion; usually not changes to codebase

Comments

@olizilla
Copy link
Member

olizilla commented Jul 6, 2018

Right now we try window.ipfs and fallback to js-ipfs-api with the default config. If that fails to connect, we just retry until it does, without telling the user whats going on. This could be so much better.

When we're first run, if window.ipfs is available, we should let the user know that we're using it and that they are clearly wizards for having it installed. If not, we instantiate a js-ipfs-api (as we do now) on the default URL request the the node id with a short timeout. If we get no response, we should communicate with the user... we can ask if they just need to restart their local ipfs daemon, or provide a different API url if they're running with a customised config, or would they like to run an embedded js-ipfs node?

The "would you like to run a js-ipfs node" could be framed as "Hey, install ipfs-companion, and it'll run a js-ipfs node for you." which'd be great for ipfs-companion visibility... and could give us a bunch more users. On the flipside, it's out of band and adds a little friction when and we could just ask if they want us to install a js-ipfs node in a service worker at the click of a button. Either option would be rad. I'm leaning towards "hey why not install companion" as I think it's a big win to be visible in the browser.

@olizilla olizilla added revamp kind/discussion Topical discussion; usually not changes to codebase labels Jul 6, 2018
@olizilla olizilla changed the title IPFS Node connection selector IPFS node selector Jul 6, 2018
@lidel
Copy link
Member

lidel commented Jul 6, 2018

I lean towards keeping options simple for now.

We need to remember that regular user won't know what service worker is, and I don't think we should mention js-ipfs as a viable option until it has the same connectivity magic (dht, relay discovery) as go-ipfs. Due to this installing Companion alone does not solve the problem of missing node yet (IMO).

A safe way to communicate things today would be to do basic heuristic to find IPFS API[1], and if that fails, prompt user to "manually start local node at port :5001 or install IPFS Desktop".

We can refine this after poc integrations with go-ipfs and companion land.


  1. via old-school js-ipfs-api client and default port or by detecting it runs in privileged context such as WebExtension and getting API object directly, as noted in Privileged window.ipfs API access for WebUI ipfs-companion#514

@olizilla
Copy link
Member Author

We added the "Set your API address" feature in #715

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/discussion Topical discussion; usually not changes to codebase
Projects
None yet
Development

No branches or pull requests

3 participants