()
| 113 | |
| 114 | #[tokio::main] |
| 115 | async fn main() -> Result<()> { |
| 116 | color_eyre::install()?; |
| 117 | |
| 118 | // Remember to register all your metrics before starting the process |
| 119 | MY_CUSTOM_REGISTRY.register(Box::new(SIG_RECEIVED_COUNTER.clone()))?; |
| 120 | // Spin up a server that exposes the /metrics endpoint to Prometheus |
| 121 | |
| 122 | match load_commit_module_config::<ExtraConfig>() { |
| 123 | Ok(config) => { |
| 124 | let _guard = initialize_tracing_log(&config.id, LogsSettings::from_env_config()?); |
| 125 | |
| 126 | MetricsProvider::load_and_run(config.chain, MY_CUSTOM_REGISTRY.clone())?; |
| 127 | |
| 128 | info!( |
| 129 | module_id = %config.id, |
| 130 | sleep_secs = config.extra.sleep_secs, |
| 131 | "Starting module with custom data" |
| 132 | ); |
| 133 | |
| 134 | let mut service = DaCommitService { config }; |
| 135 | |
| 136 | if let Err(err) = service.run().await { |
| 137 | error!(%err, "Service failed"); |
| 138 | } |
| 139 | } |
| 140 | Err(err) => { |
| 141 | eprintln!("Failed to load module config: {err:?}"); |
| 142 | } |
| 143 | } |
| 144 | Ok(()) |
| 145 | } |
nothing calls this directly
no test coverage detected