summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
new file mode 100644
index 0000000..096b533
--- /dev/null
+++ b/src/main.rs
@@ -0,0 +1,16 @@
+use std::{sync::Arc, thread::sleep, time::Duration};
+
+use bitcoin::{blocks::BlockChain, network::Network};
+use tokio::sync::Mutex;
+
+#[tokio::main]
+async fn main() {
+ let bc = Arc::new(Mutex::new(BlockChain::default()));
+ let network = Network::new(bc).await;
+ network
+ .lock()
+ .await
+ .broadcast(bitcoin::network::Request::Ibd(None))
+ .await;
+ sleep(Duration::from_secs(100));
+}