Browse Source
Remove logging from index benchmark
refactor-mempool
Roman Zeyde
7 years ago
No known key found for this signature in database
GPG Key ID: 87CAE5FA46917CBB
1 changed files with
3 additions and
10 deletions
-
src/bin/bench_index.rs
|
|
@ -1,18 +1,13 @@ |
|
|
|
extern crate electrs; |
|
|
|
|
|
|
|
extern crate error_chain; |
|
|
|
|
|
|
|
#[macro_use] |
|
|
|
extern crate log; |
|
|
|
|
|
|
|
use error_chain::ChainedError; |
|
|
|
|
|
|
|
use electrs::{config::Config, |
|
|
|
daemon::Daemon, |
|
|
|
errors::*, |
|
|
|
index::Index, |
|
|
|
store::{ReadStore, Row, WriteStore}, |
|
|
|
util::Bytes}; |
|
|
|
use error_chain::ChainedError; |
|
|
|
|
|
|
|
struct FakeStore; |
|
|
|
|
|
|
@ -32,16 +27,14 @@ impl WriteStore for FakeStore { |
|
|
|
fn run() -> Result<()> { |
|
|
|
let config = Config::from_args(); |
|
|
|
let daemon = Daemon::new(config.network_type)?; |
|
|
|
debug!("{:?}", daemon.getblockchaininfo()?); |
|
|
|
let fake_store = FakeStore {}; |
|
|
|
let index = Index::load(&fake_store); |
|
|
|
let tip = index.update(&fake_store, &daemon)?; |
|
|
|
info!("downloaded and indexed till {}", tip); |
|
|
|
index.update(&fake_store, &daemon)?; |
|
|
|
Ok(()) |
|
|
|
} |
|
|
|
|
|
|
|
fn main() { |
|
|
|
if let Err(e) = run() { |
|
|
|
error!("{}", e.display_chain()); |
|
|
|
eprintln!("{}", e.display_chain()); |
|
|
|
} |
|
|
|
} |
|
|
|