Skip to content

Commit

Permalink
feat(manager): provide option to start metrics server using random ports
Browse files Browse the repository at this point in the history
  • Loading branch information
RolandSherwin committed Jun 3, 2024
1 parent 7ee168f commit 43bbf38
Show file tree
Hide file tree
Showing 5 changed files with 146 additions and 436 deletions.
1 change: 1 addition & 0 deletions sn_node_manager/src/add_services/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ pub struct AddNodeServiceOptions {
pub bootstrap_peers: Vec<Multiaddr>,
pub count: Option<u16>,
pub delete_safenode_src: bool,
pub enable_metrics_server: bool,
pub env_variables: Option<Vec<(String, String)>>,
pub genesis: bool,
pub home_network: bool,
Expand Down
4 changes: 3 additions & 1 deletion sn_node_manager/src/add_services/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,10 @@ pub async fn add_node(
};
let metrics_free_port = if let Some(port) = metrics_port {
Some(port)
} else {
} else if options.enable_metrics_server {
Some(service_control.get_available_port()?)
} else {
None
};

let rpc_socket_addr = if let Some(addr) = options.rpc_address {
Expand Down
Loading

0 comments on commit 43bbf38

Please sign in to comment.