use anyhow::Result;
use clap::Parser;
use communitas::CommuniasApp;
#[derive(Debug, Parser)]
#[command(name = "communitas")]
#[command(about = "P2P Diagnostic Chat Application", long_about = None)]
struct Args {
#[arg(short, long, default_value = "/ip6/::1/tcp/9000")]
bootstrap: String,
}
#[tokio::main]
async fn main() -> Result<()> {
tracing_subscriber::fmt()
.with_env_filter("communitas=debug,saorsa_core=info")
.init();
let args = Args::parse();
tracing::info!("Starting Communitas...");
tracing::info!("Bootstrap node: {}", args.bootstrap);
let app = CommuniasApp::new(args.bootstrap).await?;
app.connect().await?;
let health = app.get_network_health().await;
tracing::info!("Network health: {:?}", health);
tracing::info!("Note: GUI will be implemented in Task 2 with Tauri v2");
tokio::time::sleep(tokio::time::Duration::from_secs(3)).await;
tracing::info!("Shutting down...");
Ok(())
}