From 3d9cbf351f141d752ddca0fe30b4994781edf4f3 Mon Sep 17 00:00:00 2001 From: mx Date: Wed, 12 Apr 2023 10:20:57 +0200 Subject: [PATCH] * started adding cmdrun command inputs instead of hardcoded command outputs --- documentation/docs/book.toml | 9 +- documentation/docs/src/nodes/gateway-setup.md | 100 +----------------- .../docs/src/nodes/mix-node-setup.md | 14 +-- 3 files changed, 16 insertions(+), 107 deletions(-) diff --git a/documentation/docs/book.toml b/documentation/docs/book.toml index 23fc7bb6ce..26a0ab0cbf 100644 --- a/documentation/docs/book.toml +++ b/documentation/docs/book.toml @@ -47,17 +47,20 @@ assets_version = "2.0.0" # do not edit: managed by `mdbook-admonish install` # variables preprocessor: import variables into files # https://gitlab.com/tglman/mdbook-variables/ [preprocessor.variables.variables] -# code prerequisites versions minimum_rust_version = "1.66" -# minimum_node_version = "" -# nym platform code most recent release platform_release_version = "v1.1.14" mix_node_release_version = "v1.1.15" +# used by the cmdrun preprocessor - relative path from inside src/ +# binaries_path = '../../../../target/release/' [preprocessor.last-changed] command = "mdbook-last-changed" renderer = ["html"] +# used for grabbing output of binary commands for automation +# https://github.com/FauconFan/mdbook-cmdrun +[preprocessor.cmdrun] + # more pre-processor plugins to look into from https://github.com/rust-lang/mdBook/wiki/Third-party-plugins & https://lib.rs/keywords/mdbook-preprocessor # mdbook-i18n diff --git a/documentation/docs/src/nodes/gateway-setup.md b/documentation/docs/src/nodes/gateway-setup.md index 2c299aaf25..f221c2ad96 100644 --- a/documentation/docs/src/nodes/gateway-setup.md +++ b/documentation/docs/src/nodes/gateway-setup.md @@ -42,48 +42,9 @@ You can check that your binaries are properly compiled with: ./nym-gateway --help ``` -```console - -``` - ~~~admonish example collapsible=true title="Console output" ``` - _ __ _ _ _ __ ___ - | '_ \| | | | '_ \ _ \ - | | | | |_| | | | | | | - |_| |_|\__, |_| |_| |_| - |___/ - - (gateway - version {{platform_release_version}}) - - -nym-gateway {{platform_release_version}} -Nymtech -Implementation of the Nym Mixnet Gateway - -USAGE: - nym-gateway [OPTIONS] - -OPTIONS: - --config-env-file - Path pointing to an env file that configures the gateway - - -h, --help - Print help information - - -V, --version - Print version information - -SUBCOMMANDS: - completions Generate shell completions - generate-fig-spec Generate Fig specification - help Print this message or the help of the given subcommand(s) - init Initialise the gateway - node-details Show details of this gateway - run Starts the gateway - sign Sign text to prove ownership of this mixnode - upgrade Try to upgrade the gateway - + ``` ~~~ @@ -93,7 +54,6 @@ You can also check the various arguments required for individual commands with: ./nym-gateway --help ``` - ### Initialising your gateway To check available configuration options use: @@ -103,62 +63,7 @@ To check available configuration options use: ~~~admonish example collapsible=true title="Console output" ``` - - _ __ _ _ _ __ ___ - | '_ \| | | | '_ \ _ \ - | | | | |_| | | | | | | - |_| |_|\__, |_| |_| |_| - |___/ - - (gateway - version {{platform_release_version}}) - - -nym-gateway-init -Initialise the gateway - -USAGE: - nym-gateway init [OPTIONS] --id --host --wallet-address - -OPTIONS: - --announce-host - The host that will be reported to the directory server - - --clients-port - The port on which the gateway will be listening for clients gateway-requests - - --datastore - Path to sqlite database containing all gateway persistent data - - --enabled-statistics - Enable/disable gateway anonymized statistics that get sent to a statistics aggregator server - - -h, --help - Print help information - - --host - The custom host on which the gateway will be running for receiving sphinx packets - - --id - Id of the gateway we want to create config for - - --mix-port - The port on which the gateway will be listening for sphinx packets - - --mnemonic - Cosmos wallet mnemonic needed for double spending protection - - --statistics-service-url - URL where a statistics aggregator is running. The default value is a Nym aggregator server - - --validator-apis - Comma separated list of endpoints of the validators APIs - - --validators - Comma separated list of endpoints of the validator - - --wallet-address - The wallet address you will use to bond this gateway, e.g. - nymt1z9egw0knv47nmur0p8vk4rcx59h9gg4zuxrrr9 + ``` ~~~ @@ -226,6 +131,7 @@ The `run` command starts the gateway: ~~~admonish example collapsible=true title="Console output" ``` + Starting gateway supergateway... To bond your gateway you will need to install the Nym wallet, go to https://nymtech.net/get-involved and select the Download button. diff --git a/documentation/docs/src/nodes/mix-node-setup.md b/documentation/docs/src/nodes/mix-node-setup.md index 687bbbaf43..b53f7eada2 100644 --- a/documentation/docs/src/nodes/mix-node-setup.md +++ b/documentation/docs/src/nodes/mix-node-setup.md @@ -3,7 +3,7 @@ > The Nym mix node binary was built in the [building nym](../binaries/building-nym.md) section. If you haven't yet built Nym and want to run the code, go there first. ```admonish info -The `nym-mixnode` binary is currently one point version ahead of the rest of the platform binaries due to a patch applied between releases. +The `nym-mixnode` binary is currently one point version ahead of the rest of the platform binaries due to a patch applied between releases. ``` ## Preliminary steps @@ -21,7 +21,7 @@ Before you initialise and run your mixnode, head to our [website](https://nymtec If you don't already have one, please create a Nym address using the wallet, and fund it with tokens. The minimum amount required to bond a mixnode is 100 `NYM`, but make sure you have a bit more to account for gas costs. -`NYM` can be purchased via Bity from the wallet itself, and is currently present on several exchanges. Head to our [telegram channels](https://t.me/nymchan) to find out where to get `NYM` tokens. +`NYM` can be purchased via Bity from the wallet itself, and is currently present on several exchanges. > Remember that you can **only** use Cosmos `NYM` tokens to bond your mixnode. You **cannot** use ERC20 representations of `NYM` to run a node. @@ -181,9 +181,9 @@ From `v1.1.3`, if you unbond your mixnode that means you are leaving the mix You can bond your mix node via the Desktop wallet. -* Open your wallet, and head to the `Bond` page, then select the node type and input your node details. Press `continue` +* Open your wallet, and head to the `Bond` page, then select the node type and input your node details. Press `continue` -* You will be asked to run a the `sign` command with your `gateway` - copy and paste the long signature as the value of `--contract-msg` and run it. It will look something like this: +* You will be asked to run a the `sign` command with your `gateway` - copy and paste the long signature as the value of `--contract-msg` and run it. It will look something like this: ~~~admonish example collapsible=true title="Console output" ``` @@ -195,10 +195,10 @@ You can bond your mix node via the Desktop wallet. | | | | |_| | | | | | | |_| |_|\__, |_| |_| |_| |___/ - + (nym-mixnode - version 1.1.14) - + >>> attempting to sign 5XrvVEMzRJk2AcT2h1o6ErZNb8z1ZzD3h7teipBW3NUtrtYq7vu4DRMgzZRTPVPnyr2YWCxpmKCMFaEXvksnJ4jt7np3NMLxsLMrFjEBhh67Crtjy4868vCzAivUqzdc365RiqxQQKtv4r9eTk9mTbE9JY8U3TxzKJCSGcBqbrb9JX3HrZVWm6tqbUYbsnku9pqnfeyeUiaYKY44Lm72TYrkZfRrMAZLMATiXT1ntmiKqT37HzRxNZjiH8qHeQEoRHkgDsmXDXRbfppGTpPrN7R4sjynJzehzUBZ8Ug7ovT9FoAHb8kuVQhUiMs1js6tdwtthzQMbPi9vwxUtVvjYknN2fnJgMnckEhzJJpJDCNdH7YhpPaWQnGVVS334mskiuqkbRVrFPJN2nnwArHr3L2cLxSMk9toKfw7ViKJ2p5E5JxiSmKY1cFGZ7uRLsuQ833PJN9JE8crPtkBNefqkbFNz68S5jPmzUShSvAc4TqXKeovDASFmmhKaPqLUrfsSWm7nzuKnzJSMADF6xSuwr9cknMoirqkRkLe7ybJ2ERwSdf5cUxMjF7yjS8tW9hZudnTUb1uPNDuSmPPVrCR12XZyFzBvVgxH51ZNJTym46nqnfA881LQcmFMnCwJf39rVJ4ASLnzEzmuwXj75QoB9ce9kiLmoBNLYe4QKSB6gDd858VnBtBNQELVuCCZbrTYuSCeNdUFhvMwD4kryc1pBYUa8Ro81F3QVfiKN >>> decoding the message... >>> message to sign: {"nonce":0,"algorithm":"ed25519","message_type":"mixnode-bonding","content":{"sender":"n1eufxdlgt0puwrwptgjfqne8pj4nhy2u5ft62uq","proxy":null,"funds":[{"denom":"unym","amount":"100000000"}],"data":{"mix_node":{"host":"62.240.134.189","mix_port":1789,"verloc_port":1790,"http_api_port":8000,"sphinx_key":"CfZSy1jRfrfiVi9JYexjFWPqWkKoY72t7NdpWaq37K8Z","identity_key":"DhmUYedPZvhP9MMwXdNpPaqCxxTQgjAg78s2nqtTTiNF","version":"1.1.14"},"cost_params":{"profit_margin_percent":"0.1","interval_operating_cost":{"denom":"unym","amount":"40000000"}}}}} @@ -216,7 +216,7 @@ You can bond your mix node via the Desktop wallet. ![Paste Signature](../images/wallet-sign.png) -* Your node will now be bonded and ready to mix at the beginning of the next epoch (at most 1 hour). +* Your node will now be bonded and ready to mix at the beginning of the next epoch (at most 1 hour). > You are asked to `sign` a transaction on bonding so that the mixnet smart contract is able to map your nym address to your node. This allows us to create a nonce for each account and defend against replay attacks.