1#![warn(missing_docs)]
2use std::sync::Arc;
12
13use fedimint_core::fedimint_build_code_version_env;
14use fedimint_core::util::handle_version_hash_command;
15use fedimint_gateway_server::Gateway;
16use fedimint_logging::TracingSetup;
17#[cfg(not(target_env = "msvc"))]
18use tikv_jemallocator::Jemalloc;
19use tracing::info;
20
21#[cfg(not(target_env = "msvc"))]
22#[global_allocator]
23static GLOBAL: Jemalloc = Jemalloc;
25
26fn main() -> Result<(), anyhow::Error> {
27 let runtime = Arc::new(tokio::runtime::Runtime::new()?);
28 runtime.block_on(async {
29 handle_version_hash_command(fedimint_build_code_version_env!());
30 TracingSetup::default().init()?;
31 let gatewayd = Gateway::new_with_default_modules().await?;
32 let shutdown_receiver = gatewayd.clone().run(runtime.clone()).await?;
33 shutdown_receiver.await;
34 gatewayd.unannounce_from_all_federations().await;
35 info!("Gatewayd exiting...");
36 Ok(())
37 })
38}