use blockchain::args;
use blockchain::watcher::Watcher;
use clap::Parser;

// // src/main.rs
// use jemallocator::Jemalloc;
//
// #[global_allocator]
// static GLOBAL: Jemalloc = Jemalloc;

#[tokio::main]
async fn main() -> Result<(), std::io::Error> {
  let args = args::CliArgs::parse();

  let mut watcher = Watcher::build()
    .addr(args.addr)
    .seed(args.seed)
    .debug(args.debug)
    .render(args.render)
    .bootstrap(args.bootstrap)
    .start()
    .await;

  watcher.run().await?;

  println!("Hello, world!");

  Ok(())
}
