Skip to content

Commit 684b5e7

Browse files
committed
metrics fix: it is "enable" to enable not "enabled".
1 parent 96dbda1 commit 684b5e7

File tree

1 file changed

+12
-6
lines changed
  • crates/ethcore/src/engines/hbbft/hbbft_config_generator/src

1 file changed

+12
-6
lines changed

crates/ethcore/src/engines/hbbft/hbbft_config_generator/src/main.rs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ impl ToString for Enode {
4646
fn to_string(&self) -> String {
4747
// Example:
4848
// enode://30ccdeb8c31972f570e4eea0673cd08cbe7cefc5de1d70119b39c63b1cba33b48e494e9916c0d1eab7d296774f3573da46025d1accdef2f3690bc9e6659a34b4@192.168.0.101:30300
49-
let port = 30300usize + self.idx;
49+
let port = 31300usize + self.idx;
5050
format!("enode://{:x}@{}:{}", self.public, self.ip, port)
5151
}
5252
}
@@ -112,9 +112,9 @@ fn to_toml(
112112
base_metrics_port: Option<u16>,
113113
metrics_interface: Option<&str>,
114114
) -> Value {
115-
let base_port = 30300i64;
116-
let base_rpc_port = 8540i64;
117-
let base_ws_port = 9540i64;
115+
let base_port = 31300i64;
116+
let base_rpc_port = 18540i64;
117+
let base_ws_port = 19540i64;
118118

119119
let mut parity = Map::new();
120120
match config_type {
@@ -263,6 +263,10 @@ fn to_toml(
263263

264264
let port = (port_base as usize) + i;
265265

266+
metrics.insert("enable".into(), Value::Boolean(true));
267+
268+
metrics.insert("port".into(), Value::Integer(port as i64));
269+
266270
// metrics.insert("interface".into(), Value::String("local".into()));
267271
// Metrics:
268272
// --metrics
@@ -354,7 +358,7 @@ fn main() {
354358
)
355359
.arg(
356360
Arg::with_name("metrics_port_base")
357-
.long("metrics_port")
361+
.long("metrics_port_base")
358362
.help("activates prometheus metrics. The port is the base port, the node index is added to it.")
359363
.required(false)
360364
.takes_value(true),
@@ -388,13 +392,15 @@ fn main() {
388392
)
389393
});
390394

391-
let metrics_port_base: Option<u16> = matches.value_of("metrics_port").map_or(None, |v| {
395+
let metrics_port_base: Option<u16> = matches.value_of("metrics_port_base").map_or(None, |v| {
392396
Some(
393397
v.parse::<u16>()
394398
.expect("metrics_port need to be an integer port definition 1-65555"),
395399
)
396400
});
397401

402+
std::println!("metrics_port_base: {:?}", metrics_port_base);
403+
398404
let metrics_interface = matches.value_of("metrics_interface");
399405

400406
assert!(

0 commit comments

Comments
 (0)