diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2025-10-20 23:05:54 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2025-10-20 23:05:54 +0800 |
| commit | ff590ac70e7a858a64d7a4835a22f6d94b31b886 (patch) | |
| tree | 393b93be66011f43083d9e789434416402ed95b1 /src/main.rs | |
init
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 16 |
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)); +} |
