blockstream-electrs/examples/bench_index.rs

29 lines
726 B
Rust
Raw Normal View History

extern crate electrs;
extern crate error_chain;
2018-06-25 19:16:22 +00:00
#[macro_use]
extern crate log;
2018-06-26 19:54:47 +00:00
use electrs::{config::Config, daemon::Daemon, errors::*, fake::FakeStore, index::Index,
metrics::Metrics, signal::Waiter};
2018-06-09 15:22:30 +00:00
use error_chain::ChainedError;
fn run() -> Result<()> {
let signal = Waiter::new();
let config = Config::from_args();
let metrics = Metrics::new(config.monitoring_addr);
metrics.start();
2018-06-12 18:52:00 +00:00
let daemon = Daemon::new(config.network_type, &metrics)?;
let fake_store = FakeStore {};
let index = Index::load(&fake_store, &daemon, &metrics)?;
index.update(&fake_store, &signal)?;
Ok(())
}
fn main() {
if let Err(e) = run() {
2018-06-25 19:16:22 +00:00
error!("{}", e.display_chain());
}
}