Add kraken_ticker CLI for local testing of the client

pull/287/head
Thomas Eizinger 4 years ago
parent 60d6d50246
commit 7575d412b8
No known key found for this signature in database
GPG Key ID: 651AC83A6C6C8B96

@ -0,0 +1,21 @@
use anyhow::{Context, Result};
#[tokio::main]
async fn main() -> Result<()> {
tracing::subscriber::set_global_default(
tracing_subscriber::fmt().with_env_filter("trace").finish(),
)?;
let mut ticker = swap::kraken::connect()
.await
.context("Failed to connect to kraken")?;
loop {
ticker.changed().await?;
match &*ticker.borrow() {
Ok(rate) => println!("Rate update: {}", rate),
Err(e) => println!("Error: {:#}", e),
}
}
}
Loading…
Cancel
Save