-
Notifications
You must be signed in to change notification settings - Fork 57
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: provide --upnp
flag for add
command
#1710
Conversation
The `--upnp` flag that is available on the node is now also available on the node manager `add` command. The flag only applies to a node that was built with the `upnp` feature. Rather than also using the feature in the node manager, the command is documented to specify that it should only be used with a `safenode` binary that has the feature. So for now, this option will probably be used in conjunction with `--path`, to provide a node that has been built with `upnp` enabled.
The following options that can be specified when the service is created are now retained on an upgrade: * Custom `--node-port` value * Custom `--metrics-port` value * The `--home-network` flag * The `--upnp` flag Tests were added for all of these, and in addition, a test was added for the retention of custom RPC ports, though these were already being retained on upgrade. Although the node port was being tracked as part of the `listen_addr` field in `NodeServiceData`, a new `node_port` field was explicitly added, because it's possible that a service can be upgraded before it starts, and the `listen_addr` is not assigned until the service starts. I also discovered the `add` command did not prevent specifying custom ports that were already in use. That was fixed too, and some tests were added.
eq(ServiceInstallCtx { | ||
args: vec![ | ||
OsString::from("--rpc"), | ||
OsString::from("127.0.0.1:20000"), |
Check notice
Code scanning / devskim
Accessing localhost could indicate debug code, or could hinder scaling. Note test
eq(ServiceInstallCtx { | ||
args: vec![ | ||
OsString::from("--rpc"), | ||
OsString::from("127.0.0.1:8081"), |
Check notice
Code scanning / devskim
Accessing localhost could indicate debug code, or could hinder scaling. Note
eq(ServiceInstallCtx { | ||
args: vec![ | ||
OsString::from("--rpc"), | ||
OsString::from("127.0.0.1:8081"), |
Check notice
Code scanning / devskim
Accessing localhost could indicate debug code, or could hinder scaling. Note
eq(ServiceInstallCtx { | ||
args: vec![ | ||
OsString::from("--rpc"), | ||
OsString::from("127.0.0.1:8081"), |
Check notice
Code scanning / devskim
Accessing localhost could indicate debug code, or could hinder scaling. Note
eq(ServiceInstallCtx { | ||
args: vec![ | ||
OsString::from("--rpc"), | ||
OsString::from("127.0.0.1:8081"), |
Check notice
Code scanning / devskim
Accessing localhost could indicate debug code, or could hinder scaling. Note
8af5fa4 feat: provide
--upnp
flag foradd
commandThe
--upnp
flag that is available on the node is now also available on the node manageradd
command.
The flag only applies to a node that was built with the
upnp
feature. Rather than also using thefeature in the node manager, the command is documented to specify that it should only be used with
a
safenode
binary that has the feature. So for now, this option will probably be used inconjunction with
--path
, to provide a node that has been built withupnp
enabled.4c2ce73 fix: retain options on upgrade and prevent dup ports
The following options that can be specified when the service is created are now retained on an
upgrade:
--node-port
value--metrics-port
value--home-network
flag--upnp
flagTests were added for all of these, and in addition, a test was added for the retention of custom RPC
ports, though these were already being retained on upgrade.
Although the node port was being tracked as part of the
listen_addr
field inNodeServiceData
, anew
node_port
field was explicitly added, because it's possible that a service can be upgradedbefore it starts, and the
listen_addr
is not assigned until the service starts.I also discovered the
add
command did not prevent specifying custom ports that were already inuse. That was fixed too, and some tests were added.
Description
reviewpad:summary