From f59144168ff0d86c568002df279521ea8d7e32dc Mon Sep 17 00:00:00 2001 From: goshawk-3 Date: Thu, 22 Feb 2024 16:55:12 +0200 Subject: [PATCH] rusk: Call Node::Initialize --- rusk/src/bin/main.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 {