#![recursion_limit = "256"]
use std::time::Duration;
use anyhow::Result;
use node_builder::{DEFAULT_BATCH_INTERVAL, DEFAULT_BLOCK_INTERVAL, NodeBuilder};
#[tokio::main]
async fn main() -> Result<()> {
let data_dir = tempfile::Builder::new().tempdir()?.keep();
let node = NodeBuilder::new(data_dir)
.with_block_interval(Duration::from_millis(DEFAULT_BLOCK_INTERVAL))
.with_batch_interval(Duration::from_millis(DEFAULT_BATCH_INTERVAL));
let handle = node.start().await?;
println!("Node started at {}", handle.rpc_url);
tokio::time::sleep(Duration::from_secs(10)).await;
handle.stop().await?;
println!("Node stopped");
Ok(())
}