Dynamic port allocation for Bitcoin Knots
This feature has been largely requested by Knots users. I really think it should be added to Umbrel.
Hey @Retropex,
did you test what happens if a user installs Bitcoin Core afterwards?
From looking at the code this would probably end up in a failed install.
Waiting on @nmfretz to provide more input here.
Hey
did you test what happens if a user installs Bitcoin Core afterwards?
That's the only downside, it will fail. That's said the user just have to stop Knots to be able to install Core, Knots will take port 9333 upon restart.
Yeah we probably need some handling on the bitcoin core side as well to avoid it failing on install. But lets wait for what @nmfretz has to say.
Hey @nmfretz, would it be possible to have your input here? Thanks!
Hey @Retropex, thanks for the ping. And sorry for the delay in responding.
I really think it should be added to Umbrel.
Totally agree with you here. We're going to need to wait until we implement this at the OS level though unfortunately. We plan to implement this feature but we're currently working on some other high priority stuff at the moment (backups etc). In the future, it will look something like this:
Apps will request preferred ports and then umbrelOS can assign the ports if they are free, or fallback to other ports (e.g., port +1) if they are already in use. So apps will never have port conflicts and won't break each other on install. So Knots would just set 8332 and 8333 as it's preferred ports and the OS would handle any conflicts with clear info presented to the user.
Right now we'd have to hackily add lifecycle hooks to both Bitcoin Knots and Bitcoin Node apps to restart each other on install and it would be super brittle. We also wouldn't have a clear way to indicate to users what is happening.
Ok, thanks for the feedback!
Please let me know the day the feature is ready.
@Retropex will do! Do you want this PR reopened though? If so, please feel free to do so and we've tagged it as "pending umbrelOS feature" to track it.
🎉 Linting finished with no errors or warnings 🎉
Thank you for your submission! This is an automated linter that checks for common issues in pull requests to the Umbrel App Store.