diff --git a/examples/bench_parse.rs b/examples/bench_parse.rs index 5796eda..d132542 100644 --- a/examples/bench_parse.rs +++ b/examples/bench_parse.rs @@ -6,11 +6,11 @@ extern crate log; #[macro_use] extern crate error_chain; -use electrs::{config::Config, +use electrs::{bulk::Parser, + config::Config, daemon::Daemon, errors::*, metrics::Metrics, - parse::Parser, signal::Waiter, store::{DBStore, StoreOptions, WriteStore}}; diff --git a/src/parse.rs b/src/bulk.rs similarity index 96% rename from src/parse.rs rename to src/bulk.rs index d7d0769..88db681 100644 --- a/src/parse.rs +++ b/src/bulk.rs @@ -55,7 +55,7 @@ impl Parser { }) } - pub fn index_blocks(&mut self, blocks: &[Block]) -> Vec> { + fn index_blocks(&mut self, blocks: &[Block]) -> Vec> { let mut rows = vec![]; for block in blocks { let blockhash = block.bitcoin_hash(); @@ -76,6 +76,8 @@ impl Parser { } pub fn start(mut self) -> Receiver>>> { + info!("indexing {} blk*.dat files", self.files.len()); + debug!("{} blocks are already indexed", self.indexed_blockhashes.len()); let chan = SyncChannel::new(1); let tx = chan.sender(); let parser = parse_files(self.files.split_off(0), self.duration.clone(), self.magic); diff --git a/src/lib.rs b/src/lib.rs index 5666cf5..a62edf2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -30,6 +30,7 @@ extern crate serde_derive; extern crate serde_json; pub mod app; +pub mod bulk; pub mod config; pub mod daemon; pub mod errors; @@ -37,7 +38,6 @@ pub mod fake; pub mod index; pub mod mempool; pub mod metrics; -pub mod parse; pub mod query; pub mod rpc; pub mod signal;