diff --git a/crates/cli/src/commands/agent.rs b/crates/cli/src/commands/agent.rs index ef839602..5eb5fa84 100644 --- a/crates/cli/src/commands/agent.rs +++ b/crates/cli/src/commands/agent.rs @@ -73,11 +73,13 @@ enum AgentCommands { /// Get the specific agent's status. Status, + /// Set the log level of the agent. SetLogLevel { /// The log level to set. level: String, }, + /// Set the log level of the node running on an agent. SetSnarkosLogLevel { /// The log verbosity to set. verbosity: u8, diff --git a/crates/cli/src/commands/env/action/mod.rs b/crates/cli/src/commands/env/action/mod.rs index 54d6162f..8fe22c47 100644 --- a/crates/cli/src/commands/env/action/mod.rs +++ b/crates/cli/src/commands/env/action/mod.rs @@ -63,6 +63,7 @@ pub enum Action { /// Turn the specified agents(and nodes) offline. #[clap(alias = "off")] Offline { + /// The nodes to take offline. (eg. `validator/any`) #[clap(num_args = 1, value_delimiter = ' ')] nodes: Vec, /// When present, don't wait for reconciles to finish before returning @@ -72,6 +73,7 @@ pub enum Action { /// Turn the specified agents(and nodes) online. #[clap(alias = "on")] Online { + /// The nodes to turn online (eg. `validator/any`) #[clap(num_args = 1, value_delimiter = ' ')] nodes: Vec, /// When present, don't wait for reconciles to finish before returning @@ -80,6 +82,7 @@ pub enum Action { }, /// Reboot the specified agents(and nodes). Reboot { + /// The nodes to reboot (eg. `validator/any`) #[clap(num_args = 1, value_delimiter = ' ')] nodes: Vec, /// When present, don't wait for reconciles to finish before returning @@ -160,9 +163,6 @@ pub enum Action { // Remove environment variables from a node: `--del-env FOO,BAR` #[clap(long, short, value_delimiter = ',', allow_hyphen_values = true)] del_env: Option>, - /// The nodes to configure. - #[clap(num_args = 1, value_delimiter = ' ')] - nodes: Vec, /// Configure the binary for a node. #[clap(long, short)] binary: Option, @@ -171,6 +171,9 @@ pub enum Action { private_key: Option, #[clap(long = "async")] async_mode: bool, + /// The nodes to configure. (eg. `validator/any`) + #[clap(num_args = 1, value_delimiter = ' ')] + nodes: Vec, }, } diff --git a/crates/cli/src/commands/env/mod.rs b/crates/cli/src/commands/env/mod.rs index 43cd96a3..275971eb 100644 --- a/crates/cli/src/commands/env/mod.rs +++ b/crates/cli/src/commands/env/mod.rs @@ -28,6 +28,7 @@ pub struct Env { /// Env commands. #[derive(Debug, Parser)] enum EnvCommands { + /// Run an action on an environment. #[clap(subcommand)] Action(action::Action), /// Get an env's specific agent by. diff --git a/snops_book/user_guide/clis/SNARKOS_AOT.md b/snops_book/user_guide/clis/SNARKOS_AOT.md index 4c46858c..b5254f3f 100644 --- a/snops_book/user_guide/clis/SNARKOS_AOT.md +++ b/snops_book/user_guide/clis/SNARKOS_AOT.md @@ -24,7 +24,6 @@ This document contains the help content for the `snarkos-aot` command-line progr * [`snarkos-aot ledger checkpoint apply`↴](#snarkos-aot-ledger-checkpoint-apply) * [`snarkos-aot ledger checkpoint view`↴](#snarkos-aot-ledger-checkpoint-view) * [`snarkos-aot ledger checkpoint clean`↴](#snarkos-aot-ledger-checkpoint-clean) -* [`snarkos-aot run`↴](#snarkos-aot-run) * [`snarkos-aot auth`↴](#snarkos-aot-auth) * [`snarkos-aot auth execute`↴](#snarkos-aot-auth-execute) * [`snarkos-aot auth program`↴](#snarkos-aot-auth-program) @@ -39,6 +38,7 @@ This document contains the help content for the `snarkos-aot` command-line progr * [`snarkos-aot program cost`↴](#snarkos-aot-program-cost) * [`snarkos-aot man`↴](#snarkos-aot-man) * [`snarkos-aot md`↴](#snarkos-aot-md) +* [`snarkos-aot run`↴](#snarkos-aot-run) ## `snarkos-aot` @@ -51,11 +51,11 @@ The different AOT commands * `genesis` — This command helps generate a custom genesis block given an initial private key, seed, and committee size * `accounts` — Given a seed and a count, generate a number of accounts * `ledger` — Commands for interacting with the ledger -* `run` — A wrapper around the snarkos node run commands that provide additional logging and configurability * `auth` — A command to help generate various different types of authorizations and execute them * `program` — A command to help gather information about a program, including its cost and imports * `man` — For generating cli manpages. Only with the mangen feature enabled * `md` — For generating cli markdown. Only with the clipages feature enabled +* `run` — A wrapper around the snarkos node run commands that provide additional logging and configurability ###### **Options:** @@ -374,46 +374,6 @@ Cleanup old checkpoints -## `snarkos-aot run` - -A wrapper around the snarkos node run commands that provide additional logging and configurability - -**Usage:** `snarkos-aot run [OPTIONS] --ledger --type <--private-key |--private-key-file >` - -###### **Options:** - -* `-g`, `--genesis ` — A path to the genesis block to initialize the ledger from -* `-l`, `--ledger ` — The ledger from which to view a block - - Default value: `./ledger` -* `-t`, `--type ` — The type of node to run: validator, prover, or client -* `--private-key ` — Specify the account private key of the node -* `--private-key-file ` — Specify the account private key of the node -* `--bind ` — Specify the IP(v4 or v6) address to bind to - - Default value: `0.0.0.0` -* `--node ` — Specify the IP address and port for the node server - - Default value: `4130` -* `--bft ` — Specify the IP address and port for the BFT - - Default value: `5000` -* `--rest ` — Specify the IP address and port for the REST server - - Default value: `3030` -* `--metrics ` — Specify the port for the metrics server - - Default value: `9000` -* `--peers ` — Specify the IP address and port of the peer(s) to connect to -* `--validators ` — Specify the IP address and port of the validator(s) to connect to -* `--rest-rps ` — Specify the requests per second (RPS) rate limit per IP for the REST server - - Default value: `1000` -* `--retention-policy ` — The retention policy for the checkpoint manager. i.e. how often to create checkpoints -* `--agent-rpc-port ` — When present, connects to an agent RPC server on the given port - - - ## `snarkos-aot auth` A command to help generate various different types of authorizations and execute them @@ -489,6 +449,9 @@ Authorize a program execution * `--record ` — The record for a private fee * `-q`, `--query ` — Query to load the program with * `--seed ` — The seed to use for the authorization generation +* `--cost-v1` — Enable cost v1 for the transaction cost estimation (v2 by default) + + Default value: `false` @@ -512,6 +475,9 @@ Authorize the fee for a program execution * `-i`, `--id ` — The ID of the deployment or program execution * `-c`, `--cost ` — Estimated cost of the deployment or program execution * `--seed ` — The seed to use for the authorization generation +* `--cost-v1` — Enable cost v1 for the transaction cost estimation (v2 by default) + + Default value: `false` @@ -554,11 +520,14 @@ Estimate the cost of a program execution or deployment ###### **Options:** -* `--query ` — The query to use for the program +* `-q`, `--query ` — The query to use for the program * `-a`, `--auth ` — Authorization for an execution of some kind * `-f`, `--fee-auth ` — The optional fee authorization for said execution * `-o`, `--owner ` — The owner of the program if deploying * `-d`, `--deployment ` — The deployment of the program if deploying +* `--cost-v1` — Enable cost v1 for the transaction cost estimation (v2 by default) + + Default value: `false` @@ -585,6 +554,9 @@ Deploy a program to the network * `--record ` — The record for a private fee * `-q`, `--query ` — The query to use for the program * `--seed ` — The seed to use for the authorization generation +* `--cost-v1` — Enable cost v1 for the transaction cost estimation (v2 by default) + + Default value: `false` @@ -666,6 +638,9 @@ Compute the cost to execute a function in a given program ###### **Options:** * `-q`, `--query ` — Query to load the program with +* `--cost-v1` — Enable cost v1 for the transaction cost estimation (v2 by default) + + Default value: `false` @@ -697,6 +672,46 @@ For generating cli markdown. Only with the clipages feature enabled +## `snarkos-aot run` + +A wrapper around the snarkos node run commands that provide additional logging and configurability + +**Usage:** `snarkos-aot run [OPTIONS] --ledger --type <--private-key |--private-key-file >` + +###### **Options:** + +* `-g`, `--genesis ` — A path to the genesis block to initialize the ledger from +* `-l`, `--ledger ` — The ledger from which to view a block + + Default value: `./ledger` +* `-t`, `--type ` — The type of node to run: validator, prover, or client +* `--private-key ` — Specify the account private key of the node +* `--private-key-file ` — Specify the account private key of the node +* `--bind ` — Specify the IP(v4 or v6) address to bind to + + Default value: `0.0.0.0` +* `--node ` — Specify the IP address and port for the node server + + Default value: `4130` +* `--bft ` — Specify the IP address and port for the BFT + + Default value: `5000` +* `--rest ` — Specify the IP address and port for the REST server + + Default value: `3030` +* `--metrics ` — Specify the port for the metrics server + + Default value: `9000` +* `--peers ` — Specify the IP address and port of the peer(s) to connect to +* `--validators ` — Specify the IP address and port of the validator(s) to connect to +* `--rest-rps ` — Specify the requests per second (RPS) rate limit per IP for the REST server + + Default value: `1000` +* `--retention-policy ` — The retention policy for the checkpoint manager. i.e. how often to create checkpoints +* `--agent-rpc-port ` — When present, connects to an agent RPC server on the given port + + +
diff --git a/snops_book/user_guide/clis/SNOPS_CLI.md b/snops_book/user_guide/clis/SNOPS_CLI.md index f5d6bf53..305d778e 100644 --- a/snops_book/user_guide/clis/SNOPS_CLI.md +++ b/snops_book/user_guide/clis/SNOPS_CLI.md @@ -12,6 +12,7 @@ This document contains the help content for the `snops-cli` command-line program * [`snops-cli agent kill`↴](#snops-cli-agent-kill) * [`snops-cli agent list`↴](#snops-cli-agent-list) * [`snops-cli agent tps`↴](#snops-cli-agent-tps) +* [`snops-cli agent status`↴](#snops-cli-agent-status) * [`snops-cli agent set-log-level`↴](#snops-cli-agent-set-log-level) * [`snops-cli agent set-snarkos-log-level`↴](#snops-cli-agent-set-snarkos-log-level) * [`snops-cli env`↴](#snops-cli-env) @@ -30,17 +31,18 @@ This document contains the help content for the `snops-cli` command-line program * [`snops-cli env height`↴](#snops-cli-env-height) * [`snops-cli env transaction`↴](#snops-cli-env-transaction) * [`snops-cli env transaction-details`↴](#snops-cli-env-transaction-details) -* [`snops-cli env clean`↴](#snops-cli-env-clean) +* [`snops-cli env delete`↴](#snops-cli-env-delete) * [`snops-cli env info`↴](#snops-cli-env-info) * [`snops-cli env list`↴](#snops-cli-env-list) * [`snops-cli env topology`↴](#snops-cli-env-topology) * [`snops-cli env topology-resolved`↴](#snops-cli-env-topology-resolved) -* [`snops-cli env prepare`↴](#snops-cli-env-prepare) +* [`snops-cli env apply`↴](#snops-cli-env-apply) * [`snops-cli env mapping`↴](#snops-cli-env-mapping) * [`snops-cli env mappings`↴](#snops-cli-env-mappings) * [`snops-cli env program`↴](#snops-cli-env-program) * [`snops-cli env storage`↴](#snops-cli-env-storage) * [`snops-cli set-log-level`↴](#snops-cli-set-log-level) +* [`snops-cli events`↴](#snops-cli-events) * [`snops-cli man`↴](#snops-cli-man) * [`snops-cli md`↴](#snops-cli-md) @@ -53,7 +55,8 @@ This document contains the help content for the `snops-cli` command-line program * `autocomplete` — Generate shell completions * `agent` — For interacting with snop agents * `env` — For interacting with snop environments -* `set-log-level` — +* `set-log-level` — +* `events` — Listen to events from the control plane, optionally filtered * `man` — For generating cli manpages. Only with the mangen feature enabled * `md` — For generating cli markdown. Only with the clipages feature enabled @@ -93,8 +96,9 @@ For interacting with snop agents * `kill` — Kill the specific agent * `list` — List all agents. Ignores the agent id * `tps` — Get the specific agent's TPS -* `set-log-level` — -* `set-snarkos-log-level` — +* `status` — Get the specific agent's status +* `set-log-level` — Set the log level of the agent +* `set-snarkos-log-level` — Set the log level of the node running on an agent ###### **Arguments:** @@ -156,8 +160,18 @@ Get the specific agent's TPS +## `snops-cli agent status` + +Get the specific agent's status + +**Usage:** `snops-cli agent status` + + + ## `snops-cli agent set-log-level` +Set the log level of the agent + **Usage:** `snops-cli agent set-log-level ` ###### **Arguments:** @@ -168,6 +182,8 @@ Get the specific agent's TPS ## `snops-cli agent set-snarkos-log-level` +Set the log level of the node running on an agent + **Usage:** `snops-cli agent set-snarkos-log-level ` ###### **Arguments:** @@ -184,21 +200,21 @@ For interacting with snop environments ###### **Subcommands:** -* `action` — Actions you can apply on a specific environment +* `action` — Run an action on an environment * `agent` — Get an env's specific agent by * `agents` — List an env's agents -* `auth` — +* `auth` — * `balance` — Lookup an account's balance * `block` — Lookup a block or get the latest block * `height` — Get the latest height from all agents in the env * `transaction` — Lookup a transaction's block by a transaction id * `transaction-details` — Lookup a transaction's details by a transaction id -* `clean` — Clean a specific environment +* `delete` — Delete a specific environment * `info` — Get an env's latest block/state root info * `list` — List all environments. Ignores the env id * `topology` — Show the current topology of a specific environment * `topology-resolved` — Show the resolved topology of a specific environment. Shows only internal agents -* `prepare` — Prepare a (test) environment +* `apply` — Apply an environment spec * `mapping` — Lookup a mapping by program id and mapping name * `mappings` — Lookup a program's mappings only * `program` — Lookup a program by its id @@ -214,7 +230,7 @@ For interacting with snop environments ## `snops-cli env action` -Actions you can apply on a specific environment +Run an action on an environment **Usage:** `snops-cli env action ` @@ -233,11 +249,15 @@ Actions you can apply on a specific environment Turn the specified agents(and nodes) offline -**Usage:** `snops-cli env action offline [NODES]...` +**Usage:** `snops-cli env action offline [OPTIONS] [NODES]...` ###### **Arguments:** -* `` +* `` — The nodes to take offline. (eg. `validator/any`) + +###### **Options:** + +* `--async` — When present, don't wait for reconciles to finish before returning @@ -245,11 +265,15 @@ Turn the specified agents(and nodes) offline Turn the specified agents(and nodes) online -**Usage:** `snops-cli env action online [NODES]...` +**Usage:** `snops-cli env action online [OPTIONS] [NODES]...` ###### **Arguments:** -* `` +* `` — The nodes to turn online (eg. `validator/any`) + +###### **Options:** + +* `--async` — When present, don't wait for reconciles to finish before returning @@ -257,11 +281,15 @@ Turn the specified agents(and nodes) online Reboot the specified agents(and nodes) -**Usage:** `snops-cli env action reboot [NODES]...` +**Usage:** `snops-cli env action reboot [OPTIONS] [NODES]...` ###### **Arguments:** -* `` +* `` — The nodes to reboot (eg. `validator/any`) + +###### **Options:** + +* `--async` — When present, don't wait for reconciles to finish before returning @@ -278,7 +306,7 @@ Execute an aleo program function on the environment. i.e. credits.aleo/transfer_ ###### **Options:** -* `-p`, `--private-key ` — Private key to use, can be `committee.0` to use committee member 0's key +* `--private-key ` — Private key to use, can be `committee.0` to use committee member 0's key * `--fee-private-key ` — Private key to use for the fee. Defaults to the same as --private-key * `-c`, `--cannon ` — Desired cannon to fire the transaction * `--priority-fee ` — The optional priority fee to use @@ -316,7 +344,7 @@ Configure the state of the target nodes ###### **Arguments:** -* `` — The nodes to configure +* `` — The nodes to configure. (eg. `validator/any`) ###### **Options:** @@ -327,6 +355,11 @@ Configure the state of the target nodes * `--height ` — Configure the height of the target nodes * `-p`, `--peers ` — Configure the peers of the target nodes, or `none` * `-v`, `--validators ` — Configure the validators of the target nodes, or `none` +* `-e`, `--env ` — Set environment variables for a node: `--env FOO=bar` +* `-d`, `--del-env ` +* `-b`, `--binary ` — Configure the binary for a node +* `--private-key ` — Configure the private key for a node +* `--async` @@ -425,11 +458,11 @@ Lookup a transaction's details by a transaction id -## `snops-cli env clean` +## `snops-cli env delete` -Clean a specific environment +Delete a specific environment -**Usage:** `snops-cli env clean` +**Usage:** `snops-cli env delete` @@ -465,15 +498,19 @@ Show the resolved topology of a specific environment. Shows only internal agents -## `snops-cli env prepare` +## `snops-cli env apply` -Prepare a (test) environment +Apply an environment spec -**Usage:** `snops-cli env prepare ` +**Usage:** `snops-cli env apply [OPTIONS] ` ###### **Arguments:** -* `` — The test spec file +* `` — The environment spec file + +###### **Options:** + +* `--async` — When present, don't wait for reconciles to finish before returning @@ -533,6 +570,20 @@ Get an env's storage info +## `snops-cli events` + +Listen to events from the control plane, optionally filtered + +**Usage:** `snops-cli events [FILTER]` + +###### **Arguments:** + +* `` — The event filter to apply, such as `agent-connected` or `all-of(env-is(default),node-target-is(validator/any))` + + Default value: `unfiltered` + + + ## `snops-cli man` For generating cli manpages. Only with the mangen feature enabled