diff --git a/bin/darkwiki/src/main.rs b/bin/darkwiki/src/main.rs index 2e0114dba..4b45d9e89 100644 --- a/bin/darkwiki/src/main.rs +++ b/bin/darkwiki/src/main.rs @@ -12,10 +12,15 @@ use darkfi::{ #[derive(Clone, Debug, StructOpt)] #[structopt(name = "darkwikiupdate")] struct Args { + #[structopt(long)] + /// Merge/Update without applying the changes + dry_run: bool, + #[structopt(long)] + /// Show all patches info + log: bool, #[structopt(short, parse(from_occurrences))] /// Increase verbosity (-vvv supported) verbose: u8, - #[structopt(short, long, default_value = "tcp://127.0.0.1:13055")] /// darkfid JSON-RPC endpoint endpoint: Url, @@ -31,8 +36,14 @@ async fn main() -> Result<()> { let rpc_client = RpcClient::new(args.endpoint).await?; - let req = JsonRequest::new("update", json!([])); - rpc_client.request(req).await?; + let req = if args.dry_run { + JsonRequest::new("dry_run", json!([])) + } else if args.log { + JsonRequest::new("log", json!([])) + } else { + JsonRequest::new("update", json!([])) + }; + rpc_client.request(req).await?; rpc_client.close().await } diff --git a/src/raft/consensus.rs b/src/raft/consensus.rs index d1d84fd57..59c4b9fa3 100644 --- a/src/raft/consensus.rs +++ b/src/raft/consensus.rs @@ -229,7 +229,7 @@ impl Raft { break } Role::Candidate => { - util::sleep(2).await; + util::sleep(1).await; } } }