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(manager): provide option to specify node ip #2130

Merged
merged 1 commit into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions node-launchpad/src/node_mgmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ async fn scale_down_nodes(config: &NodeConfig, count: u16) {
None,
None,
None,
None,
None, // We don't care about the port, as we are scaling down
config.owner.clone(),
config.peers_args.clone(),
Expand Down Expand Up @@ -366,6 +367,7 @@ async fn add_nodes(
None,
None,
None,
None,
port_range,
config.owner.clone(),
config.peers_args.clone(),
Expand Down
6 changes: 6 additions & 0 deletions sn_node_manager/src/add_services/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ pub struct InstallNodeServiceCtxBuilder {
pub log_format: Option<LogFormat>,
pub name: String,
pub metrics_port: Option<u16>,
pub node_ip: Option<Ipv4Addr>,
pub node_port: Option<u16>,
pub owner: Option<String>,
pub rpc_socket_addr: SocketAddr,
Expand Down Expand Up @@ -115,6 +116,10 @@ impl InstallNodeServiceCtxBuilder {
if self.upnp {
args.push(OsString::from("--upnp"));
}
if let Some(node_ip) = self.node_ip {
args.push(OsString::from("--ip"));
args.push(OsString::from(node_ip.to_string()));
}
if let Some(node_port) = self.node_port {
args.push(OsString::from("--port"));
args.push(OsString::from(node_port.to_string()));
Expand Down Expand Up @@ -166,6 +171,7 @@ pub struct AddNodeServiceOptions {
pub log_format: Option<LogFormat>,
pub metrics_port: Option<PortRange>,
pub owner: Option<String>,
pub node_ip: Option<Ipv4Addr>,
pub node_port: Option<PortRange>,
pub rpc_address: Option<Ipv4Addr>,
pub rpc_port: Option<PortRange>,
Expand Down
2 changes: 2 additions & 0 deletions sn_node_manager/src/add_services/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ pub async fn add_node(
log_format: options.log_format,
metrics_port: metrics_free_port,
name: service_name.clone(),
node_ip: options.node_ip,
node_port,
owner: options.owner.clone(),
rpc_socket_addr,
Expand Down Expand Up @@ -250,6 +251,7 @@ pub async fn add_node(
log_dir_path: service_log_dir_path.clone(),
log_format: options.log_format,
metrics_port: metrics_free_port,
node_ip: options.node_ip,
node_port,
number: node_number,
reward_balance: None,
Expand Down
Loading
Loading