#![warn(missing_docs)]
use fedimint_core::fedimint_build_code_version_env;
use fedimint_core::task::TaskGroup;
use fedimint_core::util::handle_version_hash_command;
use fedimint_logging::TracingSetup;
use ln_gateway::Gateway;
use tracing::info;
#[tokio::main]
async fn main() -> Result<(), anyhow::Error> {
handle_version_hash_command(fedimint_build_code_version_env!());
TracingSetup::default().init()?;
let tg = TaskGroup::new();
tg.install_kill_handler();
let gatewayd = Gateway::new_with_default_modules().await?;
let shutdown_receiver = gatewayd.clone().run(tg).await?;
shutdown_receiver.await;
gatewayd.unannounce_from_all_federations().await;
info!("Gatewayd exiting...");
Ok(())
}