umbrel-apps icon indicating copy to clipboard operation
umbrel-apps copied to clipboard

Dynamic port allocation for Bitcoin Knots

Open Retropex opened this issue 5 months ago • 8 comments

This feature has been largely requested by Knots users. I really think it should be added to Umbrel.

Retropex avatar Aug 06 '25 15:08 Retropex

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.

al-lac avatar Aug 08 '25 10:08 al-lac

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.

Retropex avatar Aug 08 '25 10:08 Retropex

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.

al-lac avatar Aug 08 '25 10:08 al-lac

Hey @nmfretz, would it be possible to have your input here? Thanks!

Retropex avatar Aug 19 '25 08:08 Retropex

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.

nmfretz avatar Aug 25 '25 00:08 nmfretz

Ok, thanks for the feedback!

Please let me know the day the feature is ready.

Retropex avatar Aug 25 '25 09:08 Retropex

@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.

nmfretz avatar Aug 26 '25 00:08 nmfretz

🎉   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.

github-actions[bot] avatar Aug 26 '25 07:08 github-actions[bot]