Skip to content

Commit

Permalink
feat(manager): provide option to specify node ip
Browse files Browse the repository at this point in the history
  • Loading branch information
RolandSherwin authored and jacderida committed Sep 30, 2024
1 parent d8d196e commit bf0fb68
Show file tree
Hide file tree
Showing 10 changed files with 404 additions and 1 deletion.
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

0 comments on commit bf0fb68

Please sign in to comment.