Skip to content

Commit 7b9e53e

Browse files
Merge #2118
2118: Add config to client get_status dislay. r=AureliaDolo a=AureliaDolo Fix #2071 Co-authored-by: Aurelia <[email protected]>
2 parents a67cea7 + b0f3772 commit 7b9e53e

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-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: 37 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,38 @@ 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+
writeln!(
67+
f,
68+
" Proof of stake lookback cycles: {}",
69+
self.pos_lookback_cycles
70+
)?;
71+
writeln!(
72+
f,
73+
" Proof of stake lock cycles: {}",
74+
self.pos_lock_cycles
75+
)?;
76+
writeln!(f, " Block reward: {}", self.block_reward)?;
77+
writeln!(f, " Periods per cycle: {}", self.periods_per_cycle)?;
78+
Ok(())
79+
}
80+
}

0 commit comments

Comments
 (0)