From 7e47671b199f7cc672f6a5a2dc4d7a378c50e056 Mon Sep 17 00:00:00 2001 From: BGluth Date: Thu, 7 Nov 2024 13:31:58 -0700 Subject: [PATCH] feat: Added env support for prog args - The `zk_evm` leader bin just had env support added for it's prog args. However, some of its args are defined in `paladin`, so we needed to create a separate PR for this repo to add env support for the `paladin` specific prog args. - See also PR [#786](https://github.com/0xPolygonZero/zk_evm/pull/786) in `zk_evm`. --- paladin-core/src/config/mod.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/paladin-core/src/config/mod.rs b/paladin-core/src/config/mod.rs index 94f3e2c..f005322 100644 --- a/paladin-core/src/config/mod.rs +++ b/paladin-core/src/config/mod.rs @@ -25,25 +25,25 @@ const HELP_HEADING: &str = "Paladin options"; #[derive(Args, Clone, PartialEq, Eq, PartialOrd, Ord, Debug, Default)] pub struct Config { /// Determines the serialization format to be used. - #[arg(long, short, help_heading = HELP_HEADING, value_enum, default_value_t = Serializer::Postcard)] + #[arg(long, short, help_heading = HELP_HEADING, value_enum, env = "PALADIN_SERIALIZER", default_value_t = Serializer::Postcard)] pub serializer: Serializer, /// Specifies the runtime environment to use. - #[arg(long, short, help_heading = HELP_HEADING, value_enum, default_value_t = Runtime::Amqp)] + #[arg(long, short, help_heading = HELP_HEADING, env = "PALADIN_RUNTIME", value_enum, default_value_t = Runtime::Amqp)] pub runtime: Runtime, /// Specifies the number of worker threads to spawn (in memory runtime /// only). - #[arg(long, short, help_heading = HELP_HEADING)] + #[arg(long, short, help_heading = HELP_HEADING, env = "PALADIN_NUM_WORKERS")] pub num_workers: Option, /// Provides the URI for the AMQP broker, if the AMQP runtime is selected. - #[arg(long, help_heading = HELP_HEADING, env = "AMQP_URI", required_if_eq("runtime", "amqp"))] + #[arg(long, help_heading = HELP_HEADING, env = "PALADIN_AMQP_URI", required_if_eq("runtime", "amqp"))] pub amqp_uri: Option, /// Provides the routing key for workers to listen on, if the AMQP runtime /// is used in configuration. - #[arg(long, help_heading = HELP_HEADING)] + #[arg(long, help_heading = HELP_HEADING, env = "PALADIN_TASK_BUS_ROUTING_KEY")] pub task_bus_routing_key: Option, }