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

feat: add custom baseport for nodes #878

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Abdulkbk
Copy link

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

  1. On the top navbar, locate the Network Setting tab and click on it.
  2. The settings page appears, fill in the custom ports and click on save.
  3. Create a network and check the ports of your nodes

Screenshots

Screenshot from 2024-04-23 18-07-58

Screenshot from 2024-04-23 18-09-15

Node Alice
Screenshot from 2024-04-23 18-10-45

Node Bob
Screenshot from 2024-04-23 18-11-05

This commit implement the feature that let users set custom
baseport for their nodes to avoid having port conflicts with other
applications running on the same machine.
@jamaljsr
Copy link
Owner

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:

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

  2. The base port for Taproot Assets is missing
  3. We should also allow changing the base ports for GRPC as well for the nodes that support it

@Abdulkbk
Copy link
Author

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:

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

  2. The base port for Taproot Assets is missing
  3. 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.

In this commit, we allow the user to set grpc base ports for nodes
that support it in addition to setting rest base ports.
@Abdulkbk
Copy link
Author

Abdulkbk commented May 4, 2024

This is how it looks now @jamaljsr

Screenshot from 2024-05-04 02-41-44

Copy link
Owner

@jamaljsr jamaljsr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

src/shared/types.ts Outdated Show resolved Hide resolved
src/shared/types.ts Outdated Show resolved Hide resolved
src/utils/network.ts Outdated Show resolved Hide resolved
src/store/models/app.ts Outdated Show resolved Hide resolved
src/components/common/NavMenu.tsx Outdated Show resolved Hide resolved
In this commit, we refactor/move some types from shared folder to
the main types. We also remove store import from utils file and
modified functions that need some values from store to accept them
as parameters
@Abdulkbk Abdulkbk marked this pull request as ready for review May 14, 2024 16:42
@Abdulkbk
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: Ability to set base ports
2 participants