From 55904bfd366a7e2b55d8e1d3d0c70d9bfc781337 Mon Sep 17 00:00:00 2001 From: renancloudwalk Date: Sun, 2 Jun 2024 16:35:56 -0300 Subject: [PATCH] fix: send sync urls for standalone --- src/eth/consensus/mod.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/eth/consensus/mod.rs b/src/eth/consensus/mod.rs index 4d3b4eeac..85e8cb2a1 100644 --- a/src/eth/consensus/mod.rs +++ b/src/eth/consensus/mod.rs @@ -96,12 +96,12 @@ impl Consensus { pub async fn new(storage: Arc, importer_config: Option) -> Arc { if Self::is_stand_alone() { tracing::info!("No consensus module available, running in standalone mode"); - return Self::new_stand_alone(storage); + return Self::new_stand_alone(storage, importer_config); }; let leader_name = match importer_config.clone() { Some(config) => config.leader_node.unwrap_or_default(), - None => "standalone".to_string(), + None => "unknown".to_string(), }; tracing::info!(leader_name = leader_name, "Starting consensus module with leader"); @@ -129,7 +129,7 @@ impl Consensus { consensus } - fn new_stand_alone(storage: Arc) -> Arc { + fn new_stand_alone(storage: Arc, importer_config: Option) -> Arc { let (sender, mut receiver) = mpsc::channel::(32); tokio::spawn(async move { @@ -147,7 +147,7 @@ impl Consensus { sender, peers, last_arrived_block_number, - importer_config: None, + importer_config, }) } @@ -261,7 +261,7 @@ impl Consensus { pub fn get_chain_url(&self) -> Option<(String, Option)> { if self.is_follower() { if let Some(namespace) = Self::current_namespace() { - return Some((format!("http://{}.stratus-api.{}.svc.cluster.local:3000", self.leader_name, namespace), None)); + return Some((format!("http://{}.stratus-api.{}.svc.cluster.local:3000", self.leader_name, namespace), None)); //TODO use peer discovery to discover the leader } }