polar
polar copied to clipboard
feat: add custom baseport for nodes
This commit implements the feature that lets users set custom base ports for their nodes to avoid having port conflicts with other applications running on the same machine.
Closes #533
Description
I added a settings page with input fields to set the base ports and then save. The custom base ports persist in the settings.json file and are loaded whenever polar starts. If a node, for example, LND does not have a custom port set, the defaults from constant.ts are used
Steps to Test
- On the top navbar, locate the
Network Settingtab and click on it. - The settings page appears, fill in the custom ports and click on save.
- Create a network and check the ports of your nodes
Screenshots
Node Alice
Node Bob
Hey @Abdulkbk Thanks for opening the PR. It looks like you're off to a great start.
My initial feedback just from looking at your screenshots is:
- I think we should add some text in the Base Ports section explaining what these values are, because it isn't obvious to users what these are and why/when you should change them. I would suggest the following text.
Base Ports determine the starting port numbers that will be used for each node. When a network is started, Polar will use these values to detect the next open port on your machine to assign to the nodes. You usually do not need to change these unless you are running into port conflicts with other apps installed on your computer. If you change these values, try to maintain at decent size gap (roughly 100) between them to prevent them from overlapping as more nodes of each implementation are added to your networks.
- The base port for Taproot Assets is missing
- We should also allow changing the base ports for GRPC as well for the nodes that support it
Hey @Abdulkbk Thanks for opening the PR. It looks like you're off to a great start.
My initial feedback just from looking at your screenshots is:
- I think we should add some text in the Base Ports section explaining what these values are, because it isn't obvious to users what these are and why/when you should change them. I would suggest the following text.
Base Ports determine the starting port numbers that will be used for each node. When a network is started, Polar will use these values to detect the next open port on your machine to assign to the nodes. You usually do not need to change these unless you are running into port conflicts with other apps installed on your computer. If you change these values, try to maintain at decent size gap (roughly 100) between them to prevent them from overlapping as more nodes of each implementation are added to your networks.
- The base port for Taproot Assets is missing
- We should also allow changing the base ports for GRPC as well for the nodes that support it
Thanks for the feedback @jamaljsr. I'll work on the suggestions in next iteration.
This is how it looks now @jamaljsr
The UI is looking great now. I left some feedback on the code. Once those changes are made, we just need to have the unit tests updated to prevent the failures and get the coverage back up. Then this should be all set to merge.
@jamaljsr I added a new commit addressing the feedbacks you left.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 100.00%. Comparing base (
8edfccb) to head (fc749e2).
Additional details and impacted files
@@ Coverage Diff @@
## master #878 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 140 141 +1
Lines 4582 4609 +27
Branches 887 861 -26
=========================================
+ Hits 4582 4609 +27
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Hey @Abdulkbk I want to get this merged. Instead of going back and forth for longer, I just added an extra commit with some minor code formatting changes. I also rebased this on master.
Thank you for implementing this feature 🚀