diff --git a/nym-node/src/cli/commands/run/mod.rs b/nym-node/src/cli/commands/run/mod.rs index bcaa1e5106..9dfd1061f0 100644 --- a/nym-node/src/cli/commands/run/mod.rs +++ b/nym-node/src/cli/commands/run/mod.rs @@ -83,6 +83,10 @@ pub(crate) async fn execute(mut args: Args) -> Result<(), NymNodeError> { warn!("this node is going to run without mixnode or gateway support! consider providing `mode` value"); } + if config.modes.standalone_exit() { + warn!("this node is going to run in EXIT gateway mode only - it will not be able to accept client traffic and thus will NOT be eligible for any rewards. consider running it alongside `entry` (or `full-gateway`) mode") + } + if config.host.public_ips.is_empty() { return Err(NymNodeError::NoPublicIps); } diff --git a/nym-node/src/config/mod.rs b/nym-node/src/config/mod.rs index 8f0cb9f220..c9d614e6b1 100644 --- a/nym-node/src/config/mod.rs +++ b/nym-node/src/config/mod.rs @@ -77,6 +77,9 @@ pub enum NodeMode { #[clap(alias = "exit")] ExitGateway, + + // entry + exit + FullGateway, } impl Display for NodeMode { @@ -85,6 +88,7 @@ impl Display for NodeMode { NodeMode::Mixnode => "mixnode".fmt(f), NodeMode::EntryGateway => "entry-gateway".fmt(f), NodeMode::ExitGateway => "exit-gateway".fmt(f), + NodeMode::FullGateway => "full-gateway".fmt(f), } } } @@ -117,11 +121,16 @@ impl NodeModes { self.mixnode || self.entry || self.exit } + pub fn standalone_exit(&self) -> bool { + !self.mixnode && !self.entry && self.exit + } + pub fn with_mode(&mut self, mode: NodeMode) -> &mut Self { match mode { NodeMode::Mixnode => self.with_mixnode(), NodeMode::EntryGateway => self.with_entry(), NodeMode::ExitGateway => self.with_exit(), + NodeMode::FullGateway => self.with_entry().with_exit(), } }