mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-02-17 13:14:21 -05:00
Add kraken_ticker CLI for local testing of the client
This commit is contained in:
parent
60d6d50246
commit
7575d412b8
21
swap/src/bin/kraken_ticker.rs
Normal file
21
swap/src/bin/kraken_ticker.rs
Normal file
@ -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…
x
Reference in New Issue
Block a user