MCPcopy Index your code
hub / github.com/Commit-Boost/commit-boost-client / main

Function main

examples/da_commit/src/main.rs:115–145  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

113
114#[tokio::main]
115async 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}

Callers

nothing calls this directly

Calls 2

initialize_tracing_logFunction · 0.85
runMethod · 0.45

Tested by

no test coverage detected