From bf05930fa84df293e81853acea7ac68d58360f9b Mon Sep 17 00:00:00 2001 From: mx <33262279+mfahampshire@users.noreply.github.com> Date: Wed, 23 Oct 2024 08:55:42 +0000 Subject: [PATCH] Max/individual command autodocs (#5018) * updated autodoc script * updated autodoc script for fix + reintroduced gitignore file for generated markdown * auto commit generated command files * auto commit generated command files * added command-outputs to autodoc script * fix merge conflicts * repush components --- documentation/autodoc/.gitignore | 1 + documentation/autodoc/README.md | 44 +++++++++++- documentation/autodoc/src/main.rs | 13 ++-- .../command-outputs/nym-api-build-info.md | 6 +- .../command-outputs/nym-api-init-help.md | 25 +++++++ .../command-outputs/nym-client-build-info.md | 6 +- .../nym-client-completions-help.md | 11 +++ .../nym-client-import-credential-help.md | 15 ++++ .../command-outputs/nym-client-init-help.md | 27 ++++++++ .../nym-client-list-gateways-help.md | 10 +++ .../command-outputs/nym-client-run-help.md | 21 ++++++ .../nym-client-switch-gateway-help.md | 10 +++ .../nym-node-bonding-information.md | 2 +- .../command-outputs/nym-node-build-info.md | 6 +- .../command-outputs/nym-node-migrate-help.md | 68 +++++++++++++++++++ .../command-outputs/nym-node-node-details.md | 2 +- .../command-outputs/nym-node-sign-help.md | 13 ++++ .../nym-socks5-client-add-gateway-help.md | 15 ++++ .../nym-socks5-client-build-info.md | 6 +- .../nym-socks5-client-completions-help.md | 11 +++ ...ym-socks5-client-import-credential-help.md | 15 ++++ .../nym-socks5-client-init-help.md | 44 ++++++++++++ .../nym-socks5-client-list-gateways-help.md | 10 +++ .../nym-socks5-client-run-help.md | 34 ++++++++++ .../nymvisor-add-upgrade-help.md | 19 ++++++ .../command-outputs/nymvisor-build-info.md | 6 +- .../command-outputs/nymvisor-config-help.md | 9 +++ .../nymvisor-daemon-build-info-help.md | 9 +++ .../command-outputs/nymvisor-init-help.md | 48 +++++++++++++ .../developers/clients/socks5/commands.mdx | 6 +- .../developers/clients/websocket/commands.mdx | 6 +- .../developers/tools/nym-cli/commands.mdx | 32 ++------- documentation/scripts/next-scripts/autodoc.sh | 7 +- 33 files changed, 496 insertions(+), 61 deletions(-) create mode 100644 documentation/autodoc/.gitignore create mode 100644 documentation/docs/components/outputs/command-outputs/nym-api-init-help.md create mode 100644 documentation/docs/components/outputs/command-outputs/nym-client-completions-help.md create mode 100644 documentation/docs/components/outputs/command-outputs/nym-client-import-credential-help.md create mode 100644 documentation/docs/components/outputs/command-outputs/nym-client-init-help.md create mode 100644 documentation/docs/components/outputs/command-outputs/nym-client-list-gateways-help.md create mode 100644 documentation/docs/components/outputs/command-outputs/nym-client-run-help.md create mode 100644 documentation/docs/components/outputs/command-outputs/nym-client-switch-gateway-help.md create mode 100644 documentation/docs/components/outputs/command-outputs/nym-node-migrate-help.md create mode 100644 documentation/docs/components/outputs/command-outputs/nym-node-sign-help.md create mode 100644 documentation/docs/components/outputs/command-outputs/nym-socks5-client-add-gateway-help.md create mode 100644 documentation/docs/components/outputs/command-outputs/nym-socks5-client-completions-help.md create mode 100644 documentation/docs/components/outputs/command-outputs/nym-socks5-client-import-credential-help.md create mode 100644 documentation/docs/components/outputs/command-outputs/nym-socks5-client-init-help.md create mode 100644 documentation/docs/components/outputs/command-outputs/nym-socks5-client-list-gateways-help.md create mode 100644 documentation/docs/components/outputs/command-outputs/nym-socks5-client-run-help.md create mode 100644 documentation/docs/components/outputs/command-outputs/nymvisor-add-upgrade-help.md create mode 100644 documentation/docs/components/outputs/command-outputs/nymvisor-config-help.md create mode 100644 documentation/docs/components/outputs/command-outputs/nymvisor-daemon-build-info-help.md create mode 100644 documentation/docs/components/outputs/command-outputs/nymvisor-init-help.md diff --git a/documentation/autodoc/.gitignore b/documentation/autodoc/.gitignore new file mode 100644 index 0000000000..6c2b344c84 --- /dev/null +++ b/documentation/autodoc/.gitignore @@ -0,0 +1 @@ +autodoc-generated-markdown/* diff --git a/documentation/autodoc/README.md b/documentation/autodoc/README.md index 5e8fd6f837..66ed20eeb1 100644 --- a/documentation/autodoc/README.md +++ b/documentation/autodoc/README.md @@ -1,4 +1,44 @@ -# `autodoc` +# Autodoc -Command output documentation generator WIP +WIP command output documentation generator. Run via `../scripts/next-scripts/autodoc.sh` to create a bunch of markdown files which are then moved around for importing into the documentation. +## `Error: Os { code: 2, kind: NotFound, message: "No such file or directory" }` +If you run into this error, make sure that you have the following directory structure: + +```sh +autodoc/ +├── autodoc-generated-markdown/ +│ └── commands/ +├── Cargo.toml +├── README.md +└── src + └── main.rs +``` + +And if you don't - create it and re-run. + +If you are encountering this error with this dir structure in place, check that all Nym binaries that are listed in `main.rs` also exist in `nym/target/release/`. + +Run this crate on its own with `debug` logging and it should panic on the missing binary: + +```sh + RUST_LOG="debug" cargo run --release + Finished `release` profile [optimized] target(s) in 0.20s + Running `/home/______/src/nym/target/release/autodoc` +[2024-10-23T08:11:01Z DEBUG autodoc] now running Some( + "nym-api", + ) +[2024-10-23T08:11:01Z DEBUG autodoc] stderr: " 2024-10-23T08:11:01.981Z INFO nym_api > Starting nym api...\n" +[2024-10-23T08:11:01Z DEBUG autodoc] stderr: " 2024-10-23T08:11:01.985Z INFO nym_api > Starting nym api...\n" +[2024-10-23T08:11:01Z INFO autodoc] SKIPPING ../../target/release/nym-api init +[2024-10-23T08:11:01Z INFO autodoc] creating own file for ../../target/release/nym-api init --help +[2024-10-23T08:11:01Z DEBUG autodoc] stderr: " 2024-10-23T08:11:01.993Z INFO nym_api > Starting nym api...\n" + +< snip > + +[2024-10-23T08:11:02Z DEBUG autodoc] now running Some( + "nym-cli", + ) +Error: Os { code: 2, kind: NotFound, message: "No such file or directory" } + +``` diff --git a/documentation/autodoc/src/main.rs b/documentation/autodoc/src/main.rs index 20235c5332..fda48a85f7 100644 --- a/documentation/autodoc/src/main.rs +++ b/documentation/autodoc/src/main.rs @@ -7,7 +7,6 @@ use std::{fs, vec}; const WRITE_PATH: &str = "./autodoc-generated-markdown/"; const COMMAND_PATH: &str = "./autodoc-generated-markdown/commands/"; - fn main() -> io::Result<()> { env_logger::init(); @@ -205,7 +204,7 @@ fn execute_command_own_file(main_command: &str, subcommand: &str) -> io::Result< .map(|metadata| metadata.is_dir()) .unwrap_or(false) { - fs::create_dir_all(WRITE_PATH)?; + fs::create_dir_all(COMMAND_PATH)?; } let mut file = File::create(format!( "{}/{}-{}.md", @@ -220,11 +219,11 @@ fn execute_command_own_file(main_command: &str, subcommand: &str) -> io::Result< "creating own file for {} {} --help", main_command, subcommand, ); - if !fs::metadata(WRITE_PATH) + if !fs::metadata(COMMAND_PATH) .map(|metadata| metadata.is_dir()) .unwrap_or(false) { - fs::create_dir_all(WRITE_PATH)?; + fs::create_dir_all(COMMAND_PATH)?; } let mut help_file = File::create(format!( "{}/{}-{}-help.md", @@ -247,15 +246,15 @@ fn execute_command_own_file(main_command: &str, subcommand: &str) -> io::Result< "creating own file for {} {} --help", main_command, subcommand, ); - if !fs::metadata(WRITE_PATH) + if !fs::metadata(COMMAND_PATH) .map(|metadata| metadata.is_dir()) .unwrap_or(false) { - fs::create_dir_all(WRITE_PATH)?; + fs::create_dir_all(COMMAND_PATH)?; } let mut help_file = File::create(format!( "{}/{}-{}-help.md", - WRITE_PATH, + COMMAND_PATH, last_word.unwrap(), subcommand ))?; diff --git a/documentation/docs/components/outputs/command-outputs/nym-api-build-info.md b/documentation/docs/components/outputs/command-outputs/nym-api-build-info.md index 6628c95008..6a8d95beb5 100644 --- a/documentation/docs/components/outputs/command-outputs/nym-api-build-info.md +++ b/documentation/docs/components/outputs/command-outputs/nym-api-build-info.md @@ -1,10 +1,10 @@ ```sh Binary Name: nym-api -Build Timestamp: 2024-10-22T15:51:54.341993905Z +Build Timestamp: 2024-10-23T08:50:32.539144092Z Build Version: 1.1.42 -Commit SHA: 0e7bbbf93b909bbf3fecd594213bc9b92aec24f1 -Commit Date: 2024-10-22T17:18:51.000000000+02:00 +Commit SHA: b960cbd978b9ffa17c884bce22f0e59c20b9aa01 +Commit Date: 2024-10-23T10:49:01.000000000+02:00 Commit Branch: max/individual-command-autodocs rustc Version: 1.80.0 rustc Channel: stable diff --git a/documentation/docs/components/outputs/command-outputs/nym-api-init-help.md b/documentation/docs/components/outputs/command-outputs/nym-api-init-help.md new file mode 100644 index 0000000000..bd4c714a28 --- /dev/null +++ b/documentation/docs/components/outputs/command-outputs/nym-api-init-help.md @@ -0,0 +1,25 @@ +```sh +Initialise a Nym Api instance with persistent config.toml file + +Usage: nym-api init [OPTIONS] + +Options: + --id + Id of the nym-api we want to initialise. if unspecified, a default value will be used. default: "default" [default: default] + -m, --enable-monitor + Specifies whether network monitoring is enabled on this API default: false + -r, --enable-rewarding + Specifies whether network rewarding is enabled on this API default: false + --nyxd-validator + Endpoint to nyxd instance used for contract information. default: http://localhost:26657 + --mnemonic + Mnemonic of the network monitor used for sending rewarding and zk-nyms transactions default: None + --enable-zk-nym + Flag to indicate whether credential signer authority is enabled on this API default: false + --announce-address + Announced address that is going to be put in the DKG contract where zk-nym clients will connect to obtain their credentials default: None + --monitor-credentials-mode + Set this nym api to work in a enabled credentials that would attempt to use gateway with the bandwidth credential requirement + -h, --help + Print help +``` diff --git a/documentation/docs/components/outputs/command-outputs/nym-client-build-info.md b/documentation/docs/components/outputs/command-outputs/nym-client-build-info.md index 9207a70b4b..c52340cf89 100644 --- a/documentation/docs/components/outputs/command-outputs/nym-client-build-info.md +++ b/documentation/docs/components/outputs/command-outputs/nym-client-build-info.md @@ -1,10 +1,10 @@ ```sh Binary Name: nym-client -Build Timestamp: 2024-10-22T15:51:54.341993905Z +Build Timestamp: 2024-10-23T08:50:32.539144092Z Build Version: 1.1.39 -Commit SHA: 0e7bbbf93b909bbf3fecd594213bc9b92aec24f1 -Commit Date: 2024-10-22T17:18:51.000000000+02:00 +Commit SHA: b960cbd978b9ffa17c884bce22f0e59c20b9aa01 +Commit Date: 2024-10-23T10:49:01.000000000+02:00 Commit Branch: max/individual-command-autodocs rustc Version: 1.80.0 rustc Channel: stable diff --git a/documentation/docs/components/outputs/command-outputs/nym-client-completions-help.md b/documentation/docs/components/outputs/command-outputs/nym-client-completions-help.md new file mode 100644 index 0000000000..f09b17f785 --- /dev/null +++ b/documentation/docs/components/outputs/command-outputs/nym-client-completions-help.md @@ -0,0 +1,11 @@ +```sh +Generate shell completions + +Usage: nym-client completions + +Arguments: + [possible values: bash, elvish, fish, power-shell, zsh] + +Options: + -h, --help Print help +``` diff --git a/documentation/docs/components/outputs/command-outputs/nym-client-import-credential-help.md b/documentation/docs/components/outputs/command-outputs/nym-client-import-credential-help.md new file mode 100644 index 0000000000..2e1b652e39 --- /dev/null +++ b/documentation/docs/components/outputs/command-outputs/nym-client-import-credential-help.md @@ -0,0 +1,15 @@ +```sh +Import a pre-generated credential + +Usage: nym-client import-credential --id <--credential-data |--credential-path > + +Options: + --id + Id of client that is going to import the credential + --credential-data + Explicitly provide the encoded credential data (as base58) + --credential-path + Specifies the path to file containing binary credential data + -h, --help + Print help +``` diff --git a/documentation/docs/components/outputs/command-outputs/nym-client-init-help.md b/documentation/docs/components/outputs/command-outputs/nym-client-init-help.md new file mode 100644 index 0000000000..3d58fe52c2 --- /dev/null +++ b/documentation/docs/components/outputs/command-outputs/nym-client-init-help.md @@ -0,0 +1,27 @@ +```sh +Initialise a Nym client. Do this first! + +Usage: nym-client init [OPTIONS] --id + +Options: + --id + Id of client we want to create config for + --gateway + Id of the gateway we are going to connect to + --force-tls-gateway + Specifies whether the client will attempt to enforce tls connection to the desired gateway + --latency-based-selection + Specifies whether the new gateway should be determined based by latency as opposed to being chosen uniformly + --nym-apis + Comma separated list of rest endpoints of the API validators + --disable-socket + Whether to not start the websocket [possible values: true, false] + -p, --port + Port for the socket (if applicable) to listen on in all subsequent runs + --host + Ip for the socket (if applicable) to listen for requests + -o, --output + [default: text] [possible values: text, json] + -h, --help + Print help +``` diff --git a/documentation/docs/components/outputs/command-outputs/nym-client-list-gateways-help.md b/documentation/docs/components/outputs/command-outputs/nym-client-list-gateways-help.md new file mode 100644 index 0000000000..2cddc84edc --- /dev/null +++ b/documentation/docs/components/outputs/command-outputs/nym-client-list-gateways-help.md @@ -0,0 +1,10 @@ +```sh +List all registered with gateways + +Usage: nym-client list-gateways [OPTIONS] --id + +Options: + --id Id of client we want to list gateways for + -o, --output [default: text] [possible values: text, json] + -h, --help Print help +``` diff --git a/documentation/docs/components/outputs/command-outputs/nym-client-run-help.md b/documentation/docs/components/outputs/command-outputs/nym-client-run-help.md new file mode 100644 index 0000000000..deb33eab62 --- /dev/null +++ b/documentation/docs/components/outputs/command-outputs/nym-client-run-help.md @@ -0,0 +1,21 @@ +```sh +Run the Nym client with provided configuration client optionally overriding set parameters + +Usage: nym-client run [OPTIONS] --id + +Options: + --id + Id of client we want to create config for + --gateway + Id of the gateway we want to connect to. If overridden, it is user's responsibility to ensure prior registration happened + --nym-apis + Comma separated list of rest endpoints of the API validators + --disable-socket + Whether to not start the websocket [possible values: true, false] + -p, --port + Port for the socket to listen on + --host + Ip for the socket (if applicable) to listen for requests + -h, --help + Print help +``` diff --git a/documentation/docs/components/outputs/command-outputs/nym-client-switch-gateway-help.md b/documentation/docs/components/outputs/command-outputs/nym-client-switch-gateway-help.md new file mode 100644 index 0000000000..53277ffdd2 --- /dev/null +++ b/documentation/docs/components/outputs/command-outputs/nym-client-switch-gateway-help.md @@ -0,0 +1,10 @@ +```sh +Change the currently active gateway. Note that you must have already registered with the new gateway! + +Usage: nym-client switch-gateway --id --gateway-id + +Options: + --id Id of client we want to list gateways for + --gateway-id Id of the gateway we want to switch to + -h, --help Print help +``` diff --git a/documentation/docs/components/outputs/command-outputs/nym-node-bonding-information.md b/documentation/docs/components/outputs/command-outputs/nym-node-bonding-information.md index 5c86ec9f3f..f85e516c4f 100644 --- a/documentation/docs/components/outputs/command-outputs/nym-node-bonding-information.md +++ b/documentation/docs/components/outputs/command-outputs/nym-node-bonding-information.md @@ -1,3 +1,3 @@ ```sh -2024-10-22T15:54:46.983520Z ERROR nym-node/src/config/upgrade_helpers.rs:16: Failed to finish upgrade - failed to load config file using path '/home/m/.nym/nym-nodes/default-nym-node/config/config.toml'. detailed message: No such file or directory (os error 2) +2024-10-23T08:52:51.392471Z ERROR nym-node/src/config/upgrade_helpers.rs:16: Failed to finish upgrade - failed to load config file using path '/home/m/.nym/nym-nodes/default-nym-node/config/config.toml'. detailed message: No such file or directory (os error 2) ``` diff --git a/documentation/docs/components/outputs/command-outputs/nym-node-build-info.md b/documentation/docs/components/outputs/command-outputs/nym-node-build-info.md index 6361719e7c..9713990ba3 100644 --- a/documentation/docs/components/outputs/command-outputs/nym-node-build-info.md +++ b/documentation/docs/components/outputs/command-outputs/nym-node-build-info.md @@ -1,10 +1,10 @@ ```sh Binary Name: nym-node -Build Timestamp: 2024-10-22T15:51:54.341993905Z +Build Timestamp: 2024-10-23T08:50:32.539144092Z Build Version: 1.1.6 -Commit SHA: 0e7bbbf93b909bbf3fecd594213bc9b92aec24f1 -Commit Date: 2024-10-22T17:18:51.000000000+02:00 +Commit SHA: b960cbd978b9ffa17c884bce22f0e59c20b9aa01 +Commit Date: 2024-10-23T10:49:01.000000000+02:00 Commit Branch: max/individual-command-autodocs rustc Version: 1.80.0 rustc Channel: stable diff --git a/documentation/docs/components/outputs/command-outputs/nym-node-migrate-help.md b/documentation/docs/components/outputs/command-outputs/nym-node-migrate-help.md new file mode 100644 index 0000000000..ee32ab638b --- /dev/null +++ b/documentation/docs/components/outputs/command-outputs/nym-node-migrate-help.md @@ -0,0 +1,68 @@ +```sh +Attempt to migrate an existing mixnode or gateway into a nym-node + +Usage: nym-node migrate [OPTIONS] <--id |--config-file > + +Arguments: + Type of node (mixnode or gateway) to migrate into a nym-node [possible values: mixnode, gateway] + +Options: + --id + Id of the node that's going to get migrated + --config-file + Path to a configuration file of the node that's going to get migrated + --preserve-id + Specify whether to preserve id of the imported node + --public-ips + Comma separated list of public ip addresses that will be announced to the nym-api and subsequently to the clients. In nearly all circumstances, it's going to be identical to the address you're going to use for bonding [env: NYMNODE_PUBLIC_IPS=] + --hostname + Optional hostname associated with this gateway that will be announced to the nym-api and subsequently to the clients [env: NYMNODE_HOSTNAME=] + --location + Optional **physical** location of this node's server. Either full country name (e.g. 'Poland'), two-letter alpha2 (e.g. 'PL'), three-letter alpha3 (e.g. 'POL') or three-digit numeric-3 (e.g. '616') can be provided [env: NYMNODE_LOCATION=] + --http-bind-address + Socket address this node will use for binding its http API. default: `0.0.0.0:8080` [env: NYMNODE_HTTP_BIND_ADDRESS=] + --landing-page-assets-path + Path to assets directory of custom landing page of this node [env: NYMNODE_HTTP_LANDING_ASSETS=] + --http-access-token + An optional bearer token for accessing certain http endpoints. Currently only used for prometheus metrics [env: NYMNODE_HTTP_ACCESS_TOKEN=] + --expose-system-info + Specify whether basic system information should be exposed. default: true [env: NYMNODE_HTTP_EXPOSE_SYSTEM_INFO=] [possible values: true, false] + --expose-system-hardware + Specify whether basic system hardware information should be exposed. default: true [env: NYMNODE_HTTP_EXPOSE_SYSTEM_HARDWARE=] [possible values: true, false] + --expose-crypto-hardware + Specify whether detailed system crypto hardware information should be exposed. default: true [env: NYMNODE_HTTP_EXPOSE_CRYPTO_HARDWARE=] [possible values: true, false] + --mixnet-bind-address + Address this node will bind to for listening for mixnet packets default: `0.0.0.0:1789` [env: NYMNODE_MIXNET_BIND_ADDRESS=] + --nym-api-urls + Addresses to nym APIs from which the node gets the view of the network [env: NYMNODE_NYM_APIS=] + --nyxd-urls + Addresses to nyxd chain endpoint which the node will use for chain interactions [env: NYMNODE_NYXD=] + --wireguard-enabled + Specifies whether the wireguard service is enabled on this node [env: NYMNODE_WG_ENABLED=] [possible values: true, false] + --wireguard-bind-address + Socket address this node will use for binding its wireguard interface. default: `0.0.0.0:51822` [env: NYMNODE_WG_BIND_ADDRESS=] + --wireguard-private-ip + Private IP address of the wireguard gateway. default: `10.1.0.1` [env: NYMNODE_WG_IP=] + --wireguard-announced-port + Port announced to external clients wishing to connect to the wireguard interface. Useful in the instances where the node is behind a proxy [env: NYMNODE_WG_ANNOUNCED_PORT=] + --wireguard-private-network-prefix + The prefix denoting the maximum number of the clients that can be connected via Wireguard. The maximum value for IPv4 is 32 and for IPv6 is 128 [env: NYMNODE_WG_PRIVATE_NETWORK_PREFIX=] + --verloc-bind-address + Socket address this node will use for binding its verloc API. default: `0.0.0.0:1790` [env: NYMNODE_VERLOC_BIND_ADDRESS=] + --entry-bind-address + Socket address this node will use for binding its client websocket API. default: `0.0.0.0:9000` [env: NYMNODE_ENTRY_BIND_ADDRESS=] + --announce-ws-port + Custom announced port for listening for websocket client traffic. If unspecified, the value from the `bind_address` will be used instead [env: NYMNODE_ENTRY_ANNOUNCE_WS_PORT=] + --announce-wss-port + If applicable, announced port for listening for secure websocket client traffic [env: NYMNODE_ENTRY_ANNOUNCE_WSS_PORT=] + --enforce-zk-nyms + Indicates whether this gateway is accepting only coconut credentials for accessing the mixnet or if it also accepts non-paying clients [env: NYMNODE_ENFORCE_ZK_NYMS=] [possible values: true, false] + --mnemonic + Custom cosmos wallet mnemonic used for zk-nym redemption. If no value is provided, a fresh mnemonic is going to be generated [env: NYMNODE_MNEMONIC=] + --upstream-exit-policy-url + Specifies the url for an upstream source of the exit policy used by this node [env: NYMNODE_UPSTREAM_EXIT_POLICY=] + --open-proxy + Specifies whether this exit node should run in 'open-proxy' mode and thus would attempt to resolve **ANY** request it receives [env: NYMNODE_OPEN_PROXY=] [possible values: true, false] + -h, --help + Print help +``` diff --git a/documentation/docs/components/outputs/command-outputs/nym-node-node-details.md b/documentation/docs/components/outputs/command-outputs/nym-node-node-details.md index f86fa652d3..7466abcc06 100644 --- a/documentation/docs/components/outputs/command-outputs/nym-node-node-details.md +++ b/documentation/docs/components/outputs/command-outputs/nym-node-node-details.md @@ -1,3 +1,3 @@ ```sh -2024-10-22T15:54:46.996863Z ERROR nym-node/src/config/upgrade_helpers.rs:16: Failed to finish upgrade - failed to load config file using path '/home/m/.nym/nym-nodes/default-nym-node/config/config.toml'. detailed message: No such file or directory (os error 2) +2024-10-23T08:52:51.411416Z ERROR nym-node/src/config/upgrade_helpers.rs:16: Failed to finish upgrade - failed to load config file using path '/home/m/.nym/nym-nodes/default-nym-node/config/config.toml'. detailed message: No such file or directory (os error 2) ``` diff --git a/documentation/docs/components/outputs/command-outputs/nym-node-sign-help.md b/documentation/docs/components/outputs/command-outputs/nym-node-sign-help.md new file mode 100644 index 0000000000..5d26baf2f2 --- /dev/null +++ b/documentation/docs/components/outputs/command-outputs/nym-node-sign-help.md @@ -0,0 +1,13 @@ +```sh +Use identity key of this node to sign provided message + +Usage: nym-node sign [OPTIONS] <--text |--contract-msg > + +Options: + --id Id of the nym-node to use [env: NYMNODE_ID=] [default: default-nym-node] + --config-file Path to a configuration file of this node [env: NYMNODE_CONFIG=] + --text Signs an arbitrary piece of text with your identity key + --contract-msg Signs a transaction-specific payload, that is going to be sent to the smart contract, with your identity key + -o, --output [default: text] [possible values: text, json] + -h, --help Print help +``` diff --git a/documentation/docs/components/outputs/command-outputs/nym-socks5-client-add-gateway-help.md b/documentation/docs/components/outputs/command-outputs/nym-socks5-client-add-gateway-help.md new file mode 100644 index 0000000000..ee209bdcb0 --- /dev/null +++ b/documentation/docs/components/outputs/command-outputs/nym-socks5-client-add-gateway-help.md @@ -0,0 +1,15 @@ +```sh +Add new gateway to this client + +Usage: nym-socks5-client add-gateway [OPTIONS] --id + +Options: + --id Id of client we want to add gateway for + --gateway-id Explicitly specify id of the gateway to register with. If unspecified, a random gateway will be chosen instead + --force-tls-gateway Specifies whether the client will attempt to enforce tls connection to the desired gateway + --latency-based-selection Specifies whether the new gateway should be determined based by latency as opposed to being chosen uniformly + --set-active Specify whether this new gateway should be set as the active one + --nym-apis Comma separated list of rest endpoints of the API validators + -o, --output [default: text] [possible values: text, json] + -h, --help Print help +``` diff --git a/documentation/docs/components/outputs/command-outputs/nym-socks5-client-build-info.md b/documentation/docs/components/outputs/command-outputs/nym-socks5-client-build-info.md index ece0dd0297..6bc9bbeb31 100644 --- a/documentation/docs/components/outputs/command-outputs/nym-socks5-client-build-info.md +++ b/documentation/docs/components/outputs/command-outputs/nym-socks5-client-build-info.md @@ -1,10 +1,10 @@ ```sh Binary Name: nym-socks5-client -Build Timestamp: 2024-10-22T15:51:54.341993905Z +Build Timestamp: 2024-10-23T08:50:32.539144092Z Build Version: 1.1.39 -Commit SHA: 0e7bbbf93b909bbf3fecd594213bc9b92aec24f1 -Commit Date: 2024-10-22T17:18:51.000000000+02:00 +Commit SHA: b960cbd978b9ffa17c884bce22f0e59c20b9aa01 +Commit Date: 2024-10-23T10:49:01.000000000+02:00 Commit Branch: max/individual-command-autodocs rustc Version: 1.80.0 rustc Channel: stable diff --git a/documentation/docs/components/outputs/command-outputs/nym-socks5-client-completions-help.md b/documentation/docs/components/outputs/command-outputs/nym-socks5-client-completions-help.md new file mode 100644 index 0000000000..8b780c6f17 --- /dev/null +++ b/documentation/docs/components/outputs/command-outputs/nym-socks5-client-completions-help.md @@ -0,0 +1,11 @@ +```sh +Generate shell completions + +Usage: nym-socks5-client completions + +Arguments: + [possible values: bash, elvish, fish, power-shell, zsh] + +Options: + -h, --help Print help +``` diff --git a/documentation/docs/components/outputs/command-outputs/nym-socks5-client-import-credential-help.md b/documentation/docs/components/outputs/command-outputs/nym-socks5-client-import-credential-help.md new file mode 100644 index 0000000000..2f7303c2e3 --- /dev/null +++ b/documentation/docs/components/outputs/command-outputs/nym-socks5-client-import-credential-help.md @@ -0,0 +1,15 @@ +```sh +Import a pre-generated credential + +Usage: nym-socks5-client import-credential --id <--credential-data |--credential-path > + +Options: + --id + Id of client that is going to import the credential + --credential-data + Explicitly provide the encoded credential data (as base58) + --credential-path + Specifies the path to file containing binary credential data + -h, --help + Print help +``` diff --git a/documentation/docs/components/outputs/command-outputs/nym-socks5-client-init-help.md b/documentation/docs/components/outputs/command-outputs/nym-socks5-client-init-help.md new file mode 100644 index 0000000000..b69ef5f77c --- /dev/null +++ b/documentation/docs/components/outputs/command-outputs/nym-socks5-client-init-help.md @@ -0,0 +1,44 @@ +```sh +Initialise a Nym client. Do this first! + +Usage: nym-socks5-client init [OPTIONS] --id --provider + +Options: + --id + Id of client we want to create config for + + --gateway + Id of the gateway we are going to connect to + + --force-tls-gateway + Specifies whether the client will attempt to enforce tls connection to the desired gateway + + --latency-based-selection + Specifies whether the new gateway should be determined based by latency as opposed to being chosen uniformly + + --nym-apis + Comma separated list of rest endpoints of the API validators + + --provider + Address of the socks5 provider to send messages to + + --use-reply-surbs + Specifies whether this client is going to use an anonymous sender tag for communication with the service provider. While this is going to hide its actual address information, it will make the actual communication slower and consume nearly double the bandwidth as it will require sending reply SURBs. + + Note that some service providers might not support this. + + [possible values: true, false] + + -p, --port + Port for the socket to listen on in all subsequent runs + + --host + The custom host on which the socks5 client will be listening for requests + + -o, --output + [default: text] + [possible values: text, json] + + -h, --help + Print help (see a summary with '-h') +``` diff --git a/documentation/docs/components/outputs/command-outputs/nym-socks5-client-list-gateways-help.md b/documentation/docs/components/outputs/command-outputs/nym-socks5-client-list-gateways-help.md new file mode 100644 index 0000000000..86921bcf67 --- /dev/null +++ b/documentation/docs/components/outputs/command-outputs/nym-socks5-client-list-gateways-help.md @@ -0,0 +1,10 @@ +```sh +List all registered with gateways + +Usage: nym-socks5-client list-gateways [OPTIONS] --id + +Options: + --id Id of client we want to list gateways for + -o, --output [default: text] [possible values: text, json] + -h, --help Print help +``` diff --git a/documentation/docs/components/outputs/command-outputs/nym-socks5-client-run-help.md b/documentation/docs/components/outputs/command-outputs/nym-socks5-client-run-help.md new file mode 100644 index 0000000000..2ffccb39ce --- /dev/null +++ b/documentation/docs/components/outputs/command-outputs/nym-socks5-client-run-help.md @@ -0,0 +1,34 @@ +```sh +Run the Nym client with provided configuration client optionally overriding set parameters + +Usage: nym-socks5-client run [OPTIONS] --id + +Options: + --id + Id of client we want to create config for + + --gateway + Id of the gateway we want to connect to. If overridden, it is user's responsibility to ensure prior registration happened + + --nym-apis + Comma separated list of rest endpoints of the API validators + + --use-anonymous-replies + Specifies whether this client is going to use an anonymous sender tag for communication with the service provider. While this is going to hide its actual address information, it will make the actual communication slower and consume nearly double the bandwidth as it will require sending reply SURBs. + + Note that some service providers might not support this. + + [possible values: true, false] + + --provider + Address of the socks5 provider to send messages to + + -p, --port + Port for the socket to listen on + + --host + The custom host on which the socks5 client will be listening for requests + + -h, --help + Print help (see a summary with '-h') +``` diff --git a/documentation/docs/components/outputs/command-outputs/nymvisor-add-upgrade-help.md b/documentation/docs/components/outputs/command-outputs/nymvisor-add-upgrade-help.md new file mode 100644 index 0000000000..b88f5e1052 --- /dev/null +++ b/documentation/docs/components/outputs/command-outputs/nymvisor-add-upgrade-help.md @@ -0,0 +1,19 @@ +```sh +Queues up another upgrade for the associated daemon + +Usage: nymvisor add-upgrade [OPTIONS] --upgrade-name + +Arguments: + Path to the daemon's upgrade executable + +Options: + --upgrade-name Name of this upgrade + --force Overwrite existing upgrade binary / upgrade-info.json file + --add-binary Indicate that this command should only add binary to an *existing* scheduled upgrade + --now Force the upgrade to happen immediately + --publish-date Specifies the publish date metadata field of this upgrade. If unset, the current time will be used + --upgrade-time Specifies the time at which the provided upgrade will be performed (RFC3339 formatted). If left unset, the upgrade will be performed in 15min + --upgrade-delay Specifies delay until the provided upgrade is going to get performed. If let unset, the upgrade will be performed in 15min + -o, --output [default: text] [possible values: text, json] + -h, --help Print help +``` diff --git a/documentation/docs/components/outputs/command-outputs/nymvisor-build-info.md b/documentation/docs/components/outputs/command-outputs/nymvisor-build-info.md index ebdfc8f32e..27bcb90e4d 100644 --- a/documentation/docs/components/outputs/command-outputs/nymvisor-build-info.md +++ b/documentation/docs/components/outputs/command-outputs/nymvisor-build-info.md @@ -1,10 +1,10 @@ ```sh Binary Name: nymvisor -Build Timestamp: 2024-10-22T15:51:54.341993905Z +Build Timestamp: 2024-10-23T08:50:32.539144092Z Build Version: 0.1.5 -Commit SHA: 0e7bbbf93b909bbf3fecd594213bc9b92aec24f1 -Commit Date: 2024-10-22T17:18:51.000000000+02:00 +Commit SHA: b960cbd978b9ffa17c884bce22f0e59c20b9aa01 +Commit Date: 2024-10-23T10:49:01.000000000+02:00 Commit Branch: max/individual-command-autodocs rustc Version: 1.80.0 rustc Channel: stable diff --git a/documentation/docs/components/outputs/command-outputs/nymvisor-config-help.md b/documentation/docs/components/outputs/command-outputs/nymvisor-config-help.md new file mode 100644 index 0000000000..696d346802 --- /dev/null +++ b/documentation/docs/components/outputs/command-outputs/nymvisor-config-help.md @@ -0,0 +1,9 @@ +```sh +Show configuration options being used by this instance of nymvisor + +Usage: nymvisor config [OPTIONS] + +Options: + -o, --output [default: text] [possible values: text, json] + -h, --help Print help +``` diff --git a/documentation/docs/components/outputs/command-outputs/nymvisor-daemon-build-info-help.md b/documentation/docs/components/outputs/command-outputs/nymvisor-daemon-build-info-help.md new file mode 100644 index 0000000000..c89ba02c59 --- /dev/null +++ b/documentation/docs/components/outputs/command-outputs/nymvisor-daemon-build-info-help.md @@ -0,0 +1,9 @@ +```sh +Show build information of the associated daemon + +Usage: nymvisor daemon-build-info [OPTIONS] + +Options: + -o, --output [default: text] [possible values: text, json] + -h, --help Print help +``` diff --git a/documentation/docs/components/outputs/command-outputs/nymvisor-init-help.md b/documentation/docs/components/outputs/command-outputs/nymvisor-init-help.md new file mode 100644 index 0000000000..8e373fc42c --- /dev/null +++ b/documentation/docs/components/outputs/command-outputs/nymvisor-init-help.md @@ -0,0 +1,48 @@ +```sh +Initialise a nymvisor instance with persistent Config.toml file + +Usage: nymvisor init [OPTIONS] + +Arguments: + Path to the daemon's executable + +Options: + --id + ID specifies the human readable ID of this particular nymvisor instance. Can be overridden with $NYMVISOR_ID environmental variable + --upstream-base-upgrade-url + Sets the base url of the upstream source for obtaining upgrade information for the deaemon. It will be used fo constructing the full url, i.e. $NYMVISOR_UPSTREAM_BASE_UPGRADE_URL/$DAEMON_NAME/upgrade-info.json Can be overridden with $NYMVISOR_UPSTREAM_BASE_UPGRADE_URL environmental variable + --upstream-polling-rate + Specifies the rate of polling the upstream url for upgrade information. default: 1h Can be overridden with $NYMVISOR_UPSTREAM_POLLING_RATE + --disable-nymvisor-logs + If enabled, this will disable `nymvisor` logs (but not the underlying process) Can be overridden with $NYMVISOR_DISABLE_LOGS environmental variable + --upgrade-data-directory + Set custom directory for upgrade data - binaries and upgrade plans. If not set, the global nymvisors' data directory will be used instead. Can be overridden with $NYMVISOR_UPGRADE_DATA_DIRECTORY environmental variable + --daemon-home + The location where the `nymvisor/` directory is kept that contains the auxiliary files associated with the underlying daemon, such as any backups or current version information. (e.g. $HOME/.nym/nym-api/my-nym-api, $HOME/.nym/mixnodes/my-mixnode, etc.). Can be overridden with $DAEMON_HOME environmental variable + --daemon-absolute-upstream-upgrade-url + Override url to the upstream source for upgrade plans for this daeamon. The Url has to point to an endpoint containing a valid [`UpgradeInfo`] json. Note: if set this takes precedence over `upstream_base_upgrade_url` Can be overridden with $DAEMON_ABSOLUTE_UPSTREAM_UPGRADE_URL environmental variable + --allow-download-upgrade-binaries + If set to true, this will enable auto-downloading of new binaries using the url provided in the `upgrade-info.json` Can be overridden with $DAEMON_ALLOW_BINARIES_DOWNLOAD environmental variable [possible values: true, false] + --enforce-download-checksum + If enabled nymvisor will require that a checksum is provided in the upgrade plan for the binary to be downloaded. If disabled, nymvisor will not require a checksum to be provided, but still check the checksum if one is provided. Can be overridden with $DAEMON_ENFORCE_DOWNLOAD_CHECKSUM environmental variable [possible values: true, false] + --restart-daemon-after-upgrade + If enabled, nymvisor will restart the subprocess with the same command-line arguments and flags (but with the new binary) after a successful upgrade. Otherwise (if disabled), nymvisor will stop running after an upgrade and will require the system administrator to manually restart it. Note restart is only after the upgrade and does not auto-restart the subprocess after an error occurs. Can be overridden with $DAEMON_RESTART_AFTER_UPGRADE environmental variable [possible values: true, false] + --restart-daemon-on-failure + If enabled, nymvisor will restart the subprocess with the same command-line arguments and flags after it has crashed Can be overridden with $DAEMON_RESTART_ON_FAILURE environmental variable + --on-failure-daemon-restart-delay + If `restart_on_failure` is enabled, the following value defines the amount of time `nymvisor` shall wait before restarting the subprocess. Can be overridden with $DAEMON_FAILURE_RESTART_DELAY environmental variable + --max-daemon-startup-failures + Defines the maximum number of startup failures the subprocess can experience in a quick succession before no further restarts will be attempted and `nymvisor` will exit. Can be overridden with $DAEMON_MAX_STARTUP_FAILURES environmental variable + --startup-period-duration + Defines the length of time during which the subprocess is still considered to be in the startup phase when its failures are going to be considered in `max_startup_failures`. Can be overridden with $DAEMON_STARTUP_PERIOD_DURATION environmental variable + --daemon-shutdown-grace-period + Specifies the amount of time `nymvisor` is willing to wait for the subprocess to undergo graceful shutdown after receiving an interrupt (for either an upgrade or shutdown of the `nymvisor` itself) Once the time passes, a kill signal is going to be sent instead. Can be overridden with $DAEMON_SHUTDOWN_GRACE_PERIOD environmental variable + --daemon-backup-data-directory + Set custom backup directory for daemon data. If not set, the daemon's home directory will be used instead. Can be overridden with $DAEMON_BACKUP_DATA_DIRECTORY environmental variable + --unsafe-skip-backup + If enabled, `nymvisor` will perform upgrades directly without performing any backups. default: false Can be overridden with $DAEMON_UNSAFE_SKIP_BACKUP environmental variable + -o, --output + [default: text] [possible values: text, json] + -h, --help + Print help +``` diff --git a/documentation/docs/pages/developers/clients/socks5/commands.mdx b/documentation/docs/pages/developers/clients/socks5/commands.mdx index 28b5a80195..e469ef88c6 100644 --- a/documentation/docs/pages/developers/clients/socks5/commands.mdx +++ b/documentation/docs/pages/developers/clients/socks5/commands.mdx @@ -168,10 +168,10 @@ Example output: ```sh Binary Name: nym-socks5-client -Build Timestamp: 2024-10-22T15:51:54.341993905Z +Build Timestamp: 2024-10-23T08:50:32.539144092Z Build Version: 1.1.39 -Commit SHA: 0e7bbbf93b909bbf3fecd594213bc9b92aec24f1 -Commit Date: 2024-10-22T17:18:51.000000000+02:00 +Commit SHA: b960cbd978b9ffa17c884bce22f0e59c20b9aa01 +Commit Date: 2024-10-23T10:49:01.000000000+02:00 Commit Branch: max/individual-command-autodocs rustc Version: 1.80.0 rustc Channel: stable diff --git a/documentation/docs/pages/developers/clients/websocket/commands.mdx b/documentation/docs/pages/developers/clients/websocket/commands.mdx index fb52fcb3cd..77c7984305 100644 --- a/documentation/docs/pages/developers/clients/websocket/commands.mdx +++ b/documentation/docs/pages/developers/clients/websocket/commands.mdx @@ -133,10 +133,10 @@ Example output: ```sh Binary Name: nym-client -Build Timestamp: 2024-10-22T15:51:54.341993905Z +Build Timestamp: 2024-10-23T08:50:32.539144092Z Build Version: 1.1.39 -Commit SHA: 0e7bbbf93b909bbf3fecd594213bc9b92aec24f1 -Commit Date: 2024-10-22T17:18:51.000000000+02:00 +Commit SHA: b960cbd978b9ffa17c884bce22f0e59c20b9aa01 +Commit Date: 2024-10-23T10:49:01.000000000+02:00 Commit Branch: max/individual-command-autodocs rustc Version: 1.80.0 rustc Channel: stable diff --git a/documentation/docs/pages/developers/tools/nym-cli/commands.mdx b/documentation/docs/pages/developers/tools/nym-cli/commands.mdx index 52461f8b7c..8668c9d8ea 100644 --- a/documentation/docs/pages/developers/tools/nym-cli/commands.mdx +++ b/documentation/docs/pages/developers/tools/nym-cli/commands.mdx @@ -303,14 +303,10 @@ Usage: nym-cli ecash [OPTIONS] nym-cli ecash Commands: - issue-ticket-book - recover-ticket-book - import-ticket-book - generate-ticket - import-coin-index-signatures - import-expiration-date-signatures - import-master-verification-key - help Print this message or the help of the given subcommand(s) + issue-ticket-book + recover-ticket-book + import-ticket-book + help Print this message or the help of the given subcommand(s) Options: --mnemonic @@ -331,7 +327,7 @@ Options: ### `ecash issue-ticket-book` ```sh -Usage: nym-cli ecash issue-ticket-book [OPTIONS] <--client-config |--output-file > +Usage: nym-cli ecash issue-ticket-book [OPTIONS] --client-config Options: --mnemonic @@ -344,24 +340,12 @@ Options: Config file of the client that is supposed to use the credential --nyxd-url Overrides the nyxd URL provided either as an environment variable NYXD_VALIDATOR or in a config file - --output-file - Output file for the ticketbook - --bs58-output - Specifies whether the output file should use binary or bs58 encoded data --nym-api-url Overrides the validator API URL provided either as an environment variable API_VALIDATOR or in a config file - --include-expiration-date-signatures - Specifies whether the file output should contain expiration date signatures --mixnet-contract-address Overrides the mixnet contract address provided either as an environment variable or in a config file - --include-coin-index-signatures - Specifies whether the file output should contain coin index signatures --vesting-contract-address Overrides the vesting contract address provided either as an environment variable or in a config file - --include-master-verification-key - Specifies whether the file output should contain master verification key - --bs58-encoded-client-secret - Secret value that's used for deriving underlying ecash keypair -h, --help Print help ``` @@ -391,7 +375,7 @@ Options: ### `ecash import-ticket-book` ```sh -Usage: nym-cli ecash import-ticket-book [OPTIONS] --client-config <--credential-data |--credential-path > <--standalone|--full> +Usage: nym-cli ecash import-ticket-book [OPTIONS] --client-config <--credential-data |--credential-path > Options: --client-config @@ -408,10 +392,6 @@ Options: Overrides the nyxd URL provided either as an environment variable NYXD_VALIDATOR or in a config file --nym-api-url Overrides the validator API URL provided either as an environment variable API_VALIDATOR or in a config file - --standalone - Specifies whether we're attempting to import a standalone ticketbook (i.e. serialised `IssuedTicketBook`) - --full - Specifies whether we're attempting to import full ticketboot (i.e. one that **might** contain required global signatures; that is serialised `ImportableTicketBook`) --mixnet-contract-address Overrides the mixnet contract address provided either as an environment variable or in a config file --vesting-contract-address diff --git a/documentation/scripts/next-scripts/autodoc.sh b/documentation/scripts/next-scripts/autodoc.sh index a0c88acf17..b04fff82cf 100755 --- a/documentation/scripts/next-scripts/autodoc.sh +++ b/documentation/scripts/next-scripts/autodoc.sh @@ -7,7 +7,8 @@ set -o nounset set -o pipefail # make sure we have all the binaries built -cd ../../ && cargo build --release && +cd ../../ && cargo build --release && cd tools/nym-cli && cargo build --release && cd ../../ && + # run autodoc script cd documentation/autodoc/ && cargo run --release && @@ -17,9 +18,9 @@ cd ../../ && cargo build --release && mv autodoc-generated-markdown/commands/* ../docs/components/outputs/command-outputs/ && # commit files to git: needed for remote deployment from branch - if ! git diff --quiet -- "../docs/pages/developers/tools" "../docs/pages/developers/clients/websocket" "../docs/pages/developers/clients/socks5"; then + if ! git diff --quiet -- "../docs/pages/developers/tools" "../docs/pages/developers/clients/websocket" "../docs/pages/developers/clients/socks5" "../docs/components/outputs/command-outputs/"; then printf "commiting changes" - git add ../docs/pages/developers/ + git add ../docs/pages/developers/ ../docs/components/outputs/command-outputs/ git commit -m "auto commit generated command files" git push origin HEAD else