mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2024-09-12 12:42:16 +00:00
![Tobin C. Harding](/assets/img/avatar_default.png)
Add a binary crate `swap` that implements two nodes (Alice and Bob). With this applied we can start up a node for each role and do: - Bob: Requests current amounts using BTC is input - Alice: Responds with amounts - Bob: (mock) get user input to Ok the amounts ... continue with swap (TODO)
19 lines
379 B
Rust
19 lines
379 B
Rust
use futures::prelude::*;
|
|
use libp2p::core::Executor;
|
|
use std::pin::Pin;
|
|
use tokio::runtime::Handle;
|
|
|
|
pub mod peer_tracker;
|
|
pub mod request_response;
|
|
pub mod transport;
|
|
|
|
pub struct TokioExecutor {
|
|
pub handle: Handle,
|
|
}
|
|
|
|
impl Executor for TokioExecutor {
|
|
fn exec(&self, future: Pin<Box<dyn Future<Output = ()> + Send>>) {
|
|
let _ = self.handle.spawn(future);
|
|
}
|
|
}
|