diff --git a/Cargo.lock b/Cargo.lock index 36511ac..dc89140 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1012,7 +1012,7 @@ dependencies = [ ] [[package]] -name = "cfgsync" +name = "cfgsync_tf" version = "0.1.0" dependencies = [ "anyhow", @@ -7312,7 +7312,7 @@ version = "0.1.0" dependencies = [ "anyhow", "async-trait", - "cfgsync", + "cfgsync_tf", "groth16", "key-management-system-service", "nomos-core", @@ -7323,6 +7323,7 @@ dependencies = [ "serde", "tempfile", "tera", + "testing-framework-config", "testing-framework-core", "testing-framework-env", "tests", @@ -7348,6 +7349,7 @@ dependencies = [ "serde", "serde_yaml", "tempfile", + "testing-framework-config", "testing-framework-core", "testing-framework-env", "thiserror 2.0.17", diff --git a/Cargo.toml b/Cargo.toml index c29b430..b9b00e6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ members = [ "testing-framework/deployers/k8s", "testing-framework/deployers/local", "testing-framework/env", - "testing-framework/tools/cfgsync", + "testing-framework/tools/cfgsync_tf", "testing-framework/workflows", ] resolver = "2" @@ -42,7 +42,7 @@ testing-framework-workflows = { default-features = false, path = "testing-f # Logos git dependencies (pinned to latest master) broadcast-service = { default-features = false, git = "https://github.com/logos-co/nomos-node.git", rev = "1fce2dc3f482c16361316eb2a1b6ccd1206aa917" } -cfgsync = { default-features = false, path = "testing-framework/tools/cfgsync" } +cfgsync_tf = { default-features = false, path = "testing-framework/tools/cfgsync_tf" } chain-leader = { default-features = false, git = "https://github.com/logos-co/nomos-node.git", rev = "1fce2dc3f482c16361316eb2a1b6ccd1206aa917", features = [ "pol-dev-mode", ] } diff --git a/testing-framework/core/src/constants.rs b/testing-framework/configs/src/constants.rs similarity index 86% rename from testing-framework/core/src/constants.rs rename to testing-framework/configs/src/constants.rs index 9c93984..c7bb153 100644 --- a/testing-framework/core/src/constants.rs +++ b/testing-framework/configs/src/constants.rs @@ -5,12 +5,6 @@ use testing_framework_env as tf_env; /// Default cfgsync port used across runners. pub const DEFAULT_CFGSYNC_PORT: u16 = 4400; -/// Default container path for KZG parameters (compose/k8s mount point). -pub const DEFAULT_KZG_CONTAINER_PATH: &str = "/kzgrs_test_params/kzgrs_test_params"; - -/// Default host-relative directory for KZG assets. -pub const DEFAULT_KZG_HOST_DIR: &str = "testing-framework/assets/stack/kzgrs_test_params"; - /// Default HTTP probe interval used across readiness checks. pub const DEFAULT_HTTP_POLL_INTERVAL: Duration = Duration::from_secs(1); @@ -36,15 +30,25 @@ pub const DEFAULT_LIBP2P_NETWORK_PORT: u16 = 3000; pub const DEFAULT_DA_NETWORK_PORT: u16 = 3300; /// Default blend network port. -pub const DEFAULT_BLEND_NETWORK_PORT: u16 = 4401; +pub const DEFAULT_BLEND_NETWORK_PORT: u16 = 3400; //4401; /// Resolve cfgsync port from `NOMOS_CFGSYNC_PORT`, falling back to the default. pub fn cfgsync_port() -> u16 { tf_env::nomos_cfgsync_port().unwrap_or(DEFAULT_CFGSYNC_PORT) } +/// Default KZG parameters file name. +pub const KZG_PARAMS_FILENAME: &str = "kzgrs_test_params"; +/// Default container path for KZG parameters (compose/k8s mount point). +pub const DEFAULT_KZG_CONTAINER_PATH: &str = "/kzgrs_test_params/kzgrs_test_params"; + /// Resolve container KZG path from `NOMOS_KZG_CONTAINER_PATH`, falling back to /// the default. pub fn kzg_container_path() -> String { tf_env::nomos_kzg_container_path().unwrap_or_else(|| DEFAULT_KZG_CONTAINER_PATH.to_string()) } + +/// Default stack assets directory. +pub const DEFAULT_ASSETS_STACK_DIR: &str = "testing-framework/assets/stack"; +/// Default host-relative directory for KZG assets. +pub const DEFAULT_KZG_HOST_DIR: &str = "testing-framework/assets/stack/kzgrs_test_params"; diff --git a/testing-framework/configs/src/lib.rs b/testing-framework/configs/src/lib.rs index e975e01..0cc15c3 100644 --- a/testing-framework/configs/src/lib.rs +++ b/testing-framework/configs/src/lib.rs @@ -4,6 +4,7 @@ use nomos_core::sdp::ProviderId; use nomos_libp2p::{Multiaddr, PeerId, multiaddr}; use testing_framework_env as tf_env; +pub mod constants; pub mod nodes; pub mod timeouts; pub mod topology; diff --git a/testing-framework/configs/src/nodes/common.rs b/testing-framework/configs/src/nodes/common.rs index ab398ca..ee44133 100644 --- a/testing-framework/configs/src/nodes/common.rs +++ b/testing-framework/configs/src/nodes/common.rs @@ -32,7 +32,7 @@ use nomos_node::{ use nomos_utils::math::NonNegativeF64; use nomos_wallet::WalletServiceSettings; -use crate::{timeouts, topology::configs::GeneralConfig}; +use crate::{constants::KZG_PARAMS_FILENAME, timeouts, topology::configs::GeneralConfig}; // Configuration constants const CRYPTARCHIA_GOSSIPSUB_PROTOCOL: &str = "/cryptarchia/proto"; @@ -45,7 +45,6 @@ const API_RATE_LIMIT_PER_SECOND: u64 = 10000; const API_RATE_LIMIT_BURST: u32 = 10000; const API_MAX_CONCURRENT_REQUESTS: usize = 1000; const BLOB_STORAGE_DIR: &str = "./"; -const KZG_PARAMS_FILENAME: &str = "kzgrs_test_params"; pub(crate) fn cryptarchia_deployment(config: &GeneralConfig) -> CryptarchiaDeploymentSettings { CryptarchiaDeploymentSettings { diff --git a/testing-framework/configs/src/topology/configs/da.rs b/testing-framework/configs/src/topology/configs/da.rs index 8a136dc..43489de 100644 --- a/testing-framework/configs/src/topology/configs/da.rs +++ b/testing-framework/configs/src/topology/configs/da.rs @@ -22,7 +22,7 @@ use testing_framework_env as tf_env; use thiserror::Error; use tracing::warn; -use crate::secret_key_to_peer_id; +use crate::{constants::DEFAULT_KZG_HOST_DIR, secret_key_to_peer_id}; pub static GLOBAL_PARAMS_PATH: LazyLock = LazyLock::new(resolve_global_params_path); @@ -69,7 +69,10 @@ fn resolve_global_params_path() -> String { .unwrap_or_else(|| PathBuf::from(env!("CARGO_MANIFEST_DIR"))); let params_path = canonicalize_params_path( - workspace_root.join("testing-framework/assets/stack/kzgrs_test_params"), + workspace_root.join( + testing_framework_env::nomos_kzg_dir_rel() + .unwrap_or_else(|| DEFAULT_KZG_HOST_DIR.to_string()), + ), ); match params_path.canonicalize() { Ok(path) => path.to_string_lossy().to_string(), diff --git a/testing-framework/core/src/kzg.rs b/testing-framework/core/src/kzg.rs index 645b0f3..4b617ef 100644 --- a/testing-framework/core/src/kzg.rs +++ b/testing-framework/core/src/kzg.rs @@ -1,9 +1,8 @@ use std::path::{Path, PathBuf}; +use testing_framework_config::constants::{DEFAULT_KZG_CONTAINER_PATH, DEFAULT_KZG_HOST_DIR}; use testing_framework_env as tf_env; -use crate::constants::{DEFAULT_KZG_CONTAINER_PATH, DEFAULT_KZG_HOST_DIR}; - /// Default in-image path for KZG params used by testnet images. pub const DEFAULT_IN_IMAGE_KZG_PARAMS_PATH: &str = "/opt/nomos/kzg-params/kzgrs_test_params"; diff --git a/testing-framework/core/src/lib.rs b/testing-framework/core/src/lib.rs index db604f4..672df4c 100644 --- a/testing-framework/core/src/lib.rs +++ b/testing-framework/core/src/lib.rs @@ -1,4 +1,3 @@ -pub mod constants; pub mod kzg; pub mod nodes; pub mod scenario; diff --git a/testing-framework/core/src/scenario/cfgsync.rs b/testing-framework/core/src/scenario/cfgsync.rs index 9aac347..43dc888 100644 --- a/testing-framework/core/src/scenario/cfgsync.rs +++ b/testing-framework/core/src/scenario/cfgsync.rs @@ -6,12 +6,10 @@ use nomos_tracing_service::TracingSettings; use nomos_utils::bounded_duration::{MinimalBoundedDuration, SECOND}; use serde::{Deserialize, Serialize}; use serde_with::serde_as; +use testing_framework_config::constants::kzg_container_path; use tracing::debug; -use crate::{ - constants::kzg_container_path, - topology::{configs::wallet::WalletConfig, generation::GeneratedTopology}, -}; +use crate::topology::{configs::wallet::WalletConfig, generation::GeneratedTopology}; #[serde_as] #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/testing-framework/cucumber/src/world.rs b/testing-framework/cucumber/src/world.rs index 2b29c87..03dcdc6 100644 --- a/testing-framework/cucumber/src/world.rs +++ b/testing-framework/cucumber/src/world.rs @@ -252,7 +252,9 @@ impl TestingFrameworkWorld { if !(node_ok && exec_ok) { return Err(StepError::Preflight { - message: "Missing Logos host binaries. Set NOMOS_NODE_BIN (and NOMOS_EXECUTOR_BIN if your scenario uses executors), or run `scripts/run/run-examples.sh host` to restore them into `testing-framework/assets/stack/bin`.".to_owned(), + message: "Missing Logos host binaries. Set NOMOS_NODE_BIN (and NOMOS_EXECUTOR_BIN if your scenario \ + uses executors), or run `scripts/run/run-examples.sh host` to restore them into \ + `testing-framework/assets/stack/bin`.".to_owned(), }); } } diff --git a/testing-framework/deployers/compose/Cargo.toml b/testing-framework/deployers/compose/Cargo.toml index f374f82..02f4432 100644 --- a/testing-framework/deployers/compose/Cargo.toml +++ b/testing-framework/deployers/compose/Cargo.toml @@ -13,22 +13,23 @@ version = "0.1.0" workspace = true [dependencies] -anyhow = "1" -async-trait = { workspace = true } -cfgsync = { workspace = true } -nomos-tracing = { workspace = true } -nomos-tracing-service = { workspace = true } -reqwest = { workspace = true, features = ["json"] } -serde = { workspace = true, features = ["derive"] } -tempfile = { workspace = true } -tera = "1.19" -testing-framework-core = { path = "../../core" } -testing-framework-env = { workspace = true } -thiserror = { workspace = true } -tokio = { workspace = true, features = ["macros", "net", "process", "rt-multi-thread", "sync", "time"] } -tracing = { workspace = true } -url = { version = "2" } -uuid = { version = "1", features = ["v4"] } +anyhow = "1" +async-trait = { workspace = true } +cfgsync_tf = { workspace = true } +nomos-tracing = { workspace = true } +nomos-tracing-service = { workspace = true } +reqwest = { workspace = true, features = ["json"] } +serde = { workspace = true, features = ["derive"] } +tempfile = { workspace = true } +tera = "1.19" +testing-framework-config = { workspace = true } +testing-framework-core = { path = "../../core" } +testing-framework-env = { workspace = true } +thiserror = { workspace = true } +tokio = { workspace = true, features = ["macros", "net", "process", "rt-multi-thread", "sync", "time"] } +tracing = { workspace = true } +url = { version = "2" } +uuid = { version = "1", features = ["v4"] } [dev-dependencies] groth16 = { workspace = true } diff --git a/testing-framework/deployers/compose/src/deployer/mod.rs b/testing-framework/deployers/compose/src/deployer/mod.rs index 27dff56..03af600 100644 --- a/testing-framework/deployers/compose/src/deployer/mod.rs +++ b/testing-framework/deployers/compose/src/deployer/mod.rs @@ -87,7 +87,7 @@ pub(super) fn make_cleanup_guard( mod tests { use std::{collections::HashMap, net::Ipv4Addr}; - use cfgsync::{ + use cfgsync_tf::{ config::builder::create_node_configs, host::{Host, PortOverrides}, }; diff --git a/testing-framework/deployers/compose/src/descriptor/mod.rs b/testing-framework/deployers/compose/src/descriptor/mod.rs index 0fc1d40..b3d2360 100644 --- a/testing-framework/deployers/compose/src/descriptor/mod.rs +++ b/testing-framework/deployers/compose/src/descriptor/mod.rs @@ -5,7 +5,6 @@ use std::{ use serde::Serialize; use testing_framework_core::{ - constants::DEFAULT_CFGSYNC_PORT, kzg::KzgParamsSpec, topology::generation::{GeneratedNodeConfig, GeneratedTopology}, }; @@ -16,6 +15,7 @@ use crate::docker::platform::{host_gateway_entry, resolve_image}; mod node; pub use node::{EnvEntry, NodeDescriptor}; +use testing_framework_config::constants::DEFAULT_CFGSYNC_PORT; /// Top-level docker-compose descriptor built from a GeneratedTopology. #[derive(Clone, Debug, Serialize)] diff --git a/testing-framework/deployers/compose/src/docker/mod.rs b/testing-framework/deployers/compose/src/docker/mod.rs index 1896aa2..4dc6c45 100644 --- a/testing-framework/deployers/compose/src/docker/mod.rs +++ b/testing-framework/deployers/compose/src/docker/mod.rs @@ -5,6 +5,7 @@ pub mod workspace; use std::{env, process::Stdio, time::Duration}; +use testing_framework_config::constants::DEFAULT_ASSETS_STACK_DIR; use tokio::{process::Command, time::timeout}; use tracing::{debug, info, warn}; @@ -104,7 +105,9 @@ pub async fn build_local_image( ) -> Result<(), ComposeRunnerError> { let repo_root = repository_root().map_err(|source| ComposeRunnerError::ImageBuild { source })?; - let runtime_dockerfile = repo_root.join("testing-framework/assets/stack/Dockerfile.runtime"); + let runtime_dockerfile = repo_root + .join(DEFAULT_ASSETS_STACK_DIR) + .join("Dockerfile.runtime"); tracing::info!( image, diff --git a/testing-framework/deployers/compose/src/docker/workspace.rs b/testing-framework/deployers/compose/src/docker/workspace.rs index 752eaa0..4fe7eca 100644 --- a/testing-framework/deployers/compose/src/docker/workspace.rs +++ b/testing-framework/deployers/compose/src/docker/workspace.rs @@ -5,6 +5,10 @@ use std::{ use anyhow::{Context as _, Result}; use tempfile::TempDir; +use testing_framework_config::constants::{ + DEFAULT_ASSETS_STACK_DIR, DEFAULT_KZG_HOST_DIR, KZG_PARAMS_FILENAME, +}; +use testing_framework_env; use tracing::{debug, info}; /// Copy the repository stack assets into a scenario-specific temp dir. @@ -16,7 +20,8 @@ pub struct ComposeWorkspace { impl ComposeWorkspace { /// Clone the stack assets into a temporary directory. pub fn create() -> Result { - let repo_root = env::var("CARGO_WORKSPACE_DIR") + let repo_root = env::var("REPO_ROOT_OVERRIDE_DIR") + .or_else(|_| env::var("CARGO_WORKSPACE_DIR")) .map(PathBuf::from) .or_else(|_| { Path::new(env!("CARGO_MANIFEST_DIR")) @@ -49,8 +54,11 @@ impl ComposeWorkspace { copy_dir_recursive(&scripts_source, &temp.path().join("stack/scripts"))?; } - let kzg_source = repo_root.join("testing-framework/assets/stack/kzgrs_test_params"); - let target = temp.path().join("kzgrs_test_params"); + let kzg_source = repo_root.join( + testing_framework_env::nomos_kzg_dir_rel() + .unwrap_or_else(|| DEFAULT_KZG_HOST_DIR.to_string()), + ); + let target = temp.path().join(KZG_PARAMS_FILENAME); if kzg_source.exists() { if kzg_source.is_dir() { copy_dir_recursive(&kzg_source, &target)?; @@ -69,8 +77,14 @@ impl ComposeWorkspace { .unwrap_or(true) { anyhow::bail!( - "KZG params missing in stack assets (expected files in {})", - kzg_source.display() + "\nKZG params missing in stack assets (expected files in {})\ + \nrepo_root: {}\ + \ntarget: {}\ + \nnomos_kzg_dir_rel(): {:?}\n", + kzg_source.display(), + repo_root.display(), + target.display(), + testing_framework_env::nomos_kzg_dir_rel(), ); } @@ -98,7 +112,11 @@ impl ComposeWorkspace { } fn stack_assets_root(repo_root: &Path) -> PathBuf { - let new_layout = repo_root.join("testing-framework/assets/stack"); + let new_layout = if let Some(rel_stack_dir) = env::var("REL_ASSETS_STACK_DIR").ok() { + repo_root.join(rel_stack_dir) + } else { + repo_root.join(DEFAULT_ASSETS_STACK_DIR) + }; if new_layout.exists() { new_layout } else { @@ -107,7 +125,7 @@ fn stack_assets_root(repo_root: &Path) -> PathBuf { } fn stack_scripts_root(repo_root: &Path) -> PathBuf { - let new_layout = repo_root.join("testing-framework/assets/stack/scripts"); + let new_layout = repo_root.join(DEFAULT_ASSETS_STACK_DIR).join("scripts"); if new_layout.exists() { new_layout } else { diff --git a/testing-framework/deployers/compose/src/infrastructure/environment.rs b/testing-framework/deployers/compose/src/infrastructure/environment.rs index 1ea8e96..a85c7ee 100644 --- a/testing-framework/deployers/compose/src/infrastructure/environment.rs +++ b/testing-framework/deployers/compose/src/infrastructure/environment.rs @@ -6,6 +6,7 @@ use std::{ use anyhow::anyhow; use reqwest::Url; +use testing_framework_config::constants::KZG_PARAMS_FILENAME; use testing_framework_core::{ adjust_timeout, scenario::CleanupGuard, topology::generation::GeneratedTopology, }; @@ -151,7 +152,7 @@ pub fn prepare_workspace_state() -> Result { let workspace = ComposeWorkspace::create().map_err(WorkspaceError::new)?; let root = workspace.root_path().to_path_buf(); let cfgsync_path = workspace.stack_dir().join("cfgsync.yaml"); - let use_kzg = workspace.root_path().join("kzgrs_test_params").exists(); + let use_kzg = workspace.root_path().join(KZG_PARAMS_FILENAME).exists(); let state = WorkspaceState { workspace, diff --git a/testing-framework/deployers/k8s/Cargo.toml b/testing-framework/deployers/k8s/Cargo.toml index d0d92ff..7869e5c 100644 --- a/testing-framework/deployers/k8s/Cargo.toml +++ b/testing-framework/deployers/k8s/Cargo.toml @@ -13,20 +13,21 @@ version = "0.1.0" workspace = true [dependencies] -anyhow = "1" -async-trait = { workspace = true } -k8s-openapi = { version = "0.20", features = ["latest"] } -kube = { version = "0.87", default-features = false, features = ["client", "runtime", "rustls-tls"] } -nomos-tracing = { workspace = true } -nomos-tracing-service = { workspace = true } -reqwest = { workspace = true, features = ["json"] } -serde = { version = "1", features = ["derive"] } -serde_yaml = { workspace = true } -tempfile = { workspace = true } -testing-framework-core = { path = "../../core" } -testing-framework-env = { workspace = true } -thiserror = { workspace = true } -tokio = { workspace = true, features = ["macros", "net", "process", "rt-multi-thread", "sync", "time"] } -tracing = { workspace = true } -url = { version = "2" } -uuid = { version = "1", features = ["v4"] } +anyhow = "1" +async-trait = { workspace = true } +k8s-openapi = { version = "0.20", features = ["latest"] } +kube = { version = "0.87", default-features = false, features = ["client", "runtime", "rustls-tls"] } +nomos-tracing = { workspace = true } +nomos-tracing-service = { workspace = true } +reqwest = { workspace = true, features = ["json"] } +serde = { version = "1", features = ["derive"] } +serde_yaml = { workspace = true } +tempfile = { workspace = true } +testing-framework-config = { workspace = true } +testing-framework-core = { path = "../../core" } +testing-framework-env = { workspace = true } +thiserror = { workspace = true } +tokio = { workspace = true, features = ["macros", "net", "process", "rt-multi-thread", "sync", "time"] } +tracing = { workspace = true } +url = { version = "2" } +uuid = { version = "1", features = ["v4"] } diff --git a/testing-framework/deployers/k8s/src/infrastructure/assets.rs b/testing-framework/deployers/k8s/src/infrastructure/assets.rs index f58afaa..909ec9e 100644 --- a/testing-framework/deployers/k8s/src/infrastructure/assets.rs +++ b/testing-framework/deployers/k8s/src/infrastructure/assets.rs @@ -10,9 +10,9 @@ use nomos_tracing_service::MetricsLayer; use reqwest::Url; use serde::Serialize; use tempfile::TempDir; +use testing_framework_config::constants::{DEFAULT_ASSETS_STACK_DIR, cfgsync_port}; pub use testing_framework_core::kzg::KzgMode; use testing_framework_core::{ - constants::cfgsync_port, kzg::KzgParamsSpec, scenario::cfgsync::{apply_topology_overrides, load_cfgsync_template, render_cfgsync_yaml}, topology::generation::GeneratedTopology, @@ -242,7 +242,7 @@ fn validate_scripts(root: &Path) -> Result { fn validate_kzg_params(root: &Path, spec: &KzgParamsSpec) -> Result { let Some(path) = spec.host_params_dir.clone() else { return Err(AssetsError::MissingKzg { - path: root.join(testing_framework_core::constants::DEFAULT_KZG_HOST_DIR), + path: root.join(testing_framework_config::constants::DEFAULT_KZG_HOST_DIR), }); }; if path.exists() { @@ -294,7 +294,7 @@ pub fn workspace_root() -> AnyResult { } fn stack_assets_root(root: &Path) -> PathBuf { - let new_layout = root.join("testing-framework/assets/stack"); + let new_layout = root.join(DEFAULT_ASSETS_STACK_DIR); if new_layout.exists() { new_layout } else { @@ -303,7 +303,7 @@ fn stack_assets_root(root: &Path) -> PathBuf { } fn stack_scripts_root(root: &Path) -> PathBuf { - let new_layout = root.join("testing-framework/assets/stack/scripts"); + let new_layout = root.join(DEFAULT_ASSETS_STACK_DIR).join("scripts"); if new_layout.exists() { new_layout } else { diff --git a/testing-framework/deployers/k8s/src/lifecycle/wait/mod.rs b/testing-framework/deployers/k8s/src/lifecycle/wait/mod.rs index 3b7edda..0c97ffa 100644 --- a/testing-framework/deployers/k8s/src/lifecycle/wait/mod.rs +++ b/testing-framework/deployers/k8s/src/lifecycle/wait/mod.rs @@ -1,13 +1,7 @@ use std::{env, sync::LazyLock, time::Duration}; use kube::Error as KubeError; -use testing_framework_core::{ - constants::{ - DEFAULT_HTTP_POLL_INTERVAL, DEFAULT_K8S_DEPLOYMENT_TIMEOUT, - DEFAULT_NODE_HTTP_PROBE_TIMEOUT, DEFAULT_NODE_HTTP_TIMEOUT, - }, - scenario::http_probe::NodeRole, -}; +use testing_framework_core::scenario::http_probe::NodeRole; use thiserror::Error; mod deployment; @@ -18,6 +12,10 @@ mod ports; pub use forwarding::PortForwardHandle; pub use orchestrator::wait_for_cluster_ready; +use testing_framework_config::constants::{ + DEFAULT_HTTP_POLL_INTERVAL, DEFAULT_K8S_DEPLOYMENT_TIMEOUT, DEFAULT_NODE_HTTP_PROBE_TIMEOUT, + DEFAULT_NODE_HTTP_TIMEOUT, +}; /// Container and host-side HTTP ports for a node in the Helm chart values. #[derive(Clone, Copy, Debug)] diff --git a/testing-framework/tools/cfgsync/Cargo.toml b/testing-framework/tools/cfgsync_tf/Cargo.toml similarity index 98% rename from testing-framework/tools/cfgsync/Cargo.toml rename to testing-framework/tools/cfgsync_tf/Cargo.toml index d672fd1..7dd5546 100644 --- a/testing-framework/tools/cfgsync/Cargo.toml +++ b/testing-framework/tools/cfgsync_tf/Cargo.toml @@ -4,7 +4,7 @@ description = { workspace = true } edition = { workspace = true } keywords = { workspace = true } license = { workspace = true } -name = "cfgsync" +name = "cfgsync_tf" readme = { workspace = true } repository = { workspace = true } version = { workspace = true } diff --git a/testing-framework/tools/cfgsync/src/bin/cfgsync-client.rs b/testing-framework/tools/cfgsync_tf/src/bin/cfgsync-client.rs similarity index 95% rename from testing-framework/tools/cfgsync/src/bin/cfgsync-client.rs rename to testing-framework/tools/cfgsync_tf/src/bin/cfgsync-client.rs index 1c247e4..3f43a84 100644 --- a/testing-framework/tools/cfgsync/src/bin/cfgsync-client.rs +++ b/testing-framework/tools/cfgsync_tf/src/bin/cfgsync-client.rs @@ -6,7 +6,7 @@ use std::{ str::FromStr, }; -use cfgsync::{ +use cfgsync_tf::{ client::{FetchedConfig, get_config}, server::ClientIp, }; @@ -15,9 +15,9 @@ use nomos_libp2p::PeerId; use nomos_node::Config as ValidatorConfig; use serde::{Serialize, de::DeserializeOwned}; use subnetworks_assignations::{MembershipCreator, MembershipHandler, SubnetworkId}; -use testing_framework_core::{ - constants::cfgsync_port as default_cfgsync_port, - nodes::common::config::injection::{inject_ibd_into_cryptarchia, normalize_ed25519_sigs}, +use testing_framework_config::constants::cfgsync_port as default_cfgsync_port; +use testing_framework_core::nodes::common::config::injection::{ + inject_ibd_into_cryptarchia, normalize_ed25519_sigs, }; fn parse_ip(ip_str: &str) -> Ipv4Addr { diff --git a/testing-framework/tools/cfgsync/src/bin/cfgsync-server.rs b/testing-framework/tools/cfgsync_tf/src/bin/cfgsync-server.rs similarity index 94% rename from testing-framework/tools/cfgsync/src/bin/cfgsync-server.rs rename to testing-framework/tools/cfgsync_tf/src/bin/cfgsync-server.rs index 8b2aa75..6d2cdae 100644 --- a/testing-framework/tools/cfgsync/src/bin/cfgsync-server.rs +++ b/testing-framework/tools/cfgsync_tf/src/bin/cfgsync-server.rs @@ -1,7 +1,7 @@ use std::path::PathBuf; use anyhow::Context as _; -use cfgsync::server::{CfgSyncConfig, cfgsync_app}; +use cfgsync_tf::server::{CfgSyncConfig, cfgsync_app}; use clap::Parser; use tokio::net::TcpListener; diff --git a/testing-framework/tools/cfgsync/src/client.rs b/testing-framework/tools/cfgsync_tf/src/client.rs similarity index 100% rename from testing-framework/tools/cfgsync/src/client.rs rename to testing-framework/tools/cfgsync_tf/src/client.rs diff --git a/testing-framework/tools/cfgsync/src/config/builder.rs b/testing-framework/tools/cfgsync_tf/src/config/builder.rs similarity index 100% rename from testing-framework/tools/cfgsync/src/config/builder.rs rename to testing-framework/tools/cfgsync_tf/src/config/builder.rs diff --git a/testing-framework/tools/cfgsync/src/config/kms.rs b/testing-framework/tools/cfgsync_tf/src/config/kms.rs similarity index 100% rename from testing-framework/tools/cfgsync/src/config/kms.rs rename to testing-framework/tools/cfgsync_tf/src/config/kms.rs diff --git a/testing-framework/tools/cfgsync/src/config/providers.rs b/testing-framework/tools/cfgsync_tf/src/config/providers.rs similarity index 100% rename from testing-framework/tools/cfgsync/src/config/providers.rs rename to testing-framework/tools/cfgsync_tf/src/config/providers.rs diff --git a/testing-framework/tools/cfgsync/src/config/tracing.rs b/testing-framework/tools/cfgsync_tf/src/config/tracing.rs similarity index 100% rename from testing-framework/tools/cfgsync/src/config/tracing.rs rename to testing-framework/tools/cfgsync_tf/src/config/tracing.rs diff --git a/testing-framework/tools/cfgsync/src/config/validation.rs b/testing-framework/tools/cfgsync_tf/src/config/validation.rs similarity index 100% rename from testing-framework/tools/cfgsync/src/config/validation.rs rename to testing-framework/tools/cfgsync_tf/src/config/validation.rs diff --git a/testing-framework/tools/cfgsync/src/host.rs b/testing-framework/tools/cfgsync_tf/src/host.rs similarity index 91% rename from testing-framework/tools/cfgsync/src/host.rs rename to testing-framework/tools/cfgsync_tf/src/host.rs index d382ba8..76c2f68 100644 --- a/testing-framework/tools/cfgsync/src/host.rs +++ b/testing-framework/tools/cfgsync_tf/src/host.rs @@ -1,9 +1,9 @@ use std::net::Ipv4Addr; -pub const DEFAULT_LIBP2P_NETWORK_PORT: u16 = 3000; -pub const DEFAULT_DA_NETWORK_PORT: u16 = 3300; -pub const DEFAULT_BLEND_PORT: u16 = 3400; -pub const DEFAULT_API_PORT: u16 = 18080; +use testing_framework_config::constants::{ + DEFAULT_API_PORT, DEFAULT_BLEND_NETWORK_PORT, DEFAULT_DA_NETWORK_PORT, + DEFAULT_LIBP2P_NETWORK_PORT, +}; #[derive(Copy, Clone, Eq, PartialEq, Hash)] pub enum HostKind { @@ -40,7 +40,7 @@ impl Host { identifier, network_port: ports.network_port.unwrap_or(DEFAULT_LIBP2P_NETWORK_PORT), da_network_port: ports.da_network_port.unwrap_or(DEFAULT_DA_NETWORK_PORT), - blend_port: ports.blend_port.unwrap_or(DEFAULT_BLEND_PORT), + blend_port: ports.blend_port.unwrap_or(DEFAULT_BLEND_NETWORK_PORT), api_port: ports.api_port.unwrap_or(DEFAULT_API_PORT), testing_http_port: ports.testing_http_port.unwrap_or(DEFAULT_API_PORT + 1), } diff --git a/testing-framework/tools/cfgsync/src/lib.rs b/testing-framework/tools/cfgsync_tf/src/lib.rs similarity index 100% rename from testing-framework/tools/cfgsync/src/lib.rs rename to testing-framework/tools/cfgsync_tf/src/lib.rs diff --git a/testing-framework/tools/cfgsync/src/network/address.rs b/testing-framework/tools/cfgsync_tf/src/network/address.rs similarity index 100% rename from testing-framework/tools/cfgsync/src/network/address.rs rename to testing-framework/tools/cfgsync_tf/src/network/address.rs diff --git a/testing-framework/tools/cfgsync/src/network/mod.rs b/testing-framework/tools/cfgsync_tf/src/network/mod.rs similarity index 100% rename from testing-framework/tools/cfgsync/src/network/mod.rs rename to testing-framework/tools/cfgsync_tf/src/network/mod.rs diff --git a/testing-framework/tools/cfgsync/src/network/peers.rs b/testing-framework/tools/cfgsync_tf/src/network/peers.rs similarity index 100% rename from testing-framework/tools/cfgsync/src/network/peers.rs rename to testing-framework/tools/cfgsync_tf/src/network/peers.rs diff --git a/testing-framework/tools/cfgsync/src/repo.rs b/testing-framework/tools/cfgsync_tf/src/repo.rs similarity index 100% rename from testing-framework/tools/cfgsync/src/repo.rs rename to testing-framework/tools/cfgsync_tf/src/repo.rs diff --git a/testing-framework/tools/cfgsync/src/server.rs b/testing-framework/tools/cfgsync_tf/src/server.rs similarity index 100% rename from testing-framework/tools/cfgsync/src/server.rs rename to testing-framework/tools/cfgsync_tf/src/server.rs