diff --git a/rusk/src/bin/main.rs b/rusk/src/bin/main.rs index 442781d94c..53200724da 100644 --- a/rusk/src/bin/main.rs +++ b/rusk/src/bin/main.rs @@ -95,7 +95,7 @@ async fn main() -> Result<(), Box> { }; #[cfg(feature = "node")] - let (rusk, node, service_list) = { + let (rusk, node, mut service_list) = { let state_dir = rusk_profile::get_rusk_state_dir()?; info!("Using state from {state_dir:?}"); let rusk = Rusk::new(state_dir)?; @@ -154,6 +154,13 @@ async fn main() -> Result<(), Box> { Some(HttpServer::bind(handler, listen_addr, cert_and_key).await?); } + #[cfg(feature = "node")] + // initialize all registered services + if let Err(err) = node.0.initialize(&mut service_list).await { + tracing::error!("node initialization failed: {}", err); + return Err(err.into()); + } + #[cfg(feature = "node")] // node spawn_all is the entry point if let Err(e) = node.0.spawn_all(service_list).await {