summaryrefslogtreecommitdiff
path: root/src/main.rs
blob: 0c257256f6d3d90612f4b65254b9f26a58560e32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use std::{sync::Arc, 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
        .start();
    network
        .lock()
        .await
        .broadcast(bitcoin::network::Request::Ibd(None))
        .await;
    tokio::time::sleep(Duration::from_secs(100)).await;
}