Skip to content

Commit d78b130

Browse files
committed
Add config to client get_status dislay.
1 parent 992573d commit d78b130

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

massa-models/src/api.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ impl std::fmt::Display for NodeStatus {
4040
writeln!(f)?;
4141

4242
writeln!(f, "Version: {}", self.version)?;
43+
writeln!(f, "Config:\n{}", self.config)?;
4344
writeln!(f)?;
4445

4546
writeln!(f, "Current time: {}", self.current_time.to_utc_string())?;

massa-models/src/settings.rs

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// Copyright (c) 2021 MASSA LABS <[email protected]>
22

3+
use std::fmt::Display;
4+
35
use crate::Amount;
46
use massa_hash::HASH_SIZE_BYTES;
57
use massa_time::MassaTime;
@@ -41,3 +43,42 @@ pub struct CompactConfig {
4143
pub block_reward: Amount,
4244
pub roll_price: Amount,
4345
}
46+
47+
impl Display for CompactConfig {
48+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
49+
writeln!(
50+
f,
51+
" Genesis timestamp: {}",
52+
self.genesis_timestamp.to_utc_string()
53+
)?;
54+
if let Some(end) = self.end_timestamp {
55+
writeln!(f, " End timestamp: {}", end.to_utc_string())?;
56+
}
57+
writeln!(f, " Thread count: {}", self.thread_count)?;
58+
writeln!(f, " t0: {}", self.t0)?;
59+
writeln!(f, " delta_f0: {}", self.delta_f0)?;
60+
writeln!(
61+
f,
62+
" Operation validity periods: {}",
63+
self.operation_validity_periods
64+
)?;
65+
writeln!(f, " Periods per cycle: {}", self.periods_per_cycle)?;
66+
67+
writeln!(
68+
f,
69+
" Proof of stake lookback cycles: {}",
70+
self.pos_lookback_cycles
71+
)?;
72+
73+
writeln!(
74+
f,
75+
" Proof of stake lock cycles: {}",
76+
self.pos_lock_cycles
77+
)?;
78+
79+
writeln!(f, " Block reward: {}", self.block_reward)?;
80+
81+
writeln!(f, " Periods per cycle: {}", self.periods_per_cycle)?;
82+
Ok(())
83+
}
84+
}

0 commit comments

Comments
 (0)