Skip to content

Commit

Permalink
Merge pull request #292 from monadicus/feat-aot-env
Browse files Browse the repository at this point in the history
feat(aot): support PRIVATE_KEY env and other cli options
  • Loading branch information
Meshiest authored Sep 26, 2024
2 parents 4db274e + 1f94410 commit 740b6cd
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion crates/aot/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ axum.workspace = true
bincode.workspace = true
bech32.workspace = true
checkpoint = { workspace = true, features = ["write"] }
clap.workspace = true
clap = { workspace = true, features = ["env"] }
clap-stdin.workspace = true
colored.workspace = true
crossterm = { workspace = true, optional = true }
Expand Down
4 changes: 2 additions & 2 deletions crates/aot/src/auth/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,10 @@ impl<N: Network> From<Authorization<N>> for ProxyAuthorization<N> {
#[group(multiple = false)]
pub struct FeeKey<N: Network> {
/// Specify the account private key of the node
#[clap(long = "fee-private-key")]
#[clap(env, long)]
pub fee_private_key: Option<PrivateKey<N>>,
/// Specify the account private key of the node
#[clap(long = "fee-private-key-file")]
#[clap(env, long)]
pub fee_private_key_file: Option<PathBuf>,
}

Expand Down
2 changes: 1 addition & 1 deletion crates/aot/src/auth/auth_deploy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use crate::Network;
#[derive(Debug, Args)]
pub struct AuthDeployOptions<N: Network> {
/// The query to use for the program.
#[clap(short, long)]
#[clap(env, short, long)]
pub query: Option<String>,
/// The program to deploy.
/// This can be a file or stdin.
Expand Down
2 changes: 1 addition & 1 deletion crates/aot/src/auth/auth_program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::{Authorization, Key, Network, Value};
#[derive(Debug, Args)]
pub struct AuthProgramOptions<N: Network> {
/// Query to load the program with.
#[clap(short, long)]
#[clap(env, short, long)]
pub query: Option<String>,
/// Program ID and function name (eg. credits.aleo/transfer_public)
locator: Locator<N>,
Expand Down
2 changes: 1 addition & 1 deletion crates/aot/src/auth/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub struct Execute<N: Network> {
#[arg(short, long, value_enum, default_value_t = ExecMode::Local)]
pub exec_mode: ExecMode,
/// Query endpoint.
#[arg(short, long)]
#[arg(env, short, long)]
pub query: String,
/// Whether to broadcast the transaction.
#[arg(short, long, default_value_t = false)]
Expand Down
2 changes: 1 addition & 1 deletion crates/aot/src/auth/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pub enum AuthCommand<N: Network> {
#[derive(Debug, Args)]
pub struct CostCommand<N: Network> {
/// The query to use for the program.
#[clap(long)]
#[clap(env, short, long)]
query: Option<String>,
#[clap(flatten)]
auth: AuthArgs<N>,
Expand Down
2 changes: 1 addition & 1 deletion crates/aot/src/genesis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ impl<N: Network, T: DeserializeOwned> FromStr for AddressMap<N, T> {
pub struct Genesis<N: Network> {
/// The private key to use when generating the genesis block. Generates one
/// randomly if not passed.
#[clap(short, long)]
#[clap(env, short, long)]
pub genesis_key: Option<PrivateKey<N>>,

/// Where to write the genesis block to.
Expand Down
4 changes: 2 additions & 2 deletions crates/aot/src/key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ use crate::{Network, PrivateKey};
#[group(required = true, multiple = false)]
pub struct Key<N: Network> {
/// Specify the account private key of the node
#[clap(long = "private-key")]
#[clap(env, long)]
pub private_key: Option<PrivateKey<N>>,
/// Specify the account private key of the node
#[clap(long = "private-key-file")]
#[clap(env, long)]
pub private_key_file: Option<PathBuf>,
}

Expand Down

0 comments on commit 740b6cd

Please sign in to comment.