Add max entry height to download for replicator

This commit is contained in:
Stephen Akridge
2018-09-24 14:10:51 -07:00
committed by sakridge
parent bb7ecc7cd9
commit a5b28349ed
5 changed files with 71 additions and 6 deletions

View File

@@ -14,8 +14,10 @@ use solana::signature::{Keypair, KeypairUtil};
use std::fs::File;
use std::net::{Ipv4Addr, SocketAddr};
use std::process::exit;
use std::sync::atomic::AtomicBool;
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::Arc;
use std::thread::sleep;
use std::time::Duration;
fn main() {
logger::setup();
@@ -75,6 +77,7 @@ fn main() {
println!("my node: {:?}", node);
let exit = Arc::new(AtomicBool::new(false));
let done = Arc::new(AtomicBool::new(false));
let network_addr = matches
.value_of("network")
@@ -83,7 +86,21 @@ fn main() {
// TODO: ask network what slice we should store
let entry_height = 0;
let replicator = Replicator::new(entry_height, &exit, ledger_path, node, network_addr);
let replicator = Replicator::new(
entry_height,
5,
&exit,
ledger_path,
node,
network_addr,
done.clone(),
);
while !done.load(Ordering::Relaxed) {
sleep(Duration::from_millis(100));
}
println!("Done downloading ledger");
replicator.join();
}