diff --git a/nym-node/src/cli/commands/run/mod.rs b/nym-node/src/cli/commands/run/mod.rs index 8b568150ed5..703e47662ba 100644 --- a/nym-node/src/cli/commands/run/mod.rs +++ b/nym-node/src/cli/commands/run/mod.rs @@ -78,6 +78,7 @@ pub(crate) async fn execute(mut args: Args) -> Result<(), NymNodeError> { } config }; + config.validate()?; if !config.modes.any_enabled() { warn!("this node is going to run without mixnode or gateway support! consider providing `mode` value"); diff --git a/nym-node/src/config/mod.rs b/nym-node/src/config/mod.rs index eca92898729..dfaa7eaef41 100644 --- a/nym-node/src/config/mod.rs +++ b/nym-node/src/config/mod.rs @@ -426,6 +426,13 @@ impl Config { pub fn validate(&self) -> Result<(), NymNodeError> { self.mixnet.validate()?; + // it's not allowed to run mixnode mode alongside entry mode + if self.modes.mixnode && self.modes.entry { + return Err(NymNodeError::config_validation_failure( + "illegal modes configuration - node cannot run as a mixnode and an entry gateway", + )); + } + Ok(()) } }