jamt 0.1.22-rc.6

General CLI tool for interacting with JAM nodes
mod boot;
use boot::boot_main;

use std::process::ExitCode;
use tokio::{select, signal::ctrl_c};

async fn main_inner() -> ExitCode {
	match boot_main().await {
		Ok(()) => ExitCode::SUCCESS,
		Err(e) => {
			log::error!("Fatal error: {:?}", e);
			ExitCode::FAILURE
		},
	}
}

#[tokio::main]
async fn main() -> ExitCode {
	jam_tooling::log::setup_log(&jam_tooling::log::Config::default());
	select! {
		// ctrl_c() first so the signal handler gets registered before the network is created
		_ = ctrl_c() => {
			eprintln!("Ctrl-C received");
			ExitCode::SUCCESS
		}
		code = main_inner() => code,
	}
}