dynamit network test

* cleaned up fullnode api
* added debug_id to ReplicatedData and crdt for debugging
This commit is contained in:
Anatoly Yakovenko
2018-06-28 14:51:53 -07:00
committed by Greg Fitzgerald
parent 033f6dcbcb
commit 3a90f138b2
8 changed files with 496 additions and 303 deletions

View File

@@ -8,7 +8,7 @@ extern crate solana;
use atty::{is, Stream};
use getopts::Options;
use solana::crdt::{ReplicatedData, TestNode};
use solana::fullnode::FullNode;
use solana::fullnode::{FullNode, LedgerFile};
use std::env;
use std::fs::File;
use std::net::{IpAddr, Ipv4Addr, SocketAddr};
@@ -83,12 +83,23 @@ fn main() -> () {
let fullnode = if matches.opt_present("t") {
let testnet_address_string = matches.opt_str("t").unwrap();
let testnet_addr = testnet_address_string.parse().unwrap();
FullNode::new(node, false, None, Some(testnet_addr), None, exit)
FullNode::new(
node,
false,
LedgerFile::StdIn,
Some(testnet_addr),
LedgerFile::NoFile,
exit,
)
} else {
node.data.current_leader_id = node.data.id.clone();
let outfile = matches.opt_str("o");
FullNode::new(node, true, None, None, outfile, exit)
let outfile = if let Some(f) = matches.opt_str("o") {
LedgerFile::Path(f)
} else {
LedgerFile::StdIn
};
FullNode::new(node, true, LedgerFile::StdIn, None, outfile, exit)
};
for t in fullnode.thread_hdls {
t.join().expect("join");