Add -c option to easily interrogate the number of nodes

This commit is contained in:
Michael Vines 2018-07-19 09:21:31 -07:00
parent fece91c4d1
commit a67f58e9a5
2 changed files with 12 additions and 2 deletions

View File

@ -16,6 +16,7 @@ if [[ -z $leader ]]; then
fi
fi
count=${2:-1}
shift 2
rsync_leader_url=$(rsync_url "$leader")
@ -30,4 +31,4 @@ $solana_client_demo \
-n "$count" \
-l "$SOLANA_CONFIG_CLIENT_DIR"/leader.json \
-k "$SOLANA_CONFIG_CLIENT_DIR"/client.json \
"$@"

View File

@ -195,6 +195,11 @@ fn main() {
.takes_value(true)
.help("send transactions for this many seconds"),
)
.arg(
Arg::with_name("converge_only")
.short("c")
.help("exit immediately after converging"),
)
.get_matches();
let leader: NodeInfo;
@ -225,9 +230,13 @@ fn main() {
let signal = Arc::new(AtomicBool::new(false));
let mut c_threads = vec![];
let validators = converge(&leader, &signal, num_nodes, &mut c_threads);
println!("Network has {} node(s)", validators.len());
println!("Nodes: {}", validators.len());
assert!(validators.len() >= num_nodes);
if matches.is_present("converge_only") {
return;
}
let mut client = mk_client(&leader);
let starting_balance = client.poll_get_balance(&id.pubkey()).unwrap();