Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions nym-node/src/cli/commands/run/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
7 changes: 7 additions & 0 deletions nym-node/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
}
}
Expand Down
Loading