From c502257e9a93ccff0fd41d35aa29a50c7643c7fa Mon Sep 17 00:00:00 2001 From: BGluth Date: Thu, 7 Nov 2024 13:12:41 -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 | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/paladin-core/src/config/mod.rs b/paladin-core/src/config/mod.rs index fc7a617..fa59832 100644 --- a/paladin-core/src/config/mod.rs +++ b/paladin-core/src/config/mod.rs @@ -24,19 +24,24 @@ use clap::{Args, ValueEnum}; pub struct Config { /// Specifies the routing key for publishing task messages. In most cases, /// the default value should suffice. - #[arg(long, short, default_value = "task")] + #[arg( + long, + short, + env = "PALADIN_TASK_BUS_ROUTING_KEY", + default_value = "task" + )] pub task_bus_routing_key: String, /// Determines the serialization format to be used. - #[arg(long, short, value_enum, default_value_t = Serializer::Cbor)] + #[arg(long, short, env="PALADIN_SERIALIZER", value_enum, default_value_t = Serializer::Cbor)] pub serializer: Serializer, /// Specifies the runtime environment to use. - #[arg(long, short, value_enum, default_value_t = Runtime::Amqp)] + #[arg(long, short, env="PALADIN_RUNTIME", value_enum, default_value_t = Runtime::Amqp)] pub runtime: Runtime, /// Provides the URI for the AMQP broker, if the AMQP runtime is selected. - #[arg(long, env = "AMQP_URI", required_if_eq("runtime", "amqp"))] + #[arg(long, env = "PALADIN_AMQP_URI", required_if_eq("runtime", "amqp"))] pub amqp_uri: Option, }