parent
c78132417f
commit
77c9e801aa
|
@ -132,7 +132,7 @@ Now that your singlenode or multinode testnet is up and running, in a separate s
|
|||
the JSON configuration file here, not the genesis ledger.
|
||||
|
||||
```bash
|
||||
$ ./multinode-demo/client.sh ubuntu@10.0.1.51:~/solana #The leader machine
|
||||
$ ./multinode-demo/client.sh ubuntu@10.0.1.51:~/solana 2 #The leader machine and the total number of nodes in the network
|
||||
```
|
||||
|
||||
What just happened? The client demo spins up several threads to send 500,000 transactions
|
||||
|
|
|
@ -1,11 +1,15 @@
|
|||
#!/bin/bash -e
|
||||
|
||||
if [[ -z "$1" ]]; then
|
||||
echo "usage: $0 [network path to solana repo on leader machine]"
|
||||
echo "usage: $0 [network path to solana repo on leader machine] [number of nodes in the network if greater then 1]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
LEADER="$1"
|
||||
COUNT="$2"
|
||||
if [[ -z "$2" ]]; then
|
||||
COUNT=1
|
||||
fi
|
||||
|
||||
set -x
|
||||
export RUST_LOG=solana=info
|
||||
|
@ -13,4 +17,4 @@ rsync -v -e ssh "$LEADER/leader.json" .
|
|||
rsync -v -e ssh "$LEADER/mint-demo.json" .
|
||||
|
||||
cargo run --release --bin solana-client-demo -- \
|
||||
-l leader.json < mint-demo.json 2>&1 | tee client.log
|
||||
-l leader.json -n $COUNT -d < mint-demo.json 2>&1 | tee client.log
|
||||
|
|
|
@ -109,9 +109,10 @@ fn main() {
|
|||
&client_addr,
|
||||
&leader,
|
||||
signal.clone(),
|
||||
num_nodes + 2,
|
||||
num_nodes,
|
||||
&mut c_threads,
|
||||
);
|
||||
assert_eq!(validators.len(), num_nodes);
|
||||
|
||||
if stdin_isatty() {
|
||||
eprintln!("nothing found on stdin, expected a json file");
|
||||
|
@ -296,16 +297,9 @@ fn converge(
|
|||
gossip_send_socket,
|
||||
exit.clone(),
|
||||
).expect("DataReplicator::new");
|
||||
//wait for the network to converge
|
||||
let mut rv = vec![];
|
||||
//wait for the network to converge, 30 seconds should be plenty
|
||||
for _ in 0..30 {
|
||||
let min = spy_ref.read().unwrap().convergence();
|
||||
if num_nodes as u64 == min {
|
||||
println!("converged!");
|
||||
break;
|
||||
}
|
||||
sleep(Duration::new(1, 0));
|
||||
}
|
||||
threads.extend(data_replicator.thread_hdls.into_iter());
|
||||
let v: Vec<ReplicatedData> = spy_ref
|
||||
.read()
|
||||
.unwrap()
|
||||
|
@ -313,9 +307,17 @@ fn converge(
|
|||
.values()
|
||||
.into_iter()
|
||||
.filter(|x| x.requests_addr != daddr)
|
||||
.map(|x| x.clone())
|
||||
.cloned()
|
||||
.collect();
|
||||
v.clone()
|
||||
if v.len() >= num_nodes {
|
||||
println!("CONVERGED!");
|
||||
rv.extend(v.into_iter());
|
||||
break;
|
||||
}
|
||||
sleep(Duration::new(1, 0));
|
||||
}
|
||||
threads.extend(data_replicator.thread_hdls.into_iter());
|
||||
rv
|
||||
}
|
||||
|
||||
fn read_leader(path: String) -> ReplicatedData {
|
||||
|
|
Loading…
Reference in New Issue