2026-02-09 10:28:15 +02:00
|
|
|
use lb_core::mantle::Value;
|
|
|
|
|
use lb_key_management_system_service::keys::secured_key::SecuredKey as _;
|
|
|
|
|
use lb_node::{
|
2026-01-29 09:33:25 +02:00
|
|
|
RocksBackendSettings, UserConfig,
|
|
|
|
|
config::{RunConfig, deployment::DeploymentSettings},
|
2025-12-01 12:48:39 +01:00
|
|
|
};
|
2026-02-09 10:28:15 +02:00
|
|
|
use lb_sdp_service::{SdpSettings, wallet::SdpWalletConfig};
|
2025-12-01 12:48:39 +01:00
|
|
|
|
|
|
|
|
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-29 09:33:25 +02:00
|
|
|
pub fn create_node_config(config: GeneralConfig) -> RunConfig {
|
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-29 09:33:25 +02:00
|
|
|
let user_settings = UserConfig {
|
2025-12-09 06:30:18 +01:00
|
|
|
network: network_config,
|
2025-12-01 12:48:39 +01:00
|
|
|
blend: blend_user_config,
|
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(),
|
2026-01-29 09:33:25 +02:00
|
|
|
sdp: SdpSettings {
|
|
|
|
|
declaration: None,
|
|
|
|
|
wallet_config: SdpWalletConfig {
|
|
|
|
|
max_tx_fee: Value::MAX,
|
|
|
|
|
funding_pk: config.consensus_config.funding_sk.as_public_key(),
|
|
|
|
|
},
|
|
|
|
|
},
|
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(),
|
2026-01-29 09:33:25 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
RunConfig {
|
|
|
|
|
deployment: deployment_settings,
|
|
|
|
|
user: user_settings,
|
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,
|
2026-02-09 10:28:15 +02:00
|
|
|
blend_deployment: lb_node::config::blend::deployment::Settings,
|
|
|
|
|
network_deployment: lb_node::config::network::deployment::Settings,
|
2025-12-19 00:50:20 +01:00
|
|
|
) -> DeploymentSettings {
|
2026-01-29 09:33:25 +02:00
|
|
|
DeploymentSettings {
|
|
|
|
|
blend: blend_deployment,
|
|
|
|
|
network: network_deployment,
|
|
|
|
|
cryptarchia: cryptarchia_deployment(config),
|
|
|
|
|
time: time_deployment(config),
|
|
|
|
|
mempool: mempool_deployment(),
|
|
|
|
|
}
|
2025-12-19 00:50:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn rocks_storage_settings() -> RocksBackendSettings {
|
|
|
|
|
RocksBackendSettings {
|
|
|
|
|
db_path: "./db".into(),
|
|
|
|
|
read_only: false,
|
|
|
|
|
column_family: Some("blocks".into()),
|
|
|
|
|
}
|
|
|
|
|
}
|