Skip to content

Commit 0840f2c

Browse files
committed
updated to call from command line, now need to do something about peer store root output
1 parent f5b0316 commit 0840f2c

File tree

4 files changed

+23
-2
lines changed

4 files changed

+23
-2
lines changed

src/bin/grin.rs

+14
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,20 @@ fn real_main() -> i32 {
202202
}
203203
}
204204

205+
// seedcheck command
206+
("seedcheck", Some(seedcheck_args)) => {
207+
let is_testnet = seedcheck_args.is_present("testnet");
208+
let results = tools::check_seeds(is_testnet);
209+
println!(
210+
"Generating seed check report, testnet={}. (This make take a few minutes)",
211+
is_testnet
212+
);
213+
for result in results {
214+
println!("{}", serde_json::to_string_pretty(&result).unwrap());
215+
}
216+
0
217+
}
218+
205219
// If nothing is specified, try to just use the config file instead
206220
// this could possibly become the way to configure most things
207221
// with most command line options being phased out

src/bin/grin.yml

+7
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,10 @@ subcommands:
9292
- hash:
9393
help: The header hash to invalidate
9494
required: true
95+
- seedcheck:
96+
about: Check the health of seed nodes
97+
args:
98+
- testnet:
99+
help: Run seed check against Testnet (as opposed to Mainnet)
100+
long: testnet
101+
takes_value: false

src/bin/tools/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@
1414

1515
/// Grin tools
1616
mod seedcheck;
17+
18+
pub use seedcheck::check_seeds;

src/bin/tools/seedcheck.rs

-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ use std::time::Duration;
2525

2626
use thiserror::Error;
2727

28-
use chrono::*;
29-
3028
#[derive(Error, Debug)]
3129
pub enum SeedCheckError {
3230
#[error("Seed Connect Error {0}")]

0 commit comments

Comments
 (0)