blockstream-electrs/examples/listener.rs

16 lines
289 B
Rust
Raw Normal View History

2018-08-15 07:32:13 +00:00
extern crate electrs;
#[macro_use]
extern crate log;
2018-08-15 07:32:13 +00:00
use electrs::config::Config;
use electrs::notify;
2018-08-15 07:32:13 +00:00
fn main() {
let _ = Config::from_args();
let rx = notify::run().into_receiver();
for blockhash in rx.iter() {
2018-08-15 14:09:53 +00:00
info!("block {}", blockhash.be_hex_string())
}
2018-08-15 07:32:13 +00:00
}