Skip to content

Commit

Permalink
rusk: Call Node::Initialize
Browse files Browse the repository at this point in the history
  • Loading branch information
goshawk-3 committed Feb 22, 2024
1 parent ddbad2d commit f591441
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion rusk/src/bin/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
};

#[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)?;
Expand Down Expand Up @@ -154,6 +154,13 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
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 {
Expand Down

0 comments on commit f591441

Please sign in to comment.