1
0
mirror of https://github.com/romanz/electrs.git synced 2024-11-19 09:54:09 +01:00
electrs/examples/bench_index.rs
2018-06-27 00:28:50 +03:00

29 lines
726 B
Rust

extern crate electrs;
extern crate error_chain;
#[macro_use]
extern crate log;
use electrs::{config::Config, daemon::Daemon, errors::*, fake::FakeStore, index::Index,
metrics::Metrics, signal::Waiter};
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();
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() {
error!("{}", e.display_chain());
}
}