-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Orchestration for starting ipfs daemon without port conflicts #7709
Comments
On a related note would it be reasonable to change the default ports? Port collisions seem unnecessarily common due to the current choice of fairly popular ports. I know I've run into collisions locally. |
See #874. |
It might be worth while to add a config option to randomly select available ports at launch instead of requiring application of the "randomports" profile for each port change. Edit: Something like this:
|
There are two sets of ports:
|
@lidel I'm very wary about modifying the config this way. The config is something that should generally be managed by the user. What about exiting with a special code indicating the port conflict? That would let the caller decide how it wants to handle the issue (e.g., by modifying the config). That would also allow the application to tell the user "hey, you appear to have something else running on your IPFS gateway port, try on port XYZ?". |
Why not add a |
We can do that, but that doesn't solve the problem here about picking a _stable_ port. The goal isn't to pick a random port, it's to pick a new port if and only if the normal port doesn't work.
|
Perhaps port 8008 as a gateway port alternative. It's a less common http server port, and most of its use cases in software are heavily dated, according to wikipedia. |
I was wondering if this is still an issue since brave/brave-browser#10220 was closed and the brave browser released the native support 🥳 Regardless of what the brave support needs, I think IPFS should change the default port - which is still 8080 as far as I can tell :) In #874 we have had two ideas how to "encode" the characters of IPFS into a port number and got 4737 from @jbenet and 6437 from @ruverav - see #874 (comment). |
@lidel I assume we found some way to work around this? |
@lidel : is this an issue still, or can this be closed? |
Requirements
Native support in Brave (brave/brave-browser#10220) requires a way of starting daemon without worrying about user having the default ports taken.
Specific needs are:
$IPFS_PATH/config
should be the source of truth about Swarm, API and Gateway portsNote that setting ports to
0
is not feasible:Gateway
port, produces different port every time, and it is hard to read randomly-picked ports without capturing stout ofipfs daemon
Proposed implementation
Add a parameter
ipfs daemon --update-ports-if-taken
(or
--find-free-ports
? suggestions? 🚲 🏚️ )This new parameter should enable additional checks before
ipfs daemon
starts:$IPFS_PATH/config
are free before starting (Swarm
,API
,Gateway
)+1
and retry until all are free$IPFS_PATH/config
ipfs daemon
cc @autonome @aschmahmann
The text was updated successfully, but these errors were encountered: