65 lines
2.0 KiB
Rust
Raw Normal View History

use nomos_node::{
2026-01-26 08:26:15 +01:00
Config as NodeConfig, RocksBackendSettings, config::deployment::DeploymentSettings,
};
use nomos_sdp::SdpSettings;
use crate::{
nodes::{
blend::build_blend_service_config,
2025-12-09 09:43:49 +01:00
common::{
cryptarchia_config, cryptarchia_deployment, http_config, mempool_config,
mempool_deployment, testing_http_config, time_config, time_deployment,
tracing_settings, wallet_settings,
2025-12-09 09:43:49 +01:00
},
},
2025-12-09 09:43:49 +01:00
topology::configs::GeneralConfig,
};
#[must_use]
2026-01-26 08:26:15 +01:00
pub fn create_node_config(config: GeneralConfig) -> NodeConfig {
let network_config = config.network_config.clone();
let (blend_user_config, blend_deployment, network_deployment) =
build_blend_service_config(&config.blend_config);
let deployment_settings =
2026-01-26 08:26:15 +01:00
build_node_deployment_settings(&config, blend_deployment, network_deployment);
2026-01-26 08:26:15 +01:00
NodeConfig {
network: network_config,
blend: blend_user_config,
deployment: deployment_settings,
cryptarchia: cryptarchia_config(&config),
2025-12-09 09:43:49 +01:00
tracing: tracing_settings(&config),
http: http_config(&config),
storage: rocks_storage_settings(),
2025-12-09 09:43:49 +01:00
time: time_config(&config),
mempool: mempool_config(),
sdp: SdpSettings { declaration: None },
2025-12-09 09:43:49 +01:00
testing_http: testing_http_config(&config),
wallet: wallet_settings(&config),
key_management: config.kms_config.clone(),
}
}
2026-01-26 08:26:15 +01:00
fn build_node_deployment_settings(
config: &GeneralConfig,
blend_deployment: nomos_node::config::blend::deployment::Settings,
network_deployment: nomos_node::config::network::deployment::Settings,
) -> DeploymentSettings {
DeploymentSettings::new_custom(
blend_deployment,
network_deployment,
cryptarchia_deployment(config),
time_deployment(config),
mempool_deployment(),
)
}
fn rocks_storage_settings() -> RocksBackendSettings {
RocksBackendSettings {
db_path: "./db".into(),
read_only: false,
column_family: Some("blocks".into()),
}
}