pub fn new(prometheus: Option<PrometheusExporterConfig>) -> anyhow::Result<Self> {
        // Consensus and secrets are read from files even with the env-based config.
        let mut consensus_sources = ConfigSources::default();
        if let Ok(path) = env::var("EN_CONSENSUS_CONFIG_PATH") {
            let yaml = ConfigFilePaths::read_yaml(path.as_ref())?;
            consensus_sources.push(Prefixed::new(yaml, "consensus"));
        }
        if let Ok(path) = env::var("EN_CONSENSUS_SECRETS_PATH") {
            let yaml = ConfigFilePaths::read_yaml(path.as_ref())?;
            consensus_sources.push(Prefixed::new(yaml, "secrets.consensus"));
        }

        // Consensus configs are loaded from files even with file-based config.
        let mut consensus_schema = ConfigSchema::new(&ConsensusConfig::DESCRIPTION, "consensus");
        consensus_schema
            .insert(&ConsensusSecrets::DESCRIPTION, "secrets.consensus")
            .context("cannot create consensus config schema")?;
        let mut repo =
            smart_config::ConfigRepository::new(&consensus_schema).with_all(consensus_sources);
        repo.deserializer_options().coerce_variant_names = true;
        let mut repo = ConfigRepository::from(repo);
        let consensus = repo.parse_opt()?;
        let consensus_secrets = repo.parse()?;

        Ok(Self {
            required: RequiredENConfig::from_env()?,
            postgres: PostgresConfig::from_env()?,
            optional: OptionalENConfig::from_env()?,
            prometheus,
            experimental: envy::prefixed("EN_EXPERIMENTAL_")
                .from_env::<ExperimentalENConfig>()
                .context("could not load external node config (experimental params)")?,
            consensus,
            api_component: envy::prefixed("EN_API_")
                .from_env::<ApiComponentConfig>()
                .context("could not load external node config (API component params)")?,
            tree_component: envy::prefixed("EN_TREE_")
                .from_env::<TreeComponentConfig>()
                .context("could not load external node config (tree component params)")?,
            consensus_secrets,
            data_availability: (
                da_client_config_from_env("EN_DA_").ok(),
                da_client_secrets_from_env("EN_DA_").ok(),
            ),
            consistency_checker: envy::prefixed("EN_CONSISTENCY_CHECKER_")
                .from_env::<ConsistencyCheckerConfig>()
                .context("could not load external node config (API component params)")?,
            config_params: None, // Since we don't capture most of params, exposing them would be misleading
            remote: (),
        })
    }
Parses the local part of node configuration from the environment.

**Important.** This method is blocking.
core/bin/external_node/src/config/mod.rs