From 66ca1e066dac9baf06ba21d6b4775afc29827dfd Mon Sep 17 00:00:00 2001 From: Fedor Sakharov Date: Fri, 26 Apr 2024 14:51:12 +0200 Subject: [PATCH 1/4] correct en config vars --- core/bin/external_node/src/config/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/bin/external_node/src/config/mod.rs b/core/bin/external_node/src/config/mod.rs index bc6763661aa6..89ae8c4a8727 100644 --- a/core/bin/external_node/src/config/mod.rs +++ b/core/bin/external_node/src/config/mod.rs @@ -753,11 +753,11 @@ impl ExternalNodeConfig { .from_env::() .context("could not load external node config")?; - let api_component_config = envy::prefixed("EN_API") + let api_component_config = envy::prefixed("EN_API_") .from_env::() .context("could not load external node config")?; - let tree_component_config = envy::prefixed("EN_TREE") + let tree_component_config = envy::prefixed("EN_TREE_") .from_env::() .context("could not load external node config")?; From c6cc8ca7338e0d1559cde0f911769db489fa87ea Mon Sep 17 00:00:00 2001 From: Fedor Sakharov Date: Fri, 26 Apr 2024 14:54:43 +0200 Subject: [PATCH 2/4] rename more --- core/bin/external_node/src/config/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/bin/external_node/src/config/mod.rs b/core/bin/external_node/src/config/mod.rs index 89ae8c4a8727..df8dc7dd87e8 100644 --- a/core/bin/external_node/src/config/mod.rs +++ b/core/bin/external_node/src/config/mod.rs @@ -388,12 +388,12 @@ pub struct ApiComponentConfig { /// Address of the tree API used by this EN in case it does not have a /// local tree component running and in this case needs to send requests /// to some external tree API. - pub tree_api_url: Option, + pub tree_api_remote_url: Option, } #[derive(Debug, Clone, PartialEq, Deserialize)] pub struct TreeComponentConfig { - pub api_port: Option, + pub local_port: Option, } impl OptionalENConfig { From 0e620716f1bf6a5f9254f9854254b9f622971e1a Mon Sep 17 00:00:00 2001 From: Fedor Sakharov Date: Fri, 26 Apr 2024 14:57:08 +0200 Subject: [PATCH 3/4] rename back --- core/bin/external_node/src/config/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/bin/external_node/src/config/mod.rs b/core/bin/external_node/src/config/mod.rs index df8dc7dd87e8..ff7644abb974 100644 --- a/core/bin/external_node/src/config/mod.rs +++ b/core/bin/external_node/src/config/mod.rs @@ -393,7 +393,7 @@ pub struct ApiComponentConfig { #[derive(Debug, Clone, PartialEq, Deserialize)] pub struct TreeComponentConfig { - pub local_port: Option, + pub api_port: Option, } impl OptionalENConfig { From fa3188c806ca37eb0bd75ebf0cee1bceefb8b33a Mon Sep 17 00:00:00 2001 From: Fedor Sakharov Date: Fri, 26 Apr 2024 15:07:38 +0200 Subject: [PATCH 4/4] fix after rename --- core/bin/external_node/src/config/mod.rs | 4 +++- core/bin/external_node/src/main.rs | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/core/bin/external_node/src/config/mod.rs b/core/bin/external_node/src/config/mod.rs index ff7644abb974..ae077b6bbe22 100644 --- a/core/bin/external_node/src/config/mod.rs +++ b/core/bin/external_node/src/config/mod.rs @@ -825,7 +825,9 @@ impl ExternalNodeConfig { optional: OptionalENConfig::mock(), remote: RemoteENConfig::mock(), consensus: None, - api_component: ApiComponentConfig { tree_api_url: None }, + api_component: ApiComponentConfig { + tree_api_remote_url: None, + }, tree_component: TreeComponentConfig { api_port: None }, } } diff --git a/core/bin/external_node/src/main.rs b/core/bin/external_node/src/main.rs index 63be52168821..e17c3b40c398 100644 --- a/core/bin/external_node/src/main.rs +++ b/core/bin/external_node/src/main.rs @@ -396,7 +396,7 @@ async fn run_api( ) -> anyhow::Result<()> { let tree_reader = match tree_reader { Some(tree_reader) => { - if let Some(url) = &config.api_component.tree_api_url { + if let Some(url) = &config.api_component.tree_api_remote_url { tracing::warn!( "Tree component is run locally; the specified tree API URL {url} is ignored" ); @@ -405,7 +405,7 @@ async fn run_api( } None => config .api_component - .tree_api_url + .tree_api_remote_url .as_ref() .map(|url| Arc::new(TreeApiHttpClient::new(url)) as Arc), };