Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(en): correct en config vars #1809

Merged
merged 4 commits into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions core/bin/external_node/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ 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<String>,
pub tree_api_remote_url: Option<String>,
}

#[derive(Debug, Clone, PartialEq, Deserialize)]
Expand Down Expand Up @@ -753,11 +753,11 @@ impl ExternalNodeConfig {
.from_env::<OptionalENConfig>()
.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::<ApiComponentConfig>()
.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::<TreeComponentConfig>()
.context("could not load external node config")?;

Expand Down Expand Up @@ -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 },
}
}
Expand Down
4 changes: 2 additions & 2 deletions core/bin/external_node/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
);
Expand All @@ -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<dyn TreeApiClient>),
};
Expand Down
Loading