use clap::Parser;
use hotshot::helpers::initialize_logging;
use hotshot_example_types::{node_types::TestVersions, state_types::TestTypes};
use hotshot_orchestrator::client::ValidatorArgs;
use local_ip_address::local_ip;
use tracing::{debug, instrument};
use crate::types::{Network, NodeImpl, ThisRun};
pub mod types;
#[path = "../infra/mod.rs"]
pub mod infra;
#[tokio::main]
#[instrument]
async fn main() {
initialize_logging();
let mut args = ValidatorArgs::parse();
let local_ip = local_ip().expect("failed to get local IP");
args.advertise_address = Some(args.advertise_address.unwrap_or(format!("{local_ip}:8000")));
debug!("connecting to orchestrator at {:?}", args.url);
infra::main_entry_point::<TestTypes, Network, NodeImpl, TestVersions, ThisRun>(args).await;
}