sort of working

This commit is contained in:
mfahampshire
2024-05-14 22:37:05 +02:00
parent c47248fd74
commit 4993c7341c
7 changed files with 3084 additions and 6 deletions
@@ -0,0 +1,88 @@
# `nym-api` Binary Commands
These docs are autogenerated by the `autodocs` script.
**TODO add link**
```
Starting nym api...
Usage: nym-api [OPTIONS] <COMMAND>
Commands:
init Initialise a Nym Api instance with persistent config.toml file
run Run the Nym Api with provided configuration optionally overriding set parameters
build-info Show build information of this binary
help Print this message or the help of the given subcommand(s)
Options:
-c, --config-env-file <CONFIG_ENV_FILE> Path pointing to an env file that configures the Nym API
-h, --help Print help
-V, --version Print version
```
### `init`
```
Starting nym api...
Initialise a Nym Api instance with persistent config.toml file
Usage: nym-api init [OPTIONS]
Options:
--id <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 <NYXD_VALIDATOR>
Endpoint to nyxd instance used for contract information. default: http://localhost:26657
--mnemonic <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 <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
```
### `run`
```
Starting nym api...
Run the Nym Api with provided configuration optionally overriding set parameters
Usage: nym-api run [OPTIONS]
Options:
--id <ID>
Id of the nym-api we want to run.if unspecified, a default value will be used. default: "default" [default: default]
-m, --enable-monitor <ENABLE_MONITOR>
Specifies whether network monitoring is enabled on this API default: None - config value will be used instead [possible values: true, false]
-r, --enable-rewarding <ENABLE_REWARDING>
Specifies whether network rewarding is enabled on this API default: None - config value will be used instead [possible values: true, false]
--nyxd-validator <NYXD_VALIDATOR>
Endpoint to nyxd instance used for contract information. default: None - config value will be used instead
--mnemonic <MNEMONIC>
Mnemonic of the network monitor used for sending rewarding and zk-nyms transactions default: None - config value will be used instead
--enable-zk-nym <ENABLE_ZK_NYM>
Flag to indicate whether coconut signer authority is enabled on this API default: None - config value will be used instead [possible values: true, false]
--announce-address <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 - config value will be used instead
--monitor-credentials-mode <MONITOR_CREDENTIALS_MODE>
Set this nym api to work in a enabled credentials that would attempt to use gateway with the bandwidth credential requirement default: None - config value will be used instead [possible values: true, false]
-h, --help
Print help
```
### `build-info`
```
Starting nym api...
Show build information of this binary
Usage: nym-api build-info [OPTIONS]
Options:
-o, --output <OUTPUT> [default: text] [possible values: text, json]
-h, --help Print help
```
@@ -0,0 +1,909 @@
# `nym-cli` Binary Commands
These docs are autogenerated by the `autodocs` script.
**TODO add link**
```
A client for interacting with Nym smart contracts and the Nyx blockchain
Usage: nym-cli [OPTIONS] <COMMAND>
Commands:
account Query and manage Nyx blockchain accounts
signature Sign and verify messages
coconut Coconut related stuff
block Query chain blocks
cosmwasm Manage and execute WASM smart contracts
tx Query for transactions
vesting-schedule Create and query for a vesting schedule
mixnet Manage your mixnet infrastructure, delegate stake or query the directory
generate-fig Generates shell completion
help Print this message or the help of the given subcommand(s)
Options:
--mnemonic <MNEMONIC>
Provide the mnemonic for your account. You can also provide this is an env var called MNEMONIC.
-c, --config-env-file <CONFIG_ENV_FILE>
Overrides configuration as a file of environment variables. Note: individual env vars take precedence over this file.
--nyxd-url <NYXD_URL>
Overrides the nyxd URL provided either as an environment variable NYXD_VALIDATOR or in a config file
--nym-api-url <NYM_API_URL>
Overrides the validator API URL provided either as an environment variable API_VALIDATOR or in a config file
--mixnet-contract-address <MIXNET_CONTRACT_ADDRESS>
Overrides the mixnet contract address provided either as an environment variable or in a config file
--vesting-contract-address <VESTING_CONTRACT_ADDRESS>
Overrides the vesting contract address provided either as an environment variable or in a config file
-h, --help
Print help
```
### `account create`
```
Create a new mnemonic - note, this account does not appear on the chain until the account id is used in a transaction
Usage: nym-cli account create [OPTIONS]
Options:
--mnemonic <MNEMONIC>
Provide the mnemonic for your account. You can also provide this is an env var called MNEMONIC.
--word-count <WORD_COUNT>
-c, --config-env-file <CONFIG_ENV_FILE>
Overrides configuration as a file of environment variables. Note: individual env vars take precedence over this file.
--nyxd-url <NYXD_URL>
Overrides the nyxd URL provided either as an environment variable NYXD_VALIDATOR or in a config file
--nym-api-url <NYM_API_URL>
Overrides the validator API URL provided either as an environment variable API_VALIDATOR or in a config file
--mixnet-contract-address <MIXNET_CONTRACT_ADDRESS>
Overrides the mixnet contract address provided either as an environment variable or in a config file
--vesting-contract-address <VESTING_CONTRACT_ADDRESS>
Overrides the vesting contract address provided either as an environment variable or in a config file
-h, --help
Print help
```
```
suit hat mammal misery someone void domain napkin into false real flower priority limb network spawn sport dawn icon cage tuition shell lottery father
n1sye7xctzwjq9m6w50wh0dnvk9787jryau6wcvu
```
### `account balance`
```
Gets the balance of an account
Usage: nym-cli account balance [OPTIONS] [ADDRESS]
Arguments:
[ADDRESS] The account address to get the balance for
Options:
--denom <DENOM>
Optional currency to show balance for
--mnemonic <MNEMONIC>
Provide the mnemonic for your account. You can also provide this is an env var called MNEMONIC.
-c, --config-env-file <CONFIG_ENV_FILE>
Overrides configuration as a file of environment variables. Note: individual env vars take precedence over this file.
--hide-denom
Optionally hide the denom
--nyxd-url <NYXD_URL>
Overrides the nyxd URL provided either as an environment variable NYXD_VALIDATOR or in a config file
--raw
Show as a raw value
--nym-api-url <NYM_API_URL>
Overrides the validator API URL provided either as an environment variable API_VALIDATOR or in a config file
--mixnet-contract-address <MIXNET_CONTRACT_ADDRESS>
Overrides the mixnet contract address provided either as an environment variable or in a config file
--vesting-contract-address <VESTING_CONTRACT_ADDRESS>
Overrides the vesting contract address provided either as an environment variable or in a config file
-h, --help
Print help
```
```
```
### `account pub-key`
```
Gets the public key of an account
Usage: nym-cli account pub-key [OPTIONS] [ADDRESS]
Arguments:
[ADDRESS] Optionally, show the public key for this account address, otherwise generate the account address from the mnemonic
Options:
--from-mnemonic
If set, get the public key from the mnemonic, rather than querying for it
--mnemonic <MNEMONIC>
Provide the mnemonic for your account. You can also provide this is an env var called MNEMONIC.
-c, --config-env-file <CONFIG_ENV_FILE>
Overrides configuration as a file of environment variables. Note: individual env vars take precedence over this file.
--nyxd-url <NYXD_URL>
Overrides the nyxd URL provided either as an environment variable NYXD_VALIDATOR or in a config file
--nym-api-url <NYM_API_URL>
Overrides the validator API URL provided either as an environment variable API_VALIDATOR or in a config file
--mixnet-contract-address <MIXNET_CONTRACT_ADDRESS>
Overrides the mixnet contract address provided either as an environment variable or in a config file
--vesting-contract-address <VESTING_CONTRACT_ADDRESS>
Overrides the vesting contract address provided either as an environment variable or in a config file
-h, --help
Print help
```
```
```
### `account send`
```
Sends tokens to another account
Usage: nym-cli account send [OPTIONS] <RECIPIENT> <AMOUNT>
Arguments:
<RECIPIENT> The recipient account address
<AMOUNT> Amount to transfer in micro denomination (e.g. unym or unyx)
Options:
--denom <DENOM>
Override the denomination
--mnemonic <MNEMONIC>
Provide the mnemonic for your account. You can also provide this is an env var called MNEMONIC.
-c, --config-env-file <CONFIG_ENV_FILE>
Overrides configuration as a file of environment variables. Note: individual env vars take precedence over this file.
--memo <MEMO>
--nyxd-url <NYXD_URL>
Overrides the nyxd URL provided either as an environment variable NYXD_VALIDATOR or in a config file
--nym-api-url <NYM_API_URL>
Overrides the validator API URL provided either as an environment variable API_VALIDATOR or in a config file
--mixnet-contract-address <MIXNET_CONTRACT_ADDRESS>
Overrides the mixnet contract address provided either as an environment variable or in a config file
--vesting-contract-address <VESTING_CONTRACT_ADDRESS>
Overrides the vesting contract address provided either as an environment variable or in a config file
-h, --help
Print help
```
```
```
### `account send-multiple`
```
Batch multiple token sends
Usage: nym-cli account send-multiple [OPTIONS] --input <INPUT>
Options:
--memo <MEMO>
--mnemonic <MNEMONIC>
Provide the mnemonic for your account. You can also provide this is an env var called MNEMONIC.
-c, --config-env-file <CONFIG_ENV_FILE>
Overrides configuration as a file of environment variables. Note: individual env vars take precedence over this file.
--input <INPUT>
Input file path (CSV format) with account/amount pairs to send
--nyxd-url <NYXD_URL>
Overrides the nyxd URL provided either as an environment variable NYXD_VALIDATOR or in a config file
--output <OUTPUT>
An output file path (CSV format) to create or append a log of results to
--nym-api-url <NYM_API_URL>
Overrides the validator API URL provided either as an environment variable API_VALIDATOR or in a config file
--mixnet-contract-address <MIXNET_CONTRACT_ADDRESS>
Overrides the mixnet contract address provided either as an environment variable or in a config file
--vesting-contract-address <VESTING_CONTRACT_ADDRESS>
Overrides the vesting contract address provided either as an environment variable or in a config file
-h, --help
Print help
```
```
```
### `signature sign`
```
Sign a message
Usage: nym-cli signature sign [OPTIONS] <MESSAGE>
Arguments:
<MESSAGE> The message to sign
Options:
--mnemonic <MNEMONIC>
Provide the mnemonic for your account. You can also provide this is an env var called MNEMONIC.
-c, --config-env-file <CONFIG_ENV_FILE>
Overrides configuration as a file of environment variables. Note: individual env vars take precedence over this file.
--nyxd-url <NYXD_URL>
Overrides the nyxd URL provided either as an environment variable NYXD_VALIDATOR or in a config file
--nym-api-url <NYM_API_URL>
Overrides the validator API URL provided either as an environment variable API_VALIDATOR or in a config file
--mixnet-contract-address <MIXNET_CONTRACT_ADDRESS>
Overrides the mixnet contract address provided either as an environment variable or in a config file
--vesting-contract-address <VESTING_CONTRACT_ADDRESS>
Overrides the vesting contract address provided either as an environment variable or in a config file
-h, --help
Print help
```
```
```
### `signature verify`
```
Verify a message
Usage: nym-cli signature verify [OPTIONS] <PUBLIC_KEY_OR_ADDRESS> <SIGNATURE_AS_HEX> <MESSAGE>
Arguments:
<PUBLIC_KEY_OR_ADDRESS> The public key of the account, or the account id to query for a public key (NOTE: the account must have signed a message stored on the chain for the public key record to exist)
<SIGNATURE_AS_HEX> The signature to verify as hex
<MESSAGE> The message to verify as a string
Options:
--mnemonic <MNEMONIC>
Provide the mnemonic for your account. You can also provide this is an env var called MNEMONIC.
-c, --config-env-file <CONFIG_ENV_FILE>
Overrides configuration as a file of environment variables. Note: individual env vars take precedence over this file.
--nyxd-url <NYXD_URL>
Overrides the nyxd URL provided either as an environment variable NYXD_VALIDATOR or in a config file
--nym-api-url <NYM_API_URL>
Overrides the validator API URL provided either as an environment variable API_VALIDATOR or in a config file
--mixnet-contract-address <MIXNET_CONTRACT_ADDRESS>
Overrides the mixnet contract address provided either as an environment variable or in a config file
--vesting-contract-address <VESTING_CONTRACT_ADDRESS>
Overrides the vesting contract address provided either as an environment variable or in a config file
-h, --help
Print help
```
```
```
### `coconut generate-freepass`
```
Usage: nym-cli coconut generate-freepass [OPTIONS] --output-dir <OUTPUT_DIR> <--expiration-date <EXPIRATION_DATE>|--expiration-timestamp <EXPIRATION_TIMESTAMP>>
Options:
--expiration-date <EXPIRATION_DATE>
Specifies the expiration date of the free pass(es) Can't be set to more than a week into the future
--mnemonic <MNEMONIC>
Provide the mnemonic for your account. You can also provide this is an env var called MNEMONIC.
-c, --config-env-file <CONFIG_ENV_FILE>
Overrides configuration as a file of environment variables. Note: individual env vars take precedence over this file.
--expiration-timestamp <EXPIRATION_TIMESTAMP>
The expiration of the free pass(es) expresses as unix timestamp. Can't be set to more than a week into the future
--amount <AMOUNT>
The number of free passes to issue [default: 1]
--nyxd-url <NYXD_URL>
Overrides the nyxd URL provided either as an environment variable NYXD_VALIDATOR or in a config file
--nym-api-url <NYM_API_URL>
Overrides the validator API URL provided either as an environment variable API_VALIDATOR or in a config file
--output-dir <OUTPUT_DIR>
Path to the output directory for generated free passes
--mixnet-contract-address <MIXNET_CONTRACT_ADDRESS>
Overrides the mixnet contract address provided either as an environment variable or in a config file
--vesting-contract-address <VESTING_CONTRACT_ADDRESS>
Overrides the vesting contract address provided either as an environment variable or in a config file
-h, --help
Print help
```
```
```
### `coconut issue-credentials`
```
Usage: nym-cli coconut issue-credentials [OPTIONS] --client-config <CLIENT_CONFIG> --recovery-dir <RECOVERY_DIR>
Options:
--client-config <CLIENT_CONFIG>
Config file of the client that is supposed to use the credential
--mnemonic <MNEMONIC>
Provide the mnemonic for your account. You can also provide this is an env var called MNEMONIC.
--amount <AMOUNT>
The amount of utokens the credential will hold [default: 0]
-c, --config-env-file <CONFIG_ENV_FILE>
Overrides configuration as a file of environment variables. Note: individual env vars take precedence over this file.
--nyxd-url <NYXD_URL>
Overrides the nyxd URL provided either as an environment variable NYXD_VALIDATOR or in a config file
--recovery-dir <RECOVERY_DIR>
Path to a directory used to store recovery files for unconsumed deposits
--nym-api-url <NYM_API_URL>
Overrides the validator API URL provided either as an environment variable API_VALIDATOR or in a config file
--mixnet-contract-address <MIXNET_CONTRACT_ADDRESS>
Overrides the mixnet contract address provided either as an environment variable or in a config file
--vesting-contract-address <VESTING_CONTRACT_ADDRESS>
Overrides the vesting contract address provided either as an environment variable or in a config file
-h, --help
Print help
```
```
```
### `coconut recover-credentials`
```
Usage: nym-cli coconut recover-credentials [OPTIONS] --client-config <CLIENT_CONFIG> --recovery-dir <RECOVERY_DIR>
Options:
--client-config <CLIENT_CONFIG>
Config file of the client that is supposed to use the credential
--mnemonic <MNEMONIC>
Provide the mnemonic for your account. You can also provide this is an env var called MNEMONIC.
-c, --config-env-file <CONFIG_ENV_FILE>
Overrides configuration as a file of environment variables. Note: individual env vars take precedence over this file.
--recovery-dir <RECOVERY_DIR>
Path to a directory used to store recovery files for unconsumed deposits
--nyxd-url <NYXD_URL>
Overrides the nyxd URL provided either as an environment variable NYXD_VALIDATOR or in a config file
--nym-api-url <NYM_API_URL>
Overrides the validator API URL provided either as an environment variable API_VALIDATOR or in a config file
--mixnet-contract-address <MIXNET_CONTRACT_ADDRESS>
Overrides the mixnet contract address provided either as an environment variable or in a config file
--vesting-contract-address <VESTING_CONTRACT_ADDRESS>
Overrides the vesting contract address provided either as an environment variable or in a config file
-h, --help
Print help
```
```
```
### `coconut import-credential`
```
Usage: nym-cli coconut import-credential [OPTIONS] --client-config <CLIENT_CONFIG> <--credential-data <CREDENTIAL_DATA>|--credential-path <CREDENTIAL_PATH>>
Options:
--client-config <CLIENT_CONFIG>
Config file of the client that is supposed to use the credential
--mnemonic <MNEMONIC>
Provide the mnemonic for your account. You can also provide this is an env var called MNEMONIC.
-c, --config-env-file <CONFIG_ENV_FILE>
Overrides configuration as a file of environment variables. Note: individual env vars take precedence over this file.
--credential-data <CREDENTIAL_DATA>
Explicitly provide the encoded credential data (as base58)
--credential-path <CREDENTIAL_PATH>
Specifies the path to file containing binary credential data
--nyxd-url <NYXD_URL>
Overrides the nyxd URL provided either as an environment variable NYXD_VALIDATOR or in a config file
--nym-api-url <NYM_API_URL>
Overrides the validator API URL provided either as an environment variable API_VALIDATOR or in a config file
--mixnet-contract-address <MIXNET_CONTRACT_ADDRESS>
Overrides the mixnet contract address provided either as an environment variable or in a config file
--vesting-contract-address <VESTING_CONTRACT_ADDRESS>
Overrides the vesting contract address provided either as an environment variable or in a config file
-h, --help
Print help
```
```
```
### `block get`
```
Gets a block's details and prints as JSON
Usage: nym-cli block get [OPTIONS] <HEIGHT>
Arguments:
<HEIGHT> The block height
Options:
--mnemonic <MNEMONIC>
Provide the mnemonic for your account. You can also provide this is an env var called MNEMONIC.
-c, --config-env-file <CONFIG_ENV_FILE>
Overrides configuration as a file of environment variables. Note: individual env vars take precedence over this file.
--nyxd-url <NYXD_URL>
Overrides the nyxd URL provided either as an environment variable NYXD_VALIDATOR or in a config file
--nym-api-url <NYM_API_URL>
Overrides the validator API URL provided either as an environment variable API_VALIDATOR or in a config file
--mixnet-contract-address <MIXNET_CONTRACT_ADDRESS>
Overrides the mixnet contract address provided either as an environment variable or in a config file
--vesting-contract-address <VESTING_CONTRACT_ADDRESS>
Overrides the vesting contract address provided either as an environment variable or in a config file
-h, --help
Print help
```
```
```
### `block time`
```
Gets the block time at a height
Usage: nym-cli block time [OPTIONS] <HEIGHT>
Arguments:
<HEIGHT> The block height
Options:
--mnemonic <MNEMONIC>
Provide the mnemonic for your account. You can also provide this is an env var called MNEMONIC.
-c, --config-env-file <CONFIG_ENV_FILE>
Overrides configuration as a file of environment variables. Note: individual env vars take precedence over this file.
--nyxd-url <NYXD_URL>
Overrides the nyxd URL provided either as an environment variable NYXD_VALIDATOR or in a config file
--nym-api-url <NYM_API_URL>
Overrides the validator API URL provided either as an environment variable API_VALIDATOR or in a config file
--mixnet-contract-address <MIXNET_CONTRACT_ADDRESS>
Overrides the mixnet contract address provided either as an environment variable or in a config file
--vesting-contract-address <VESTING_CONTRACT_ADDRESS>
Overrides the vesting contract address provided either as an environment variable or in a config file
-h, --help
Print help
```
```
```
### `block current-height`
```
Gets the current block height
Usage: nym-cli block current-height [OPTIONS]
Options:
--mnemonic <MNEMONIC>
Provide the mnemonic for your account. You can also provide this is an env var called MNEMONIC.
-c, --config-env-file <CONFIG_ENV_FILE>
Overrides configuration as a file of environment variables. Note: individual env vars take precedence over this file.
--nyxd-url <NYXD_URL>
Overrides the nyxd URL provided either as an environment variable NYXD_VALIDATOR or in a config file
--nym-api-url <NYM_API_URL>
Overrides the validator API URL provided either as an environment variable API_VALIDATOR or in a config file
--mixnet-contract-address <MIXNET_CONTRACT_ADDRESS>
Overrides the mixnet contract address provided either as an environment variable or in a config file
--vesting-contract-address <VESTING_CONTRACT_ADDRESS>
Overrides the vesting contract address provided either as an environment variable or in a config file
-h, --help
Print help
```
```
Current block height:
12528833
```
### `cosmwasm upload`
```
Upload a smart contract WASM blob
Usage: nym-cli cosmwasm upload [OPTIONS] --wasm-path <WASM_PATH>
Options:
--mnemonic <MNEMONIC>
Provide the mnemonic for your account. You can also provide this is an env var called MNEMONIC.
--wasm-path <WASM_PATH>
-c, --config-env-file <CONFIG_ENV_FILE>
Overrides configuration as a file of environment variables. Note: individual env vars take precedence over this file.
--memo <MEMO>
--nyxd-url <NYXD_URL>
Overrides the nyxd URL provided either as an environment variable NYXD_VALIDATOR or in a config file
--nym-api-url <NYM_API_URL>
Overrides the validator API URL provided either as an environment variable API_VALIDATOR or in a config file
--mixnet-contract-address <MIXNET_CONTRACT_ADDRESS>
Overrides the mixnet contract address provided either as an environment variable or in a config file
--vesting-contract-address <VESTING_CONTRACT_ADDRESS>
Overrides the vesting contract address provided either as an environment variable or in a config file
-h, --help
Print help
```
```
```
### `cosmwasm init`
```
Init a WASM smart contract
Usage: nym-cli cosmwasm init [OPTIONS] --init-message <INIT_MESSAGE> <CODE_ID>
Arguments:
<CODE_ID>
Options:
--memo <MEMO>
--mnemonic <MNEMONIC>
Provide the mnemonic for your account. You can also provide this is an env var called MNEMONIC.
-c, --config-env-file <CONFIG_ENV_FILE>
Overrides configuration as a file of environment variables. Note: individual env vars take precedence over this file.
--label <LABEL>
--init-message <INIT_MESSAGE>
--nyxd-url <NYXD_URL>
Overrides the nyxd URL provided either as an environment variable NYXD_VALIDATOR or in a config file
--admin <ADMIN>
--nym-api-url <NYM_API_URL>
Overrides the validator API URL provided either as an environment variable API_VALIDATOR or in a config file
--funds <FUNDS>
Amount to supply as funds in micro denomination (e.g. unym or unyx)
--mixnet-contract-address <MIXNET_CONTRACT_ADDRESS>
Overrides the mixnet contract address provided either as an environment variable or in a config file
--funds-denom <FUNDS_DENOM>
Set the denomination for the funds
--vesting-contract-address <VESTING_CONTRACT_ADDRESS>
Overrides the vesting contract address provided either as an environment variable or in a config file
-h, --help
Print help
```
```
```
### `cosmwasm generate-init-message`
```
Generate an instantiate message
Usage: nym-cli cosmwasm generate-init-message [OPTIONS]
nym-cli cosmwasm generate-init-message <COMMAND>
Commands:
coconut-bandwidth
coconut-dkg
mixnet
multisig
vesting
help Print this message or the help of the given subcommand(s)
Options:
--mnemonic <MNEMONIC>
Provide the mnemonic for your account. You can also provide this is an env var called MNEMONIC.
-c, --config-env-file <CONFIG_ENV_FILE>
Overrides configuration as a file of environment variables. Note: individual env vars take precedence over this file.
--nyxd-url <NYXD_URL>
Overrides the nyxd URL provided either as an environment variable NYXD_VALIDATOR or in a config file
--nym-api-url <NYM_API_URL>
Overrides the validator API URL provided either as an environment variable API_VALIDATOR or in a config file
--mixnet-contract-address <MIXNET_CONTRACT_ADDRESS>
Overrides the mixnet contract address provided either as an environment variable or in a config file
--vesting-contract-address <VESTING_CONTRACT_ADDRESS>
Overrides the vesting contract address provided either as an environment variable or in a config file
-h, --help
Print help
```
```
```
### `cosmwasm migrate`
```
Migrate a WASM smart contract
Usage: nym-cli cosmwasm migrate [OPTIONS] --code-id <CODE_ID> <CONTRACT_ADDRESS>
Arguments:
<CONTRACT_ADDRESS>
Options:
--code-id <CODE_ID>
--mnemonic <MNEMONIC>
Provide the mnemonic for your account. You can also provide this is an env var called MNEMONIC.
-c, --config-env-file <CONFIG_ENV_FILE>
Overrides configuration as a file of environment variables. Note: individual env vars take precedence over this file.
--memo <MEMO>
--init-message <INIT_MESSAGE>
--nyxd-url <NYXD_URL>
Overrides the nyxd URL provided either as an environment variable NYXD_VALIDATOR or in a config file
--nym-api-url <NYM_API_URL>
Overrides the validator API URL provided either as an environment variable API_VALIDATOR or in a config file
--mixnet-contract-address <MIXNET_CONTRACT_ADDRESS>
Overrides the mixnet contract address provided either as an environment variable or in a config file
--vesting-contract-address <VESTING_CONTRACT_ADDRESS>
Overrides the vesting contract address provided either as an environment variable or in a config file
-h, --help
Print help
```
```
```
### `cosmwasm execute`
```
Execute a WASM smart contract method
Usage: nym-cli cosmwasm execute [OPTIONS] <CONTRACT_ADDRESS> <JSON_ARGS> [FUNDS]
Arguments:
<CONTRACT_ADDRESS> The address of contract to execute
<JSON_ARGS> JSON encoded method arguments
[FUNDS] Amount to supply as funds in micro denomination (e.g. unym or unyx)
Options:
--memo <MEMO>
--mnemonic <MNEMONIC>
Provide the mnemonic for your account. You can also provide this is an env var called MNEMONIC.
-c, --config-env-file <CONFIG_ENV_FILE>
Overrides configuration as a file of environment variables. Note: individual env vars take precedence over this file.
--funds-denom <FUNDS_DENOM>
Set the denomination for the funds
--nyxd-url <NYXD_URL>
Overrides the nyxd URL provided either as an environment variable NYXD_VALIDATOR or in a config file
--nym-api-url <NYM_API_URL>
Overrides the validator API URL provided either as an environment variable API_VALIDATOR or in a config file
--mixnet-contract-address <MIXNET_CONTRACT_ADDRESS>
Overrides the mixnet contract address provided either as an environment variable or in a config file
--vesting-contract-address <VESTING_CONTRACT_ADDRESS>
Overrides the vesting contract address provided either as an environment variable or in a config file
-h, --help
Print help
```
```
```
### `tx get`
```
Get a transaction by hash or block height
Usage: nym-cli tx get [OPTIONS] <TX_HASH>
Arguments:
<TX_HASH> The transaction hash
Options:
--mnemonic <MNEMONIC>
Provide the mnemonic for your account. You can also provide this is an env var called MNEMONIC.
-c, --config-env-file <CONFIG_ENV_FILE>
Overrides configuration as a file of environment variables. Note: individual env vars take precedence over this file.
--nyxd-url <NYXD_URL>
Overrides the nyxd URL provided either as an environment variable NYXD_VALIDATOR or in a config file
--nym-api-url <NYM_API_URL>
Overrides the validator API URL provided either as an environment variable API_VALIDATOR or in a config file
--mixnet-contract-address <MIXNET_CONTRACT_ADDRESS>
Overrides the mixnet contract address provided either as an environment variable or in a config file
--vesting-contract-address <VESTING_CONTRACT_ADDRESS>
Overrides the vesting contract address provided either as an environment variable or in a config file
-h, --help
Print help
```
```
```
### `tx query`
```
Query for transactions
Usage: nym-cli tx query [OPTIONS] <QUERY>
Arguments:
<QUERY> The query to execute
Options:
--mnemonic <MNEMONIC>
Provide the mnemonic for your account. You can also provide this is an env var called MNEMONIC.
-c, --config-env-file <CONFIG_ENV_FILE>
Overrides configuration as a file of environment variables. Note: individual env vars take precedence over this file.
--nyxd-url <NYXD_URL>
Overrides the nyxd URL provided either as an environment variable NYXD_VALIDATOR or in a config file
--nym-api-url <NYM_API_URL>
Overrides the validator API URL provided either as an environment variable API_VALIDATOR or in a config file
--mixnet-contract-address <MIXNET_CONTRACT_ADDRESS>
Overrides the mixnet contract address provided either as an environment variable or in a config file
--vesting-contract-address <VESTING_CONTRACT_ADDRESS>
Overrides the vesting contract address provided either as an environment variable or in a config file
-h, --help
Print help
```
```
```
### `vesting-schedule create`
```
Creates a vesting schedule
Usage: nym-cli vesting-schedule create [OPTIONS] --address <ADDRESS> --amount <AMOUNT>
Options:
--mnemonic <MNEMONIC>
Provide the mnemonic for your account. You can also provide this is an env var called MNEMONIC.
--periods-seconds <PERIODS_SECONDS>
-c, --config-env-file <CONFIG_ENV_FILE>
Overrides configuration as a file of environment variables. Note: individual env vars take precedence over this file.
--number-of-periods <NUMBER_OF_PERIODS>
--nyxd-url <NYXD_URL>
Overrides the nyxd URL provided either as an environment variable NYXD_VALIDATOR or in a config file
--start-time <START_TIME>
--address <ADDRESS>
--nym-api-url <NYM_API_URL>
Overrides the validator API URL provided either as an environment variable API_VALIDATOR or in a config file
--amount <AMOUNT>
--mixnet-contract-address <MIXNET_CONTRACT_ADDRESS>
Overrides the mixnet contract address provided either as an environment variable or in a config file
--staking-address <STAKING_ADDRESS>
--vesting-contract-address <VESTING_CONTRACT_ADDRESS>
Overrides the vesting contract address provided either as an environment variable or in a config file
--pledge-cap <PLEDGE_CAP>
Pledge cap as either absolute uNYM value or percentage, floats need to be in the 0.0 to 1.0 range and will be parsed as percentages, integers will be parsed as uNYM
-h, --help
Print help
```
```
```
### `vesting-schedule query`
```
Query for vesting schedule
Usage: nym-cli vesting-schedule query [OPTIONS] [ADDRESS]
Arguments:
[ADDRESS] Optionally, the account address to get the balance for
Options:
--mnemonic <MNEMONIC>
Provide the mnemonic for your account. You can also provide this is an env var called MNEMONIC.
-c, --config-env-file <CONFIG_ENV_FILE>
Overrides configuration as a file of environment variables. Note: individual env vars take precedence over this file.
--nyxd-url <NYXD_URL>
Overrides the nyxd URL provided either as an environment variable NYXD_VALIDATOR or in a config file
--nym-api-url <NYM_API_URL>
Overrides the validator API URL provided either as an environment variable API_VALIDATOR or in a config file
--mixnet-contract-address <MIXNET_CONTRACT_ADDRESS>
Overrides the mixnet contract address provided either as an environment variable or in a config file
--vesting-contract-address <VESTING_CONTRACT_ADDRESS>
Overrides the vesting contract address provided either as an environment variable or in a config file
-h, --help
Print help
```
```
```
### `vesting-schedule vested-balance`
```
Get the amount that has vested and is free for withdrawal, delegation or bonding
Usage: nym-cli vesting-schedule vested-balance [OPTIONS] [ADDRESS]
Arguments:
[ADDRESS] Optionally, the account address to get the balance for
Options:
--mnemonic <MNEMONIC>
Provide the mnemonic for your account. You can also provide this is an env var called MNEMONIC.
-c, --config-env-file <CONFIG_ENV_FILE>
Overrides configuration as a file of environment variables. Note: individual env vars take precedence over this file.
--nyxd-url <NYXD_URL>
Overrides the nyxd URL provided either as an environment variable NYXD_VALIDATOR or in a config file
--nym-api-url <NYM_API_URL>
Overrides the validator API URL provided either as an environment variable API_VALIDATOR or in a config file
--mixnet-contract-address <MIXNET_CONTRACT_ADDRESS>
Overrides the mixnet contract address provided either as an environment variable or in a config file
--vesting-contract-address <VESTING_CONTRACT_ADDRESS>
Overrides the vesting contract address provided either as an environment variable or in a config file
-h, --help
Print help
```
```
```
### `vesting-schedule withdraw-vested`
```
Withdraw vested tokens (note: the available amount excludes anything delegated or bonded before or after vesting)
Usage: nym-cli vesting-schedule withdraw-vested [OPTIONS] <AMOUNT>
Arguments:
<AMOUNT> Amount to transfer in micro denomination (e.g. unym or unyx)
Options:
--mnemonic <MNEMONIC>
Provide the mnemonic for your account. You can also provide this is an env var called MNEMONIC.
-c, --config-env-file <CONFIG_ENV_FILE>
Overrides configuration as a file of environment variables. Note: individual env vars take precedence over this file.
--nyxd-url <NYXD_URL>
Overrides the nyxd URL provided either as an environment variable NYXD_VALIDATOR or in a config file
--nym-api-url <NYM_API_URL>
Overrides the validator API URL provided either as an environment variable API_VALIDATOR or in a config file
--mixnet-contract-address <MIXNET_CONTRACT_ADDRESS>
Overrides the mixnet contract address provided either as an environment variable or in a config file
--vesting-contract-address <VESTING_CONTRACT_ADDRESS>
Overrides the vesting contract address provided either as an environment variable or in a config file
-h, --help
Print help
```
```
```
### `mixnet query`
```
Query the mixnet directory
Usage: nym-cli mixnet query [OPTIONS]
nym-cli mixnet query <COMMAND>
Commands:
mixnodes Query mixnodes
gateways Query gateways
service-providers Query announced service-providers
names Query registed names
help Print this message or the help of the given subcommand(s)
Options:
--mnemonic <MNEMONIC>
Provide the mnemonic for your account. You can also provide this is an env var called MNEMONIC.
-c, --config-env-file <CONFIG_ENV_FILE>
Overrides configuration as a file of environment variables. Note: individual env vars take precedence over this file.
--nyxd-url <NYXD_URL>
Overrides the nyxd URL provided either as an environment variable NYXD_VALIDATOR or in a config file
--nym-api-url <NYM_API_URL>
Overrides the validator API URL provided either as an environment variable API_VALIDATOR or in a config file
--mixnet-contract-address <MIXNET_CONTRACT_ADDRESS>
Overrides the mixnet contract address provided either as an environment variable or in a config file
--vesting-contract-address <VESTING_CONTRACT_ADDRESS>
Overrides the vesting contract address provided either as an environment variable or in a config file
-h, --help
Print help
```
```
```
### `mixnet delegators`
```
Manage your delegations
Usage: nym-cli mixnet delegators [OPTIONS]
nym-cli mixnet delegators <COMMAND>
Commands:
list Lists current delegations
rewards Manage rewards from delegations
delegate Delegate to a mixnode
delegate-multi Perform bulk delegations from an input file
undelegate Undelegate from a mixnode
delegate-vesting Delegate to a mixnode with locked tokens
undelegate-vesting Undelegate from a mixnode (when originally using locked tokens)
help Print this message or the help of the given subcommand(s)
Options:
--mnemonic <MNEMONIC>
Provide the mnemonic for your account. You can also provide this is an env var called MNEMONIC.
-c, --config-env-file <CONFIG_ENV_FILE>
Overrides configuration as a file of environment variables. Note: individual env vars take precedence over this file.
--nyxd-url <NYXD_URL>
Overrides the nyxd URL provided either as an environment variable NYXD_VALIDATOR or in a config file
--nym-api-url <NYM_API_URL>
Overrides the validator API URL provided either as an environment variable API_VALIDATOR or in a config file
--mixnet-contract-address <MIXNET_CONTRACT_ADDRESS>
Overrides the mixnet contract address provided either as an environment variable or in a config file
--vesting-contract-address <VESTING_CONTRACT_ADDRESS>
Overrides the vesting contract address provided either as an environment variable or in a config file
-h, --help
Print help
```
```
```
### `mixnet operators`
```
Manage a mixnode or gateway you operate
Usage: nym-cli mixnet operators [OPTIONS]
nym-cli mixnet operators <COMMAND>
Commands:
mixnode Manage your mixnode
gateway Manage your gateway
service-provider Manage your service
name Manage your registered name
identity-key Sign messages using your private identity key
help Print this message or the help of the given subcommand(s)
Options:
--mnemonic <MNEMONIC>
Provide the mnemonic for your account. You can also provide this is an env var called MNEMONIC.
-c, --config-env-file <CONFIG_ENV_FILE>
Overrides configuration as a file of environment variables. Note: individual env vars take precedence over this file.
--nyxd-url <NYXD_URL>
Overrides the nyxd URL provided either as an environment variable NYXD_VALIDATOR or in a config file
--nym-api-url <NYM_API_URL>
Overrides the validator API URL provided either as an environment variable API_VALIDATOR or in a config file
--mixnet-contract-address <MIXNET_CONTRACT_ADDRESS>
Overrides the mixnet contract address provided either as an environment variable or in a config file
--vesting-contract-address <VESTING_CONTRACT_ADDRESS>
Overrides the vesting contract address provided either as an environment variable or in a config file
-h, --help
Print help
```
```
```
### `generate-fig `
```
```
@@ -0,0 +1,721 @@
# `nym-client` Binary Commands
These docs are autogenerated by the `autodocs` script.
**TODO add link**
```
Implementation of the Nym Client
Usage: nym-client [OPTIONS] <COMMAND>
Commands:
init Initialise a Nym client. Do this first!
run Run the Nym client with provided configuration client optionally overriding set parameters
import-credential Import a pre-generated credential
list-gateways List all registered with gateways
add-gateway Add new gateway to this client
switch-gateway Change the currently active gateway. Note that you must have already registered with the new gateway!
build-info Show build information of this binary
completions Generate shell completions
generate-fig-spec Generate Fig specification
help Print this message or the help of the given subcommand(s)
Options:
-c, --config-env-file <CONFIG_ENV_FILE> Path pointing to an env file that configures the client
--no-banner Flag used for disabling the printed banner in tty
-h, --help Print help
-V, --version Print version
```
### `init`
```
Initialise a Nym client. Do this first!
Usage: nym-client init [OPTIONS] --id <ID>
Options:
--id <ID>
Id of client we want to create config for
--gateway <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 <NYM_APIS>
Comma separated list of rest endpoints of the API validators
--disable-socket <DISABLE_SOCKET>
Whether to not start the websocket [possible values: true, false]
-p, --port <PORT>
Port for the socket (if applicable) to listen on in all subsequent runs
--host <HOST>
Ip for the socket (if applicable) to listen for requests
-o, --output <OUTPUT>
[default: text] [possible values: text, json]
-h, --help
Print help
```
### `run`
```
Run the Nym client with provided configuration client optionally overriding set parameters
Usage: nym-client run [OPTIONS] --id <ID>
Options:
--id <ID>
Id of client we want to create config for
--gateway <GATEWAY>
Id of the gateway we want to connect to. If overridden, it is user's responsibility to ensure prior registration happened
--nym-apis <NYM_APIS>
Comma separated list of rest endpoints of the API validators
--disable-socket <DISABLE_SOCKET>
Whether to not start the websocket [possible values: true, false]
-p, --port <PORT>
Port for the socket to listen on
--host <HOST>
Ip for the socket (if applicable) to listen for requests
-h, --help
Print help
```
### `import-credential`
```
Import a pre-generated credential
Usage: nym-client import-credential --id <ID> <--credential-data <CREDENTIAL_DATA>|--credential-path <CREDENTIAL_PATH>>
Options:
--id <ID>
Id of client that is going to import the credential
--credential-data <CREDENTIAL_DATA>
Explicitly provide the encoded credential data (as base58)
--credential-path <CREDENTIAL_PATH>
Specifies the path to file containing binary credential data
-h, --help
Print help
```
### `list-gateways`
```
List all registered with gateways
Usage: nym-client list-gateways [OPTIONS] --id <ID>
Options:
--id <ID> Id of client we want to list gateways for
-o, --output <OUTPUT> [default: text] [possible values: text, json]
-h, --help Print help
```
### `switch-gateway`
```
Change the currently active gateway. Note that you must have already registered with the new gateway!
Usage: nym-client switch-gateway --id <ID> --gateway-id <GATEWAY_ID>
Options:
--id <ID> Id of client we want to list gateways for
--gateway-id <GATEWAY_ID> Id of the gateway we want to switch to
-h, --help Print help
```
### `build-info`
```
Show build information of this binary
Usage: nym-client build-info [OPTIONS]
Options:
-o, --output <OUTPUT> [default: text] [possible values: text, json]
-h, --help Print help
```
Example output:
```
Binary Name: nym-client
Build Timestamp: 2024-05-07T13:11:43.523733081Z
Build Version: 1.1.34
Commit SHA: 7d233a4a2fc697a2f97e504db6a3765cc9f2dd49
Commit Date: 2024-04-25T11:27:18.000000000+02:00
Commit Branch: max/auto-docs
rustc Version: 1.78.0
rustc Channel: stable
cargo Profile: release
```
### `completions`
```
Generate shell completions
Usage: nym-client completions <SHELL>
Arguments:
<SHELL> [possible values: bash, elvish, fish, power-shell, zsh]
Options:
-h, --help Print help
```
### `generate-fig-spec`
```
Generate Fig specification
Usage: nym-client generate-fig-spec
Options:
-h, --help Print help
```
Example output:
```
const completion: Fig.Spec = {
name: "nym-native-client",
description: "Implementation of the Nym Client",
subcommands: [
{
name: "init",
description: "Initialise a Nym client. Do this first!",
options: [
{
name: "--id",
description: "Id of client we want to create config for",
isRepeatable: true,
args: {
name: "id",
},
},
{
name: "--gateway",
description: "Id of the gateway we are going to connect to",
isRepeatable: true,
args: {
name: "gateway",
isOptional: true,
},
},
{
name: "--nyxd-urls",
description: "Comma separated list of rest endpoints of the nyxd validators",
hidden: true,
isRepeatable: true,
args: {
name: "nyxd_urls",
isOptional: true,
},
},
{
name: "--nym-apis",
description: "Comma separated list of rest endpoints of the API validators",
isRepeatable: true,
args: {
name: "nym_apis",
isOptional: true,
},
},
{
name: "--custom-mixnet",
description: "Path to .json file containing custom network specification",
hidden: true,
isRepeatable: true,
args: {
name: "custom_mixnet",
isOptional: true,
template: "filepaths",
},
},
{
name: "--enabled-credentials-mode",
description: "Set this client to work in a enabled credentials mode that would attempt to use gateway with bandwidth credential requirement",
hidden: true,
isRepeatable: true,
args: {
name: "enabled_credentials_mode",
isOptional: true,
suggestions: [
"true",
"false",
],
},
},
{
name: "--disable-socket",
description: "Whether to not start the websocket",
isRepeatable: true,
args: {
name: "disable_socket",
isOptional: true,
suggestions: [
"true",
"false",
],
},
},
{
name: ["-p", "--port"],
description: "Port for the socket (if applicable) to listen on in all subsequent runs",
isRepeatable: true,
args: {
name: "port",
isOptional: true,
},
},
{
name: "--host",
description: "Ip for the socket (if applicable) to listen for requests",
isRepeatable: true,
args: {
name: "host",
isOptional: true,
},
},
{
name: ["-o", "--output"],
isRepeatable: true,
args: {
name: "output",
isOptional: true,
suggestions: [
"text",
"json",
],
},
},
{
name: "--force-tls-gateway",
description: "Specifies whether the client will attempt to enforce tls connection to the desired gateway",
},
{
name: "--latency-based-selection",
description: "Specifies whether the new gateway should be determined based by latency as opposed to being chosen uniformly",
exclusiveOn: [
"--gateway",
],
},
{
name: "--fastmode",
description: "Mostly debug-related option to increase default traffic rate so that you would not need to modify config post init",
},
{
name: "--no-cover",
description: "Disable loop cover traffic and the Poisson rate limiter (for debugging only)",
},
{
name: ["-h", "--help"],
description: "Print help",
},
],
},
{
name: "run",
description: "Run the Nym client with provided configuration client optionally overriding set parameters",
options: [
{
name: "--id",
description: "Id of client we want to create config for",
isRepeatable: true,
args: {
name: "id",
},
},
{
name: "--gateway",
description: "Id of the gateway we want to connect to. If overridden, it is user's responsibility to ensure prior registration happened",
isRepeatable: true,
args: {
name: "gateway",
isOptional: true,
},
},
{
name: "--nyxd-urls",
description: "Comma separated list of rest endpoints of the nyxd validators",
hidden: true,
isRepeatable: true,
args: {
name: "nyxd_urls",
isOptional: true,
},
},
{
name: "--nym-apis",
description: "Comma separated list of rest endpoints of the API validators",
isRepeatable: true,
args: {
name: "nym_apis",
isOptional: true,
},
},
{
name: "--custom-mixnet",
description: "Path to .json file containing custom network specification",
hidden: true,
isRepeatable: true,
args: {
name: "custom_mixnet",
isOptional: true,
template: "filepaths",
},
},
{
name: "--enabled-credentials-mode",
description: "Set this client to work in a enabled credentials mode that would attempt to use gateway with bandwidth credential requirement",
hidden: true,
isRepeatable: true,
args: {
name: "enabled_credentials_mode",
isOptional: true,
suggestions: [
"true",
"false",
],
},
},
{
name: "--disable-socket",
description: "Whether to not start the websocket",
isRepeatable: true,
args: {
name: "disable_socket",
isOptional: true,
suggestions: [
"true",
"false",
],
},
},
{
name: ["-p", "--port"],
description: "Port for the socket to listen on",
isRepeatable: true,
args: {
name: "port",
isOptional: true,
},
},
{
name: "--host",
description: "Ip for the socket (if applicable) to listen for requests",
isRepeatable: true,
args: {
name: "host",
isOptional: true,
},
},
{
name: "--fastmode",
description: "Mostly debug-related option to increase default traffic rate so that you would not need to modify config post init",
},
{
name: "--no-cover",
description: "Disable loop cover traffic and the Poisson rate limiter (for debugging only)",
},
{
name: ["-h", "--help"],
description: "Print help",
},
],
},
{
name: "import-credential",
description: "Import a pre-generated credential",
options: [
{
name: "--id",
description: "Id of client that is going to import the credential",
isRepeatable: true,
args: {
name: "id",
},
},
{
name: "--credential-data",
description: "Explicitly provide the encoded credential data (as base58)",
isRepeatable: true,
args: {
name: "credential_data",
isOptional: true,
},
},
{
name: "--credential-path",
description: "Specifies the path to file containing binary credential data",
isRepeatable: true,
args: {
name: "credential_path",
isOptional: true,
template: "filepaths",
},
},
{
name: "--version",
hidden: true,
isRepeatable: true,
args: {
name: "version",
isOptional: true,
},
},
{
name: ["-h", "--help"],
description: "Print help",
},
],
},
{
name: "list-gateways",
description: "List all registered with gateways",
options: [
{
name: "--id",
description: "Id of client we want to list gateways for",
isRepeatable: true,
args: {
name: "id",
},
},
{
name: ["-o", "--output"],
isRepeatable: true,
args: {
name: "output",
isOptional: true,
suggestions: [
"text",
"json",
],
},
},
{
name: ["-h", "--help"],
description: "Print help",
},
],
},
{
name: "add-gateway",
description: "Add new gateway to this client",
options: [
{
name: "--id",
description: "Id of client we want to add gateway for",
isRepeatable: true,
args: {
name: "id",
},
},
{
name: "--gateway-id",
description: "Explicitly specify id of the gateway to register with. If unspecified, a random gateway will be chosen instead",
isRepeatable: true,
args: {
name: "gateway_id",
isOptional: true,
},
},
{
name: "--nym-apis",
description: "Comma separated list of rest endpoints of the API validators",
isRepeatable: true,
args: {
name: "nym_apis",
isOptional: true,
},
},
{
name: "--custom-mixnet",
description: "Path to .json file containing custom network specification",
hidden: true,
isRepeatable: true,
args: {
name: "custom_mixnet",
isOptional: true,
template: "filepaths",
},
},
{
name: ["-o", "--output"],
isRepeatable: true,
args: {
name: "output",
isOptional: true,
suggestions: [
"text",
"json",
],
},
},
{
name: "--force-tls-gateway",
description: "Specifies whether the client will attempt to enforce tls connection to the desired gateway",
},
{
name: "--latency-based-selection",
description: "Specifies whether the new gateway should be determined based by latency as opposed to being chosen uniformly",
exclusiveOn: [
"--gateway-id",
],
},
{
name: "--set-active",
description: "Specify whether this new gateway should be set as the active one",
},
{
name: ["-h", "--help"],
description: "Print help",
},
],
},
{
name: "switch-gateway",
description: "Change the currently active gateway. Note that you must have already registered with the new gateway!",
options: [
{
name: "--id",
description: "Id of client we want to list gateways for",
isRepeatable: true,
args: {
name: "id",
},
},
{
name: "--gateway-id",
description: "Id of the gateway we want to switch to",
isRepeatable: true,
args: {
name: "gateway_id",
},
},
{
name: ["-h", "--help"],
description: "Print help",
},
],
},
{
name: "build-info",
description: "Show build information of this binary",
options: [
{
name: ["-o", "--output"],
isRepeatable: true,
args: {
name: "output",
isOptional: true,
suggestions: [
"text",
"json",
],
},
},
{
name: ["-h", "--help"],
description: "Print help",
},
],
},
{
name: "completions",
description: "Generate shell completions",
options: [
{
name: ["-h", "--help"],
description: "Print help",
},
],
args: {
name: "shell",
suggestions: [
"bash",
"elvish",
"fish",
"power-shell",
"zsh",
],
},
},
{
name: "generate-fig-spec",
description: "Generate Fig specification",
options: [
{
name: ["-h", "--help"],
description: "Print help",
},
],
},
{
name: "help",
description: "Print this message or the help of the given subcommand(s)",
subcommands: [
{
name: "init",
description: "Initialise a Nym client. Do this first!",
},
{
name: "run",
description: "Run the Nym client with provided configuration client optionally overriding set parameters",
},
{
name: "import-credential",
description: "Import a pre-generated credential",
},
{
name: "list-gateways",
description: "List all registered with gateways",
},
{
name: "add-gateway",
description: "Add new gateway to this client",
},
{
name: "switch-gateway",
description: "Change the currently active gateway. Note that you must have already registered with the new gateway!",
},
{
name: "build-info",
description: "Show build information of this binary",
},
{
name: "completions",
description: "Generate shell completions",
},
{
name: "generate-fig-spec",
description: "Generate Fig specification",
},
{
name: "help",
description: "Print this message or the help of the given subcommand(s)",
},
],
},
],
options: [
{
name: ["-c", "--config-env-file"],
description: "Path pointing to an env file that configures the client",
isRepeatable: true,
args: {
name: "config_env_file",
isOptional: true,
template: "filepaths",
},
},
{
name: "--no-banner",
description: "Flag used for disabling the printed banner in tty",
},
{
name: ["-h", "--help"],
description: "Print help",
},
{
name: ["-V", "--version"],
description: "Print version",
},
],
};
export default completion;
```
@@ -0,0 +1,227 @@
# `nym-node` Binary Commands
These docs are autogenerated by the `autodocs` script.
**TODO add link**
```
Usage: nym-node [OPTIONS] <COMMAND>
Commands:
build-info Show build information of this binary
bonding-information Show bonding information of this node depending on its currently selected mode
node-details Show details of this node
migrate Attempt to migrate an existing mixnode or gateway into a nym-node
run Start this nym-node
sign Use identity key of this node to sign provided message
help Print this message or the help of the given subcommand(s)
Options:
-c, --config-env-file <CONFIG_ENV_FILE>
Path pointing to an env file that configures the nym-node and overrides any preconfigured values [env: NYMNODE_CONFIG_ENV_FILE_ARG=]
--no-banner
Flag used for disabling the printed banner in tty [env: NYMNODE_NO_BANNER=]
-h, --help
Print help
-V, --version
Print version
```
### `build-info`
```
Show build information of this binary
Usage: nym-node build-info [OPTIONS]
Options:
-o, --output <OUTPUT> [default: text] [possible values: text, json]
-h, --help Print help
```
### `bonding-information`
```
Show bonding information of this node depending on its currently selected mode
Usage: nym-node bonding-information [OPTIONS]
Options:
--id <ID> Id of the nym-node to use [env: NYMNODE_ID=] [default: default-nym-node]
--config-file <CONFIG_FILE> Path to a configuration file of this node [env: NYMNODE_CONFIG=]
--mode <MODE> [env: NYMNODE_MODE=] [possible values: mixnode, entry-gateway, exit-gateway]
-o, --output <OUTPUT> Specify the output format of the bonding information (`text` or `json`) [default: text] [possible values: text, json]
-h, --help Print help
```
### `node-details`
```
Show details of this node
Usage: nym-node node-details [OPTIONS]
Options:
--id <ID> Id of the nym-node to use [env: NYMNODE_ID=] [default: default-nym-node]
--config-file <CONFIG_FILE> Path to a configuration file of this node [env: NYMNODE_CONFIG=]
-o, --output <OUTPUT> Specify the output format of the node details (`text` or `json`) [default: text] [possible values: text, json]
-h, --help Print help
```
### `migrate`
```
Attempt to migrate an existing mixnode or gateway into a nym-node
Usage: nym-node migrate [OPTIONS] <--id <ID>|--config-file <CONFIG_FILE>> <NODE_TYPE>
Arguments:
<NODE_TYPE> Type of node (mixnode or gateway) to migrate into a nym-node [possible values: mixnode, gateway]
Options:
--id <ID>
Id of the node that's going to get migrated
--config-file <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 <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 <HOSTNAME>
Optional hostname associated with this gateway that will be announced to the nym-api and subsequently to the clients [env: NYMNODE_HOSTNAME=]
--location <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 <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 <LANDING_PAGE_ASSETS_PATH>
Path to assets directory of custom landing page of this node [env: NYMNODE_HTTP_LANDING_ASSETS=]
--http-access-token <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 <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 <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 <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 <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 <NYM_API_URLS>
Addresses to nym APIs from which the node gets the view of the network [env: NYMNODE_NYM_APIS=]
--nyxd-urls <NYXD_URLS>
Addresses to nyxd chain endpoint which the node will use for chain interactions [env: NYMNODE_NYXD=]
--wireguard-enabled <WIREGUARD_ENABLED>
Specifies whether the wireguard service is enabled on this node [env: NYMNODE_WG_ENABLED=] [possible values: true, false]
--wireguard-bind-address <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-network-ip <WIREGUARD_PRIVATE_NETWORK_IP>
Ip address of the private wireguard network. default: `10.1.0.0` [env: NYMNODE_WG_IP_NETWORK=]
--wireguard-announced-port <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 <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 <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 <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 <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 <ANNOUNCE_WSS_PORT>
If applicable, announced port for listening for secure websocket client traffic [env: NYMNODE_ENTRY_ANNOUNCE_WSS_PORT=]
--enforce-zk-nyms <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 <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 <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 <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
```
### `run`
```
Start this nym-node
Usage: nym-node run [OPTIONS]
Options:
--id <ID>
Id of the nym-node to use [env: NYMNODE_ID=] [default: default-nym-node]
--config-file <CONFIG_FILE>
Path to a configuration file of this node [env: NYMNODE_CONFIG=]
--deny-init
Forbid a new node from being initialised if configuration file for the provided specification doesn't already exist [env: NYMNODE_DENY_INIT=]
--init-only
If this is a brand new nym-node, specify whether it should only be initialised without actually running the subprocesses [env: NYMNODE_INIT_ONLY=]
--mode <MODE>
Specifies the current mode of this nym-node [env: NYMNODE_MODE=] [possible values: mixnode, entry-gateway, exit-gateway]
-w, --write-changes
If this node has been initialised before, specify whether to write any new changes to the config file [env: NYMNODE_WRITE_CONFIG_CHANGES=]
--bonding-information-output <BONDING_INFORMATION_OUTPUT>
Specify output file for bonding information of this nym-node, i.e. its encoded keys. NOTE: the required bonding information is still a subject to change and this argument should be treated only as a preview of future features [env: NYMNODE_BONDING_INFORMATION_OUTPUT=]
-o, --output <OUTPUT>
Specify the output format of the bonding information (`text` or `json`) [env: NYMNODE_OUTPUT=] [default: text] [possible values: text, json]
--public-ips <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 <HOSTNAME>
Optional hostname associated with this gateway that will be announced to the nym-api and subsequently to the clients [env: NYMNODE_HOSTNAME=]
--location <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 <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 <LANDING_PAGE_ASSETS_PATH>
Path to assets directory of custom landing page of this node [env: NYMNODE_HTTP_LANDING_ASSETS=]
--http-access-token <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 <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 <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 <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 <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 <NYM_API_URLS>
Addresses to nym APIs from which the node gets the view of the network [env: NYMNODE_NYM_APIS=]
--nyxd-urls <NYXD_URLS>
Addresses to nyxd chain endpoint which the node will use for chain interactions [env: NYMNODE_NYXD=]
--wireguard-enabled <WIREGUARD_ENABLED>
Specifies whether the wireguard service is enabled on this node [env: NYMNODE_WG_ENABLED=] [possible values: true, false]
--wireguard-bind-address <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-network-ip <WIREGUARD_PRIVATE_NETWORK_IP>
Ip address of the private wireguard network. default: `10.1.0.0` [env: NYMNODE_WG_IP_NETWORK=]
--wireguard-announced-port <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 <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 <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 <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 <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 <ANNOUNCE_WSS_PORT>
If applicable, announced port for listening for secure websocket client traffic [env: NYMNODE_ENTRY_ANNOUNCE_WSS_PORT=]
--enforce-zk-nyms <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 <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 <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 <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
```
### `sign`
```
Use identity key of this node to sign provided message
Usage: nym-node sign [OPTIONS] <--text <TEXT>|--contract-msg <CONTRACT_MSG>>
Options:
--id <ID> Id of the nym-node to use [env: NYMNODE_ID=] [default: default-nym-node]
--config-file <CONFIG_FILE> Path to a configuration file of this node [env: NYMNODE_CONFIG=]
--text <TEXT> Signs an arbitrary piece of text with your identity key
--contract-msg <CONTRACT_MSG> Signs a transaction-specific payload, that is going to be sent to the smart contract, with your identity key
-o, --output <OUTPUT> [default: text] [possible values: text, json]
-h, --help Print help
```
@@ -0,0 +1,790 @@
# `nym-socks5-client` Binary Commands
These docs are autogenerated by the `autodocs` script.
**TODO add link**
```
A SOCKS5 localhost proxy that converts incoming messages to Sphinx and sends them to a Nym address
Usage: nym-socks5-client [OPTIONS] <COMMAND>
Commands:
init Initialise a Nym client. Do this first!
run Run the Nym client with provided configuration client optionally overriding set parameters
import-credential Import a pre-generated credential
list-gateways List all registered with gateways
add-gateway Add new gateway to this client
switch-gateway Change the currently active gateway. Note that you must have already registered with the new gateway!
build-info Show build information of this binary
completions Generate shell completions
generate-fig-spec Generate Fig specification
help Print this message or the help of the given subcommand(s)
Options:
-c, --config-env-file <CONFIG_ENV_FILE> Path pointing to an env file that configures the client
--no-banner Flag used for disabling the printed banner in tty
-h, --help Print help
-V, --version Print version
```
### `init`
```
Initialise a Nym client. Do this first!
Usage: nym-socks5-client init [OPTIONS] --id <ID> --provider <PROVIDER>
Options:
--id <ID>
Id of client we want to create config for
--gateway <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 <NYM_APIS>
Comma separated list of rest endpoints of the API validators
--provider <PROVIDER>
Address of the socks5 provider to send messages to
--use-reply-surbs <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>
Port for the socket to listen on in all subsequent runs
--host <HOST>
The custom host on which the socks5 client will be listening for requests
-o, --output <OUTPUT>
[default: text]
[possible values: text, json]
-h, --help
Print help (see a summary with '-h')
```
### `run`
```
Run the Nym client with provided configuration client optionally overriding set parameters
Usage: nym-socks5-client run [OPTIONS] --id <ID>
Options:
--id <ID>
Id of client we want to create config for
--gateway <GATEWAY>
Id of the gateway we want to connect to. If overridden, it is user's responsibility to ensure prior registration happened
--nym-apis <NYM_APIS>
Comma separated list of rest endpoints of the API validators
--use-anonymous-replies <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 <PROVIDER>
Address of the socks5 provider to send messages to
-p, --port <PORT>
Port for the socket to listen on
--host <HOST>
The custom host on which the socks5 client will be listening for requests
-h, --help
Print help (see a summary with '-h')
```
### `import-credential`
```
Import a pre-generated credential
Usage: nym-socks5-client import-credential --id <ID> <--credential-data <CREDENTIAL_DATA>|--credential-path <CREDENTIAL_PATH>>
Options:
--id <ID>
Id of client that is going to import the credential
--credential-data <CREDENTIAL_DATA>
Explicitly provide the encoded credential data (as base58)
--credential-path <CREDENTIAL_PATH>
Specifies the path to file containing binary credential data
-h, --help
Print help
```
### `list-gateways`
```
List all registered with gateways
Usage: nym-socks5-client list-gateways [OPTIONS] --id <ID>
Options:
--id <ID> Id of client we want to list gateways for
-o, --output <OUTPUT> [default: text] [possible values: text, json]
-h, --help Print help
```
### `add-gateway`
```
Add new gateway to this client
Usage: nym-socks5-client add-gateway [OPTIONS] --id <ID>
Options:
--id <ID> Id of client we want to add gateway for
--gateway-id <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 <NYM_APIS> Comma separated list of rest endpoints of the API validators
-o, --output <OUTPUT> [default: text] [possible values: text, json]
-h, --help Print help
```
### `build-info`
```
Show build information of this binary
Usage: nym-socks5-client build-info [OPTIONS]
Options:
-o, --output <OUTPUT> [default: text] [possible values: text, json]
-h, --help Print help
```
Example output:
```
Binary Name: nym-socks5-client
Build Timestamp: 2024-05-07T13:11:43.523733081Z
Build Version: 1.1.34
Commit SHA: 7d233a4a2fc697a2f97e504db6a3765cc9f2dd49
Commit Date: 2024-04-25T11:27:18.000000000+02:00
Commit Branch: max/auto-docs
rustc Version: 1.78.0
rustc Channel: stable
cargo Profile: release
```
### `completions`
```
Generate shell completions
Usage: nym-socks5-client completions <SHELL>
Arguments:
<SHELL> [possible values: bash, elvish, fish, power-shell, zsh]
Options:
-h, --help Print help
```
### `generate-fig-spec`
```
Generate Fig specification
Usage: nym-socks5-client generate-fig-spec
Options:
-h, --help Print help
```
Example output:
```
const completion: Fig.Spec = {
name: "nym-socks5-client",
description: "A SOCKS5 localhost proxy that converts incoming messages to Sphinx and sends them to a Nym address",
subcommands: [
{
name: "init",
description: "Initialise a Nym client. Do this first!",
options: [
{
name: "--id",
description: "Id of client we want to create config for",
isRepeatable: true,
args: {
name: "id",
},
},
{
name: "--gateway",
description: "Id of the gateway we are going to connect to",
isRepeatable: true,
args: {
name: "gateway",
isOptional: true,
},
},
{
name: "--nyxd-urls",
description: "Comma separated list of rest endpoints of the nyxd validators",
hidden: true,
isRepeatable: true,
args: {
name: "nyxd_urls",
isOptional: true,
},
},
{
name: "--nym-apis",
description: "Comma separated list of rest endpoints of the API validators",
isRepeatable: true,
args: {
name: "nym_apis",
isOptional: true,
},
},
{
name: "--custom-mixnet",
description: "Path to .json file containing custom network specification",
hidden: true,
isRepeatable: true,
args: {
name: "custom_mixnet",
isOptional: true,
template: "filepaths",
},
},
{
name: "--enabled-credentials-mode",
description: "Set this client to work in a enabled credentials mode that would attempt to use gateway with bandwidth credential requirement",
hidden: true,
isRepeatable: true,
args: {
name: "enabled_credentials_mode",
isOptional: true,
suggestions: [
"true",
"false",
],
},
},
{
name: "--provider",
description: "Address of the socks5 provider to send messages to",
isRepeatable: true,
args: {
name: "provider",
},
},
{
name: "--use-reply-surbs",
description: "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",
isRepeatable: true,
args: {
name: "use_reply_surbs",
isOptional: true,
suggestions: [
"true",
"false",
],
},
},
{
name: ["-p", "--port"],
description: "Port for the socket to listen on in all subsequent runs",
isRepeatable: true,
args: {
name: "port",
isOptional: true,
},
},
{
name: "--host",
description: "The custom host on which the socks5 client will be listening for requests",
isRepeatable: true,
args: {
name: "host",
isOptional: true,
},
},
{
name: ["-o", "--output"],
isRepeatable: true,
args: {
name: "output",
isOptional: true,
suggestions: [
"text",
"json",
],
},
},
{
name: "--force-tls-gateway",
description: "Specifies whether the client will attempt to enforce tls connection to the desired gateway",
},
{
name: "--latency-based-selection",
description: "Specifies whether the new gateway should be determined based by latency as opposed to being chosen uniformly",
exclusiveOn: [
"--gateway",
],
},
{
name: "--fastmode",
description: "Mostly debug-related option to increase default traffic rate so that you would not need to modify config post init",
},
{
name: "--no-cover",
description: "Disable loop cover traffic and the Poisson rate limiter (for debugging only)",
},
{
name: ["-h", "--help"],
description: "Print help (see more with '--help')",
},
],
},
{
name: "run",
description: "Run the Nym client with provided configuration client optionally overriding set parameters",
options: [
{
name: "--id",
description: "Id of client we want to create config for",
isRepeatable: true,
args: {
name: "id",
},
},
{
name: "--gateway",
description: "Id of the gateway we want to connect to. If overridden, it is user's responsibility to ensure prior registration happened",
isRepeatable: true,
args: {
name: "gateway",
isOptional: true,
},
},
{
name: "--nyxd-urls",
description: "Comma separated list of rest endpoints of the nyxd validators",
hidden: true,
isRepeatable: true,
args: {
name: "nyxd_urls",
isOptional: true,
},
},
{
name: "--nym-apis",
description: "Comma separated list of rest endpoints of the API validators",
isRepeatable: true,
args: {
name: "nym_apis",
isOptional: true,
},
},
{
name: "--custom-mixnet",
description: "Path to .json file containing custom network specification",
hidden: true,
isRepeatable: true,
args: {
name: "custom_mixnet",
isOptional: true,
template: "filepaths",
},
},
{
name: "--enabled-credentials-mode",
description: "Set this client to work in a enabled credentials mode that would attempt to use gateway with bandwidth credential requirement",
hidden: true,
isRepeatable: true,
args: {
name: "enabled_credentials_mode",
isOptional: true,
suggestions: [
"true",
"false",
],
},
},
{
name: "--use-anonymous-replies",
description: "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",
isRepeatable: true,
args: {
name: "use_anonymous_replies",
isOptional: true,
suggestions: [
"true",
"false",
],
},
},
{
name: "--provider",
description: "Address of the socks5 provider to send messages to",
isRepeatable: true,
args: {
name: "provider",
isOptional: true,
},
},
{
name: ["-p", "--port"],
description: "Port for the socket to listen on",
isRepeatable: true,
args: {
name: "port",
isOptional: true,
},
},
{
name: "--host",
description: "The custom host on which the socks5 client will be listening for requests",
isRepeatable: true,
args: {
name: "host",
isOptional: true,
},
},
{
name: "--geo-routing",
description: "Set geo-aware mixnode selection when sending mixnet traffic, for experiments only",
hidden: true,
isRepeatable: true,
args: {
name: "geo_routing",
isOptional: true,
},
},
{
name: "--fastmode",
description: "Mostly debug-related option to increase default traffic rate so that you would not need to modify config post init",
},
{
name: "--no-cover",
description: "Disable loop cover traffic and the Poisson rate limiter (for debugging only)",
},
{
name: "--medium-toggle",
description: "Enable medium mixnet traffic, for experiments only. This includes things like disabling cover traffic, no per hop delays, etc",
},
{
name: "--outfox",
},
{
name: ["-h", "--help"],
description: "Print help (see more with '--help')",
},
],
},
{
name: "import-credential",
description: "Import a pre-generated credential",
options: [
{
name: "--id",
description: "Id of client that is going to import the credential",
isRepeatable: true,
args: {
name: "id",
},
},
{
name: "--credential-data",
description: "Explicitly provide the encoded credential data (as base58)",
isRepeatable: true,
args: {
name: "credential_data",
isOptional: true,
},
},
{
name: "--credential-path",
description: "Specifies the path to file containing binary credential data",
isRepeatable: true,
args: {
name: "credential_path",
isOptional: true,
template: "filepaths",
},
},
{
name: "--version",
hidden: true,
isRepeatable: true,
args: {
name: "version",
isOptional: true,
},
},
{
name: ["-h", "--help"],
description: "Print help",
},
],
},
{
name: "list-gateways",
description: "List all registered with gateways",
options: [
{
name: "--id",
description: "Id of client we want to list gateways for",
isRepeatable: true,
args: {
name: "id",
},
},
{
name: ["-o", "--output"],
isRepeatable: true,
args: {
name: "output",
isOptional: true,
suggestions: [
"text",
"json",
],
},
},
{
name: ["-h", "--help"],
description: "Print help",
},
],
},
{
name: "add-gateway",
description: "Add new gateway to this client",
options: [
{
name: "--id",
description: "Id of client we want to add gateway for",
isRepeatable: true,
args: {
name: "id",
},
},
{
name: "--gateway-id",
description: "Explicitly specify id of the gateway to register with. If unspecified, a random gateway will be chosen instead",
isRepeatable: true,
args: {
name: "gateway_id",
isOptional: true,
},
},
{
name: "--nym-apis",
description: "Comma separated list of rest endpoints of the API validators",
isRepeatable: true,
args: {
name: "nym_apis",
isOptional: true,
},
},
{
name: "--custom-mixnet",
description: "Path to .json file containing custom network specification",
hidden: true,
isRepeatable: true,
args: {
name: "custom_mixnet",
isOptional: true,
template: "filepaths",
},
},
{
name: ["-o", "--output"],
isRepeatable: true,
args: {
name: "output",
isOptional: true,
suggestions: [
"text",
"json",
],
},
},
{
name: "--force-tls-gateway",
description: "Specifies whether the client will attempt to enforce tls connection to the desired gateway",
},
{
name: "--latency-based-selection",
description: "Specifies whether the new gateway should be determined based by latency as opposed to being chosen uniformly",
exclusiveOn: [
"--gateway-id",
],
},
{
name: "--set-active",
description: "Specify whether this new gateway should be set as the active one",
},
{
name: ["-h", "--help"],
description: "Print help",
},
],
},
{
name: "switch-gateway",
description: "Change the currently active gateway. Note that you must have already registered with the new gateway!",
options: [
{
name: "--id",
description: "Id of client we want to list gateways for",
isRepeatable: true,
args: {
name: "id",
},
},
{
name: "--gateway-id",
description: "Id of the gateway we want to switch to",
isRepeatable: true,
args: {
name: "gateway_id",
},
},
{
name: ["-h", "--help"],
description: "Print help",
},
],
},
{
name: "build-info",
description: "Show build information of this binary",
options: [
{
name: ["-o", "--output"],
isRepeatable: true,
args: {
name: "output",
isOptional: true,
suggestions: [
"text",
"json",
],
},
},
{
name: ["-h", "--help"],
description: "Print help",
},
],
},
{
name: "completions",
description: "Generate shell completions",
options: [
{
name: ["-h", "--help"],
description: "Print help",
},
],
args: {
name: "shell",
suggestions: [
"bash",
"elvish",
"fish",
"power-shell",
"zsh",
],
},
},
{
name: "generate-fig-spec",
description: "Generate Fig specification",
options: [
{
name: ["-h", "--help"],
description: "Print help",
},
],
},
{
name: "help",
description: "Print this message or the help of the given subcommand(s)",
subcommands: [
{
name: "init",
description: "Initialise a Nym client. Do this first!",
},
{
name: "run",
description: "Run the Nym client with provided configuration client optionally overriding set parameters",
},
{
name: "import-credential",
description: "Import a pre-generated credential",
},
{
name: "list-gateways",
description: "List all registered with gateways",
},
{
name: "add-gateway",
description: "Add new gateway to this client",
},
{
name: "switch-gateway",
description: "Change the currently active gateway. Note that you must have already registered with the new gateway!",
},
{
name: "build-info",
description: "Show build information of this binary",
},
{
name: "completions",
description: "Generate shell completions",
},
{
name: "generate-fig-spec",
description: "Generate Fig specification",
},
{
name: "help",
description: "Print this message or the help of the given subcommand(s)",
},
],
},
],
options: [
{
name: ["-c", "--config-env-file"],
description: "Path pointing to an env file that configures the client",
isRepeatable: true,
args: {
name: "config_env_file",
isOptional: true,
template: "filepaths",
},
},
{
name: "--no-banner",
description: "Flag used for disabling the printed banner in tty",
},
{
name: ["-h", "--help"],
description: "Print help",
},
{
name: ["-V", "--version"],
description: "Print version",
},
],
};
export default completion;
```
@@ -0,0 +1,192 @@
# `nymvisor` Binary Commands
These docs are autogenerated by the `autodocs` script.
**TODO add link**
```
Usage: nymvisor [OPTIONS] <COMMAND>
Commands:
init Initialise a nymvisor instance with persistent Config.toml file
run Run the associated daemon with the preconfigured settings
build-info Show build information of this binary
daemon-build-info Show build information of the associated daemon
add-upgrade Queues up another upgrade for the associated daemon
config Show configuration options being used by this instance of nymvisor
help Print this message or the help of the given subcommand(s)
Options:
-c, --config-env-file <CONFIG_ENV_FILE>
Path pointing to an env file that configures the nymvisor and overrides any preconfigured values
-h, --help
Print help
-V, --version
Print version
```
### `init`
```
Initialise a nymvisor instance with persistent Config.toml file
Usage: nymvisor init [OPTIONS] <DAEMON_BINARY>
Arguments:
<DAEMON_BINARY> Path to the daemon's executable
Options:
--id <ID>
ID specifies the human readable ID of this particular nymvisor instance. Can be overridden with $NYMVISOR_ID environmental variable
--upstream-base-upgrade-url <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 <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 <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 <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 <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 <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 <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 <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 <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 <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 <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 <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 <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 <OUTPUT>
[default: text] [possible values: text, json]
-h, --help
Print help
```
### `run`
```
Run the associated daemon with the preconfigured settings
Usage: nymvisor run [DAEMON_ARGS]...
Arguments:
[DAEMON_ARGS]...
Options:
-h, --help Print help
```
### `build-info`
```
Show build information of this binary
Usage: nymvisor build-info [OPTIONS]
Options:
-o, --output <OUTPUT> [default: text] [possible values: text, json]
-h, --help Print help
```
Example output:
```
Binary Name: nymvisor
Build Timestamp: 2024-05-07T13:11:43.523733081Z
Build Version: 0.1.0
Commit SHA: 7d233a4a2fc697a2f97e504db6a3765cc9f2dd49
Commit Date: 2024-04-25T11:27:18.000000000+02:00
Commit Branch: max/auto-docs
rustc Version: 1.78.0
rustc Channel: stable
cargo Profile: release
```
### `daemon-build-info`
```
Show build information of the associated daemon
Usage: nymvisor daemon-build-info [OPTIONS]
Options:
-o, --output <OUTPUT> [default: text] [possible values: text, json]
-h, --help Print help
```
Example output:
```
Binary Name: nym-mixnode
Build Timestamp: 2024-03-22T17:49:30.278145161Z
Build Version: 1.1.34
Commit SHA: 31bbfdecf5ea6deff69bd72a0bccd9dddae1003f
Commit Date: 2024-02-19T10:52:15.000000000+01:00
Commit Branch: max/docs-overhaul-1
rustc Version: 1.74.1
rustc Channel: stable
cargo Profile: release
```
### `add-upgrade`
```
Queues up another upgrade for the associated daemon
Usage: nymvisor add-upgrade [OPTIONS] --upgrade-name <UPGRADE_NAME> <DAEMON_BINARY>
Arguments:
<DAEMON_BINARY> Path to the daemon's upgrade executable
Options:
--upgrade-name <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 <PUBLISH_DATE> Specifies the publish date metadata field of this upgrade. If unset, the current time will be used
--upgrade-time <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 <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 <OUTPUT> [default: text] [possible values: text, json]
-h, --help Print help
```
### `config`
```
Show configuration options being used by this instance of nymvisor
Usage: nymvisor config [OPTIONS]
Options:
-o, --output <OUTPUT> [default: text] [possible values: text, json]
-h, --help Print help
```
Example output:
```
id: nym-mixnode-default
daemon name: nym-mixnode
daemon home: /home/xen/.nym/mixnodes/my-node
upstream base upgrade url: https://nymtech.net/.wellknown/
disable nymvisor logs: false
CUSTOM upgrade data directory ""
upstream absolute upgrade url: ""
allow binaries download: true
enforce download checksum: true
restart after upgrade: true
restart on failure: false
on failure restart delay: 10s
max startup failures: 10
startup period duration: 2m
shutdown grace period: 10s
CUSTOM backup data directory ""
UNSAFE skip backups false
```
+157 -6
View File
@@ -1,8 +1,10 @@
use log::info;
use std::fs;
use std::fs::File;
use std::io::{self, Write};
use std::process::{Command, Output};
use std::{fs, vec};
const PATH: &str = "./autodoc-generated-markdown/";
fn main() -> io::Result<()> {
env_logger::init();
@@ -63,18 +65,56 @@ fn main() -> io::Result<()> {
),
];
let commands_with_subsubcommands = vec![(
"../../target/release/nym-cli",
vec![
(
"account",
vec!["create", "balance", "pub-key", "send", "send-multiple"],
),
("signature", vec!["sign", "verify"]),
(
"coconut",
vec![
"generate-freepass",
"issue-credentials",
"recover-credentials",
"import-credential",
],
),
("block", vec!["get", "time", "current-height"]),
(
"cosmwasm",
vec![
"upload",
"init",
"generate-init-message",
"migrate",
"execute",
],
),
("tx", vec!["get", "query"]),
(
"vesting-schedule",
vec!["create", "query", "vested-balance", "withdraw-vested"],
),
("mixnet", vec!["query", "delegators", "operators"]),
("generate-fig", vec![""]),
],
)];
for (main_command, subcommands) in commands_with_subcommands {
let last_word = get_last_word_from_filepath(main_command);
info!("{last_word:#?}");
if !fs::metadata("./autodoc/")
if !fs::metadata(PATH)
.map(|metadata| metadata.is_dir())
.unwrap_or(false)
{
fs::create_dir_all("./autodoc/")?;
fs::create_dir_all(PATH)?;
}
let mut file = File::create(format!("autodoc/{}.md", last_word.unwrap()))?;
let mut file = File::create(format!("{}/{}-commands.md", PATH, last_word.unwrap()))?;
writeln!(
file,
"# {} Binary Commands",
@@ -87,10 +127,45 @@ fn main() -> io::Result<()> {
)?;
let output = Command::new(main_command).arg("--help").output()?;
write_output_to_file(&mut file, output)?;
for subcommand in subcommands {
execute_command(&mut file, main_command, subcommand)?;
execute_command(&mut file, main_command, subcommand, None)?;
}
}
// nym-cli has subsubcommands so needs its own loop
for (main_command, subcommands) in &commands_with_subsubcommands {
let last_word = get_last_word_from_filepath(main_command);
info!("{last_word:#?}");
let mut file = File::create(format!("{}/{}-commands.md", PATH, last_word.unwrap()))?;
writeln!(
file,
"# {} Binary Commands",
format!("`{}`", last_word.unwrap())
)?;
writeln!(
file,
"\nThese docs are autogenerated by the `autodocs` script.
\n**TODO add link**"
)?;
// execute_command(&mut file, main_command, subcommands, None);
println!("{:#?}", last_word);
let output = Command::new(main_command).arg("--help").output()?;
write_output_to_file(&mut file, output)?;
for (subcommand, subsubcommands) in subcommands {
for subsubcommand in subsubcommands {
execute_command(&mut file, main_command, subcommand, Some(subsubcommand))?;
println!(
"{:#?} {:#?} {:#?}",
last_word.unwrap(),
subcommand,
subsubcommand
);
}
}
}
Ok(())
}
@@ -99,7 +174,82 @@ fn get_last_word_from_filepath(filepath: &str) -> Option<&str> {
parts.last().copied()
}
fn execute_command(file: &mut File, main_command: &str, subcommand: &str) -> io::Result<()> {
fn execute_command(
file: &mut File,
main_command: &str,
subcommand: &str,
subsubcommand: Option<&str>,
) -> io::Result<()> {
if subsubcommand.is_some() {
println!("{}{:#?}", subcommand, subsubcommand);
writeln!(file, "\n### `{} {}`", subcommand, subsubcommand.unwrap())?;
// first execute the command with `--help`
info!("executing {} {} --help ", main_command, subcommand);
let output = Command::new(main_command)
.arg(subcommand)
.arg(subsubcommand.unwrap())
.arg("--help")
.output()?;
if !output.stdout.is_empty() {
write_output_to_file(file, output)?;
} else {
info!("empty stdout - nothing to write");
}
let output = Command::new(main_command)
.arg(subcommand)
.arg(subsubcommand.unwrap())
.output()?;
println!("output ---- {output:#?}");
write_output_to_file(file, output)?;
} else {
writeln!(file, "\n### `{}`", subcommand)?;
println!("{}", subcommand);
// first execute the command with `--help`
info!("executing {} {} --help ", main_command, subcommand);
let output = Command::new(main_command)
.arg(subcommand)
.arg("--help")
.output()?;
if !output.stdout.is_empty() {
write_output_to_file(file, output)?;
} else {
info!("empty stdout - nothing to write");
}
// then execute w/out help: the majority of functions will fail since you're not passing
// required params but thats fine as we can just not render stderr into the final file.
//
// this check is basically checking for the rare commands (rn just one) that start a process with no params
// perhaps if this list grows we could just add a timeout and shunt the running and writing
// into a thread with a timeout or something but for right now its fine / thats overkill
if get_last_word_from_filepath(main_command).unwrap() == "nym-node"
|| get_last_word_from_filepath(main_command).unwrap() == "nym-api"
|| get_last_word_from_filepath(main_command).unwrap() == "nymvisor"
&& subcommand == "run"
{
info!("SKIPPING {} {}", main_command, subcommand);
} else {
info!("executing {} {}", main_command, subcommand);
let output = Command::new(main_command).arg(subcommand).output()?;
if !output.stdout.is_empty() {
writeln!(file, "Example output:")?;
write_output_to_file(file, output)?;
} else {
info!("empty stdout - nothing to write");
if !&output.stderr.is_empty() {
info!("stderr: {:#?}", String::from_utf8_lossy(&output.stderr));
}
}
}
}
Ok(())
}
/*
fn execute_command(file: &mut File, main_command: &str, subcommand: &str) -> io::Result<()> {
// title
writeln!(file, "\n### `{}`", subcommand)?;
@@ -141,6 +291,7 @@ fn execute_command(file: &mut File, main_command: &str, subcommand: &str) -> io:
}
Ok(())
}
*/
fn write_output_to_file(file: &mut File, output: Output) -> io::Result<()> {
writeln!(file, "```")?;