2025-12-01 12:48:39 +01:00
|
|
|
use nomos_node::{
|
2026-01-26 08:26:15 +01:00
|
|
|
Config as NodeConfig, RocksBackendSettings, config::deployment::DeploymentSettings,
|
2025-12-01 12:48:39 +01:00
|
|
|
};
|
|
|
|
|
use nomos_sdp::SdpSettings;
|
|
|
|
|
|
|
|
|
|
use crate::{
|
2025-12-09 06:30:18 +01:00
|
|
|
nodes::{
|
|
|
|
|
blend::build_blend_service_config,
|
2025-12-09 09:43:49 +01:00
|
|
|
common::{
|
2026-01-25 10:11:16 +02:00
|
|
|
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-01 12:48:39 +01:00
|
|
|
},
|
2025-12-09 09:43:49 +01:00
|
|
|
topology::configs::GeneralConfig,
|
2025-12-01 12:48:39 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#[must_use]
|
2026-01-26 08:26:15 +01:00
|
|
|
pub fn create_node_config(config: GeneralConfig) -> NodeConfig {
|
2025-12-09 06:30:18 +01:00
|
|
|
let network_config = config.network_config.clone();
|
2025-12-06 10:17:06 +01:00
|
|
|
let (blend_user_config, blend_deployment, network_deployment) =
|
|
|
|
|
build_blend_service_config(&config.blend_config);
|
2025-12-19 00:50:20 +01:00
|
|
|
|
|
|
|
|
let deployment_settings =
|
2026-01-26 08:26:15 +01:00
|
|
|
build_node_deployment_settings(&config, blend_deployment, network_deployment);
|
2025-12-19 00:50:20 +01:00
|
|
|
|
2026-01-26 08:26:15 +01:00
|
|
|
NodeConfig {
|
2025-12-09 06:30:18 +01:00
|
|
|
network: network_config,
|
2025-12-01 12:48:39 +01:00
|
|
|
blend: blend_user_config,
|
|
|
|
|
deployment: deployment_settings,
|
2025-12-09 06:30:18 +01:00
|
|
|
cryptarchia: cryptarchia_config(&config),
|
2025-12-09 09:43:49 +01:00
|
|
|
tracing: tracing_settings(&config),
|
|
|
|
|
http: http_config(&config),
|
2025-12-19 00:50:20 +01:00
|
|
|
storage: rocks_storage_settings(),
|
2025-12-09 09:43:49 +01:00
|
|
|
time: time_config(&config),
|
|
|
|
|
mempool: mempool_config(),
|
2025-12-01 12:48:39 +01:00
|
|
|
sdp: SdpSettings { declaration: None },
|
2025-12-09 09:43:49 +01:00
|
|
|
testing_http: testing_http_config(&config),
|
|
|
|
|
wallet: wallet_settings(&config),
|
2025-12-09 10:18:36 +01:00
|
|
|
key_management: config.kms_config.clone(),
|
2025-12-01 12:48:39 +01:00
|
|
|
}
|
|
|
|
|
}
|
2025-12-19 00:50:20 +01:00
|
|
|
|
2026-01-26 08:26:15 +01:00
|
|
|
fn build_node_deployment_settings(
|
2025-12-19 00:50:20 +01:00
|
|
|
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()),
|
|
|
|
|
}
|
|
|
|
|
}
|