Skip to content

Commit

Permalink
updated to call from command line, now need to do something about pee…
Browse files Browse the repository at this point in the history
…r store root output
  • Loading branch information
yeastplume committed Nov 21, 2024
1 parent f5b0316 commit 0840f2c
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
14 changes: 14 additions & 0 deletions src/bin/grin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,20 @@ fn real_main() -> i32 {
}
}

// seedcheck command
("seedcheck", Some(seedcheck_args)) => {
let is_testnet = seedcheck_args.is_present("testnet");
let results = tools::check_seeds(is_testnet);
println!(
"Generating seed check report, testnet={}. (This make take a few minutes)",
is_testnet
);
for result in results {
println!("{}", serde_json::to_string_pretty(&result).unwrap());
}
0
}

// If nothing is specified, try to just use the config file instead
// this could possibly become the way to configure most things
// with most command line options being phased out
Expand Down
7 changes: 7 additions & 0 deletions src/bin/grin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,10 @@ subcommands:
- hash:
help: The header hash to invalidate
required: true
- seedcheck:
about: Check the health of seed nodes
args:
- testnet:
help: Run seed check against Testnet (as opposed to Mainnet)
long: testnet
takes_value: false
2 changes: 2 additions & 0 deletions src/bin/tools/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@

/// Grin tools
mod seedcheck;

pub use seedcheck::check_seeds;
2 changes: 0 additions & 2 deletions src/bin/tools/seedcheck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ use std::time::Duration;

use thiserror::Error;

use chrono::*;

#[derive(Error, Debug)]
pub enum SeedCheckError {
#[error("Seed Connect Error {0}")]
Expand Down

0 comments on commit 0840f2c

Please sign in to comment.