[NEW-DOCs/operators]: Command output, accordion, api scraping & all final tasks (#5026)
* add custom scripts, create prebuild to import data to pages * update after latest prebuild * auto commit generated command files * add accordion component * add changbelog page * add node_api_check outputs * finish all command outputs * more accordions beautifications * finish accordion * PR ready to go * address review comments --------- Co-authored-by: mfahampshire <maxhampshire@pm.me>
This commit is contained in:
committed by
mfahampshire
parent
9ce2cc0218
commit
2d6ed2ac9e
@@ -227,3 +227,5 @@ Options:
|
||||
-o, --output <OUTPUT> [default: text] [possible values: text, json]
|
||||
-h, --help Print help
|
||||
```
|
||||
|
||||
### ``
|
||||
|
||||
@@ -79,7 +79,7 @@ Run the associated daemon with the preconfigured settings
|
||||
Usage: nymvisor run [DAEMON_ARGS]...
|
||||
|
||||
Arguments:
|
||||
[DAEMON_ARGS]...
|
||||
[DAEMON_ARGS]...
|
||||
|
||||
Options:
|
||||
-h, --help Print help
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
import Accordion from "@mui/material/Accordion";
|
||||
import AccordionActions from "@mui/material/AccordionActions";
|
||||
import AccordionSummary from "@mui/material/AccordionSummary";
|
||||
import AccordionDetails from "@mui/material/AccordionDetails";
|
||||
import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
|
||||
import {
|
||||
TableContainer,
|
||||
Table,
|
||||
TableBody,
|
||||
TableCell,
|
||||
TableRow,
|
||||
Paper,
|
||||
} from "@mui/material";
|
||||
|
||||
|
||||
|
||||
export const AccordionTemplate = ({ name, children }) => {
|
||||
return (
|
||||
<div>
|
||||
<Accordion>
|
||||
<AccordionSummary
|
||||
expandIcon={<ExpandMoreIcon />}
|
||||
aria-controls="panel1-content"
|
||||
id="panel1-header"
|
||||
aria-label="<code>nym-node --help</code> command output"
|
||||
>
|
||||
<strong>{name}</strong>
|
||||
</AccordionSummary>
|
||||
<AccordionDetails>
|
||||
{children}
|
||||
</AccordionDetails>
|
||||
</Accordion>
|
||||
</div>
|
||||
)
|
||||
};
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
Wednesday, October 23rd 2024, 20:45:36 UTC
|
||||
@@ -0,0 +1,17 @@
|
||||
```python
|
||||
usage: Nym-node API check [-h] [-V]
|
||||
{query_stats,q,query,version_count,v,version} ...
|
||||
|
||||
Run through all endpoints and print results.
|
||||
|
||||
positional arguments:
|
||||
{query_stats,q,query,version_count,v,version}
|
||||
query_stats (q, query)
|
||||
Get all nodes API endpoints
|
||||
version_count (v, version)
|
||||
Sum of nodes in given version(s)
|
||||
|
||||
options:
|
||||
-h, --help show this help message and exit
|
||||
-V, --version show program's version number and exit
|
||||
```
|
||||
@@ -0,0 +1,15 @@
|
||||
```python
|
||||
usage: Nym-node API check query_stats [-h] [-n] [-m] [-o [OUTPUT]] id
|
||||
|
||||
positional arguments:
|
||||
id supply nym-node identity key
|
||||
|
||||
options:
|
||||
-h, --help show this help message and exit
|
||||
-n, --no_routing_history
|
||||
Display node stats without routing history
|
||||
-m, --markdown Display results in markdown format
|
||||
-o [OUTPUT], --output [OUTPUT]
|
||||
Save results to file (in current dir or supply with
|
||||
path without filename)
|
||||
```
|
||||
@@ -0,0 +1,19 @@
|
||||
```sh
|
||||
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
|
||||
--no-banner
|
||||
A no-op flag included for consistency with other binaries (and compatibility with nymvisor, oops)
|
||||
-h, --help
|
||||
Print help
|
||||
-V, --version
|
||||
Print version
|
||||
```
|
||||
@@ -0,0 +1,22 @@
|
||||
```sh
|
||||
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
|
||||
```
|
||||
@@ -0,0 +1,79 @@
|
||||
```sh
|
||||
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=]
|
||||
--accept-operator-terms-and-conditions
|
||||
Explicitly specify whether you agree with the terms and conditions of a nym node operator as defined at <https://nymtech.net/terms-and-conditions/operators/v1.0.0> [env: NYMNODE_ACCEPT_OPERATOR_TERMS=]
|
||||
--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=]
|
||||
--local
|
||||
Flag specifying this node will be running in a local setting [env: NYMNODE_LOCAL=]
|
||||
--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-ip <WIREGUARD_PRIVATE_IP>
|
||||
Private IP address of the wireguard gateway. default: `10.1.0.1` [env: NYMNODE_WG_IP=]
|
||||
--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
|
||||
```
|
||||
@@ -0,0 +1,34 @@
|
||||
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
|
||||
--no-banner
|
||||
A no-op flag included for consistency with other binaries (and compatibility with nymvisor, oops)
|
||||
-h, --help
|
||||
Print help
|
||||
-V, --version
|
||||
Print version
|
||||
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
|
||||
--no-banner
|
||||
A no-op flag included for consistency with other binaries (and compatibility with nymvisor, oops)
|
||||
-h, --help
|
||||
Print help
|
||||
-V, --version
|
||||
Print version
|
||||
@@ -0,0 +1,20 @@
|
||||
```sh
|
||||
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
|
||||
```
|
||||
@@ -0,0 +1,6 @@
|
||||
[2m2024-10-23T17:45:06.789452Z[0m [32m INFO[0m [2mtools/nymvisor/src/cli/init.rs[0m[2m:[0m[2m416[0m[2m:[0m enabled nymvisor logging
|
||||
[2m2024-10-23T17:45:06.789476Z[0m [32m INFO[0m [2mtools/nymvisor/src/cli/init.rs[0m[2m:[0m[2m419[0m[2m:[0m initialising the nymvisor
|
||||
[2m2024-10-23T17:45:06.789497Z[0m [32m INFO[0m [1mget_build_information[0m: [2mtools/nymvisor/src/daemon/mod.rs[0m[2m:[0m[2m63[0m[2m:[0m attempting to obtain daemon build information [2m[3mself.executable_path[0m[2m=[0m"./nym-node"[0m
|
||||
[2m2024-10-23T17:45:06.795736Z[0m [32m INFO[0m [2mtools/nymvisor/src/cli/init.rs[0m[2m:[0m[2m217[0m[2m:[0m initialising the directory structure
|
||||
[2m2024-10-23T17:45:06.795827Z[0m [32m INFO[0m [2mtools/nymvisor/src/cli/init.rs[0m[2m:[0m[2m250[0m[2m:[0m setting up the genesis binary
|
||||
[2m2024-10-23T17:45:06.796090Z[0m [32m INFO[0m [1mget_build_information[0m: [2mtools/nymvisor/src/daemon/mod.rs[0m[2m:[0m[2m63[0m[2m:[0m attempting to obtain daemon build information [2m[3mself.executable_path[0m[2m=[0m"/home/strix/.nym/nymvisors/data/nym-node/genesis/bin/nym-node"[0m
|
||||
@@ -0,0 +1,21 @@
|
||||
| **ISP** | **Locations** | **Public IPv6** | **Crypto Payments** | **Comments** | **Last Updated** |
|
||||
|:------------------------------------------------|:---------------------------------------------------------------------------------------------------------|:-------------------------------------|:---------------------------------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-------------------|
|
||||
| [AlexHost](https://alexhost.com) | Moldova, Bulgaria, Sweden, Netherlands | Yes, on by default | Yes | They allow TOR Bridges, Relays. Exit nodes are only allowed on dedicated servers (prices start from 26 EUR) | 07/2024 |
|
||||
| [BitLaunch](https://bitlaunch.io) | Canada, USA, UK | No | Yes | Expensive. Digial Ocean through BitLanch has IPv6 | 05/2024 |
|
||||
| [Cherry Servers](https://www.cherryservers.com) | Lithuania, Netherlands, USA, Singapore | No | Yes | Issued IP doesn’t match the location offered by the provider. | 05/2024 |
|
||||
| [Flokinet](https://flokinet.is) | Netherlands, Iceland, Romania,France | Yes, needs a ticket and custom setup | yes, including XMR | Very slow customer support | 05/2024 |
|
||||
| [HostSailor](https://hostsailor.com) | USA | Yes, based on ticket | Yes | The IPv6 setup needs custom research and is not documented | 05/2024 |
|
||||
| [Hostiko](https://hostiko.com.ua) | Ukraine, Germany | Yes, on by default | Yes | Ukrainian provider. They allow Exit nodes on Germany boxes but limit the bandwidth, you also have to restrict certain ports like 25 and 587. Make sure you open a ticket. | 07/2024 |
|
||||
| [Hostinger](https://hostinger.com) | France, Lithuania, India, USA, Brazil | Yes, out of the box | Yes | Crypto payments must be done per each server monthly or annually. | 05/2024 |
|
||||
| [Hostslick](https://hostslick.com) | Netherlands, Germany | Yes, on by default | Yes | Good amount of bandwidth for the price. Make sure you open the ticket if you want to run Exit node | 07/2024 |
|
||||
| [Incognet](https://incognet.io) | Netherlands and USA | Yes, on by default | Yes | They allow Tor exit nodes but you must adhere to their rules https://incognet.io/tor-exits | 07/2024 |
|
||||
| [IsHosting](https://ishosting.com/en) | Brazil, Netherlands | Yes, based on ticket | Yes | Expensive | 05/2024 |
|
||||
| [Linode](https://linode.com) | USA, Canada, Japan, India, Indonesia, Sweden, Netherlands, Germany, Brazil, France, UK, Australia, Italy | Yes out of the box | No, only through [BitLAunch](https://bitlaunch.io) | IPv6 sometimes need to be re-added in Networking tab, no reboot needed | 05/2024 |
|
||||
| [LiteServer](https://liteserver.nl) | Netherlands | Yes, on by default | Yes | Very reliable Dutch provider. They do allow Relay nodes but for Exit nodes you need to contact them. Always check T&C https://liteserver.nl/legal | 07/2024 |
|
||||
| [Mevspace](https://mevspace.com) | Poland | Yes, on by default | Yes | Flexible Polish providers with 3 DCs in Poland. They do allow Tor Exit nodes but you may need a dedicated server for this. Make sure you open a ticket to check. As of today's date, they have 48h for 1 EUR tariff | 07/2024 |
|
||||
| [Misaka](https://www.misaka.io/) | South Africa | Yes, native support | No | Very Expensive | 05/2024 |
|
||||
| [Njalla](https://nja.la) | Sweden | Yes | Yes | Privacy vandguards! The biggest VPS 45 is 3 cores only, but it works better than many “larger” servers on the market. | 05/2024 |
|
||||
| [RDP](https://rdp.sh) | Netherlands, USA, Poland | Yes, on by default | Yes | German provider. Exit nodes are allowed, policy is here https://rdp.sh/docs/faq/tor ports 25,465,587 must be closed. Make sure you open a ticket before running an exit node. | 07/2024 |
|
||||
| [TerraHost](https://terrahost.no) | Norway | Yes, on by default | Yes | Very reliable Norwegian provider. Only allow exit nodes on Dedicated servers subject to certain caveats (you must open a ticket). Always check T&C https://terrahost.no/avtalebetingelser | 07/2024 |
|
||||
| [iHostArt](https://ihostart.com) | Romania | Yes, on by default | Yes | Super permissive provider. They do allow Tor Exit/Relay/Bridge. Pro-free speech etc. Recently, IPv6 geolocation was set to North Korea, so be aware. | 07/2024 |
|
||||
| [vSys Host](https://vsys.host) | Ukraine, Netherlands, USA | Yes, on by default | Yes | Pretty permissive provider registered in Ukraine. Should allow Relay/Exit nodes but nothing in T&C, so better double check. | 07/2024 |
|
||||
@@ -0,0 +1,23 @@
|
||||
| **Flag (Option)** | **Variable** | **Description** | **Syntax example** |
|
||||
|:-----------------------------------------------|:------------------------------------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:--------------------------------------------------------------|
|
||||
| `-w` or `--write-changes` | *none* | Specify whether to write new changes - the values of other flags in the given command - to the config file | `--write-changes` |
|
||||
| `--accept-operator-terms-and-conditions` | *none* | A flag added explicitly to `nym-node run` command every time, showing that the operator agreed with [T&Cs](#terms--conditions) | `--accept-operator-terms-and-conditions` |
|
||||
| `--announce-wss-port` | `<ANNOUNCE_WSS_PORT>` | Port listening to Web Secure Socket, default and recommended `9001` | `9001` |
|
||||
| *not a flag* | `<ARGUMENTS>` | Replace with all flags used to run the binary with a given command | `--id alice_super_node –accept-operator-terms-and-conditions` |
|
||||
| *not a flag* | `<BINARY> ` | A name of a binary | `nym-node` |
|
||||
| `--expose-system-hardware` | `<EXPOSE_SYSTEM_HARDWARE>` | Specify whether basic system hardware information should be exposed. default: `true`, possible values: `true` or `false` | `--expose-system-hardware false` |
|
||||
| `--expose-system-info` | `<EXPOSE_SYSTEM_INFO>` | Specify whether basic system information should be exposed. default: `true`, possible values: `true` or `false` | `--expose-system-info false` |
|
||||
| `--hostname` | `<HOSTNAME>` | Your registered DNS domain, asigned to the VPS with `nym-node`. Use without prefix like `http://` or `https://` | `exit-gateway1.squad.nsl` |
|
||||
| `--http-bind-address` | `<HTTP_BIND_ADDRESS>` | Socket address this node will use for binding its http API - mandatory! Must be on port `8080`! | `--http-bind-address 0.0.0.0:8080` |
|
||||
| `--id` | `<ID>` | A local only `nym-node` identifier, specified by flag `--id`. Not mandatory as it defaults to `default-nym-node` if not specified. | `--id alice_super_node` |
|
||||
| *not a flag* | `<ID_KEY>` | Node public identity key, exposed on the network | `GQvHcg61viyN9brWn1hficjD66Q9TorsLN2CMGJewVfo` |
|
||||
| `--landing-page-assets-path` | `<LANDING_PAGE_ASSETS_PATH>` | A sub-directory located at `/var/www/<HOSTNAME>` containing html configuration files | `/var/www/exit-gateway1.squad.nsl` |
|
||||
| `--location` | `<LOCATION>` | Location of your node. Formats like 'Jamaica', or two-letter alpha2 (e.g. 'JM'), three-letter alpha3 (e.g. 'JAM') or three-digit numeric-3 (e.g. '388') can be provided. | `--location JAM` |
|
||||
| `--mixnet-bind-address` | `<MIXNET_BIND_ADDRESS>` | Address to bind to for listening for mixnet packets - mandatory! Must be on port `1789`! | `--mixnet-bind-address 0.0.0.0:1789` |
|
||||
| `--mode` | `<MODE>` | A functionality of your `nym-node` in the mixnet - mandatory! Chose from `entry-gateway`, `mixnode` or `exit-gateway` | `--mode exit-gateway` |
|
||||
| *not a flag* | `<NYXD_VERSION>` | Version of validator binaries | `v0.43.0` |
|
||||
| *not a flag* | `<PATH_TO>` | Specify a full path to the given file, directory or binary behind this variable | `/root/src/nym/target/release/` |
|
||||
| `--public-ips` | `<PUBLIC_IPS>` | IPv4 of the `nym-node` server - mandatory! Use this address as a `host` value for bonding.Use this address as a `host` value for bonding. | `--public-ips "$(curl -4 https://ifconfig.me)"` |
|
||||
| *not a flag* | `<WELCOME_TEXT>` | Any text you want to show on the landing page | Welcome to Nym Node, operator contact is example@email.me |
|
||||
| `--wireguard-enabled` | `<WIREGUARD_ENABLED>` | Specifies whether the wireguard service is enabled, possible values: `true` or `false` - `true` is recommended | `--wireguard-enabled true` |
|
||||
| `--wireguard-private-ip` | `<WIREGUARD_PRIVATE_IP>` | Private IP address of the wireguard gateway. This mandatory field is set to a correct default: `10.1.0.1`, operators upgrading from older versions must overwrite it. | `--wireguard-private-ip 10.1.0.1` |
|
||||
@@ -0,0 +1 @@
|
||||
0.64%
|
||||
@@ -0,0 +1 @@
|
||||
44.811
|
||||
@@ -0,0 +1,9 @@
|
||||
|
||||
import TimeNow from 'components/outputs/api-scraping-outputs/time-now.md';
|
||||
import { Callout } from 'nextra/components';
|
||||
|
||||
<Callout type="info" emoji="ℹ️">
|
||||
<strong>
|
||||
The data on this page were last time updated on <span style={{display: 'inline-block'}}><TimeNow /></span>.
|
||||
</strong>
|
||||
</Callout>
|
||||
@@ -0,0 +1,12 @@
|
||||
|
||||
import { Callout } from 'nextra/components';
|
||||
import TimeOutput from 'components/snippets-general/time-now.mdx';
|
||||
|
||||
export const TimeNow = () => {
|
||||
|
||||
return (
|
||||
<div>
|
||||
<TimeOutput />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -15,8 +15,8 @@
|
||||
*not a flag* ,`<PATH_TO>` ,"Specify a full path to the given file, directory or binary behind this variable ",`/root/src/nym/target/release/`
|
||||
`--announce-wss-port`,`<ANNOUNCE_WSS_PORT>`,"Port listening to Web Secure Socket, default and recommended `9001`",`9001`
|
||||
`--landing-page-assets-path`,`<LANDING_PAGE_ASSETS_PATH>`,A sub-directory located at `/var/www/<HOSTNAME>` containing html configuration files,`/var/www/exit-gateway1.squad.nsl`
|
||||
,`<BINARY> `,A name of a binary,`nym-node`
|
||||
,`<ARGUMENTS>`,Replace with all flags used to run the binary with a given command,`--id alice_super_node –accept-operator-terms-and-conditions`
|
||||
,`<WELCOME_TEXT>`,Any text you want to show on the landing page ,"Welcome to Nym Node, operator contact is example@email.me"
|
||||
,`<NYXD_VERSION>`,Version of validator binaries,`v0.43.0`
|
||||
,`<ID_KEY>`,"Node public identity key, exposed on the network",`GQvHcg61viyN9brWn1hficjD66Q9TorsLN2CMGJewVfo`
|
||||
*not a flag* ,`<BINARY> `,A name of a binary,`nym-node`
|
||||
*not a flag* ,`<ARGUMENTS>`,Replace with all flags used to run the binary with a given command,`--id alice_super_node –accept-operator-terms-and-conditions`
|
||||
*not a flag* ,`<WELCOME_TEXT>`,Any text you want to show on the landing page ,"Welcome to Nym Node, operator contact is example@email.me"
|
||||
*not a flag* ,`<NYXD_VERSION>`,Version of validator binaries,`v0.43.0`
|
||||
*not a flag* ,`<ID_KEY>`,"Node public identity key, exposed on the network",`GQvHcg61viyN9brWn1hficjD66Q9TorsLN2CMGJewVfo`
|
||||
|
||||
|
@@ -6,6 +6,8 @@
|
||||
"author": "Nym Technologies SA",
|
||||
"scripts": {
|
||||
"generate:commands": "../scripts/next-scripts/autodoc.sh",
|
||||
"prebuild": "../scripts/prebuild.sh",
|
||||
"predev": "../scripts/prebuild.sh",
|
||||
"build": "next build",
|
||||
"dev": " next dev",
|
||||
"lint": "next lint",
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
{
|
||||
"archive": "Why Archive?",
|
||||
"faq": "FAQ"
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,6 @@
|
||||
import { Callout } from 'nextra/components';
|
||||
import IspTable from 'components/outputs/csv2md-outputs/isp-sheet.md';
|
||||
|
||||
|
||||
# Where to host your `nym-node`?
|
||||
|
||||
@@ -16,6 +18,4 @@ While we trust that Nym node operators are honest, we would like to ask everyone
|
||||
To edit or add information to the ISP list, make changes to the csv file located [here](https://github.com/nymtech/nym/blob/develop/documentation/docs/data/csv/isp-sheet.csv) and submit your edits as a pull request according to [this guide](add-content.mdx).
|
||||
</Callout>
|
||||
|
||||
```
|
||||
<!-- cmdrun python3 ../../../scripts/csv2md.py ../data/isp-sheet.csv -s 0 -->
|
||||
```
|
||||
<IspTable />
|
||||
|
||||
@@ -10,4 +10,4 @@ The entire content of this page is under [Creative Commons Attribution 4.0 Inter
|
||||
|
||||
Exit Gateway landing page is a great and transparent way to prevent possible troubles by providing people with basic facts, links to laws and regulations on a given topic as well as operator's contact info. To inspire each other we share some examples how Nym community handled this issue below.
|
||||
|
||||
Initiated by an amazing pull request from Avril 14th we made a complete guide to setup landing page behind [reverse proxy and Web Secure Socket](../nodes/nym-node/proxy-configuration.mdx) for Nym Nodes.
|
||||
Initiated by an amazing pull request from Avril 14th we made a complete guide to setup landing page behind [reverse proxy and Web Secure Socket](../nodes/nym-node/configuration/proxy-configuration.mdx) for Nym Nodes.
|
||||
|
||||
@@ -28,10 +28,10 @@ If you want to dive deeper into Nym's architecture, clients, nodes, and SDK exam
|
||||
|
||||
**Node setup and usage guides:**
|
||||
|
||||
* [Nym Node](nodes/nym-node.mdx)
|
||||
* [Nymvisor](nodes/nymvisor-upgrade.mdx)
|
||||
* [Nym Node](nodes/nym-node/nym-node.mdx)
|
||||
* [Nymvisor](nodes/maintenance/nymvisor-upgrade.mdx)
|
||||
* [Validators](nodes/validator-setup.mdx)
|
||||
* [Nym API Setup](nodes/nym-api.mdx)
|
||||
* [Nym API Setup](nodes/validator-setup/nym-api.mdx)
|
||||
|
||||
**Maintenance, troubleshooting and FAQ**
|
||||
|
||||
@@ -44,3 +44,7 @@ If you want to dive deeper into Nym's architecture, clients, nodes, and SDK exam
|
||||
* [Exit Gateway](community-counsel/exit-gateway.mdx)
|
||||
* [Community Counsel](community-counsel.mdx)
|
||||
* [How to Add Info](community-counsel/add-content.mdx)
|
||||
|
||||
**Archive**
|
||||
|
||||
*[FAQ: Project Smoosh](archive/faq/smoosh-faq.mdx)
|
||||
|
||||
@@ -104,7 +104,7 @@ Anything can happen to the server on which your node is running. To back up your
|
||||
1. Node keys to initialise the same node on a new VPS
|
||||
2. Access to the bonding Nym account (wallet seeds) to edit the IP on smart contract
|
||||
|
||||
Assuming that everyone access their wallets from local machine and does *not* store their seeds on VPS, point 2. should be a given.
|
||||
Assuming that everyone access their wallets from local machine and does *not* store their seeds on VPS, point 2. should be a given.
|
||||
To backup your `nym-node` keys and configuration in the easiest way possible, copy the entire config directory `.nym` from your VPS to your local desktop, using a special copy command `scp`:
|
||||
|
||||
<Callout type="warning" emoji="⚠️">
|
||||
@@ -220,7 +220,7 @@ scp -r -3 <SOURCE_USER_NAME>@<SOURCE_HOST_ADDRESS>:/etc/systemd/system/nym-node.
|
||||
|
||||
Local node identifier, denoted as `<ID>` accross the documentation (not the identity key) is a name chosen by operators which defines where the nodes configuration data will be stored, where the ID determines the path to `~/.nym/nym-nodes/<ID>/`. This ID is never shared on the network.
|
||||
|
||||
When running a [`nym-node`](nym-nodes/nym-node.md), a local identifier specified with a flag `--ID <ID>` is no longer necessary. Nodes without a specified ID will be assigned a default ID `default-nym-node`. This streamlines node management, particularly for operators handling multiple nodes via ansible and other automation scripts, as all data is stored at `~/.nym/nym-nodes/default-nym-node`.
|
||||
When running a [`nym-node`](nym-node/nym-node.mdx), a local identifier specified with a flag `--ID <ID>` is no longer necessary. Nodes without a specified ID will be assigned a default ID `default-nym-node`. This streamlines node management, particularly for operators handling multiple nodes via ansible and other automation scripts, as all data is stored at `~/.nym/nym-nodes/default-nym-node`.
|
||||
|
||||
If you already operate a `nym-node` and wish to change the local ID to `default-nym-node` or anything else, follow the steps below to do so.
|
||||
|
||||
@@ -302,4 +302,3 @@ All validator-specific port configuration can be found in `$HOME/.nymd/config/co
|
||||
| 1317 | REST API server endpoint |
|
||||
| 26656 | Listen for incoming peer connections |
|
||||
| 26660 | Listen for Prometheus connections |
|
||||
|
||||
|
||||
@@ -2,6 +2,16 @@ import { Tabs } from 'nextra/components';
|
||||
import { Callout } from 'nextra/components';
|
||||
import { VarInfo } from 'components/variable-info.tsx';
|
||||
import { Steps } from 'nextra/components';
|
||||
import NymvisorBuildInfo from 'components/outputs/command-outputs/nymvisor-build-info.md';
|
||||
import NymvisorHelp from 'components/outputs/command-outputs/nymvisor-help.md';
|
||||
import NymvisorInitDaemon from 'components/outputs/command-outputs/nymvisor-init-daemon.md';
|
||||
import { AccordionTemplate } from 'components/accordion-template.tsx';
|
||||
|
||||
|
||||
export const NymvisorInitD = () => (
|
||||
<div>
|
||||
</div>
|
||||
);
|
||||
|
||||
# Automatic Node Upgrade: Nymvisor Setup & Usage
|
||||
|
||||
@@ -29,9 +39,8 @@ Nymvisor is an early and experimental software. Users should use it at their own
|
||||
</Callout>
|
||||
|
||||
## Current version
|
||||
```
|
||||
<!-- cmdrun ../../../../target/release/nymvisor --version | grep "Build Version" | cut -b 21-26 -->
|
||||
```
|
||||
|
||||
<NymvisorBuildInfo />
|
||||
|
||||
## Preliminary steps
|
||||
|
||||
@@ -53,9 +62,7 @@ You can check that your binaries are properly compiled with:
|
||||
|
||||
Which should return a list of all available commands.
|
||||
|
||||
```
|
||||
<!-- cmdrun ../../../../target/release/nymvisor --help -->
|
||||
```
|
||||
<NymvisorHelp />
|
||||
|
||||
You can also check the various arguments required for individual commands with:
|
||||
|
||||
@@ -75,10 +82,6 @@ Initialise your Nymvisor instance with the following command. You must initialis
|
||||
|
||||
Where the value of `--daemon-home` might be `~/.nym/nym-nodes/default-nym-node` and `<PATH>` might be `/home/sakine/nym/target/release/nym-node`, or wherever your node binary is located.
|
||||
|
||||
```
|
||||
<!-- cmdrun ../../../../target/release/nymvisor init --daemon-home ~/.nym/nym-nodes/default-nym-node ../../../../target/release/nym-node | tail -20 -->
|
||||
```
|
||||
|
||||
By default this will create config files at `~/.nym/nymvisors/instances/nym-node-default/config/config.toml` as shown in the console output above. For config options look at the different `--flags` available, or the [environment variables](#environment-variables) section below.
|
||||
|
||||
### Running your Nymvisor Instance
|
||||
@@ -89,14 +92,10 @@ The interface to the `nymvisor run <ARGS>` command is quite simple. Any argument
|
||||
|
||||
`run` Nymvisor and start your node via the following command. Make sure to stop any existing node before running this command.
|
||||
|
||||
```
|
||||
```sh
|
||||
./nymvisor run run --id <ID>
|
||||
```
|
||||
|
||||
```
|
||||
<!-- cmdrun ../../../../target/release/nymvisor run run --id default-nym-node -->
|
||||
```
|
||||
|
||||
Nymvisor will now manage your node process (for an in-depth overview of this command check the [in-depth command information](./nymvisor-upgrade.md#commands-in-depth) below). It will periodically poll [this endpoint](https://nymtech.net/.wellknown/nym-node/upgrade-info.json) (replace `nym-node` with whatever node you may actually be running via Nymvisor) and check for a new `version` of the binary it is watching. If this exists, it will then, using the information proceed with these steps:
|
||||
|
||||
<Steps>
|
||||
|
||||
+1
-2
@@ -10,7 +10,7 @@ import { Steps } from 'nextra/components';
|
||||
|
||||
## Nymvisor Automation with `systemd`
|
||||
|
||||
This section contains guide how to setup `systemd` automation for Nymvisor. If you are looking for other chapters, visit these pages: [VPS setup](../preliminrary-steps/vps-setup.mdx), advanced terminal tools like [tmux and nohup setup](../nym-node/configuration.mdx#vps-setup-and-automation), [`nym-node` automation](../nym-node/configuration.mdx#systemd) or [`validator` automation](../validator-setup/nyx-configuration#automation).
|
||||
This section contains guide how to setup `systemd` automation for Nymvisor. If you are looking for other chapters, visit these pages: [VPS setup](../../../preliminrary-steps/vps-setup.mdx), advanced terminal tools like [tmux and nohup setup](../../nym-node/configuration.mdx#vps-setup-and-automation), [`nym-node` automation](../../nym-node/configuration.mdx#systemd) or [`validator` automation](../../validator-setup/nyx-configuration#automation).
|
||||
|
||||
<Callout type="info" emoji="ℹ️">
|
||||
Since you're planning to run your node via a Nymvisor instance, as well as creating a Nymvisor `.service` file, you will also want to **stop any previous node automation process you already have running**.
|
||||
@@ -96,4 +96,3 @@ service nymvisor restart
|
||||
This lets your operating system know it's ok to reload the service configuration and restarts the node in a graceful way.
|
||||
|
||||
</Steps>
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import { VarInfo } from 'components/variable-info.tsx'
|
||||
|
||||
NYM NODE is a tool for running a node within the Nym network. Nym Nodes containing functionality such as `mixnode`, `entry-gateway` and `exit-gateway` are fundamental components of Nym Mixnet architecture. Nym Nodes are ran by decentralised node operators.
|
||||
|
||||
To setup any type of Nym Node, start with either building [Nym's platform](../binaries/building-nym.md) from source or download [pre-compiled binaries](../binaries/pre-built-binaries.md) on the [configured server (VPS)](vps-setup.md) where you want to run the node. Your Nym Node will need to be bonded before it can be run. We recommend most users use the [Nym desktop wallet](wallet-preparation.md) for this.
|
||||
To setup any type of Nym Node, start with either building [Nym's platform](../binaries/building-nym.mdx) from source or download [pre-compiled binaries](../binaries/pre-built-binaries.mdx) on the [configured server (VPS)](preliminary-steps/vps-setup.mdx) where you want to run the node. Your Nym Node will need to be bonded before it can be run. We recommend most users use the [Nym desktop wallet](preliminary-steps/wallet-preparation.mdx) for this.
|
||||
|
||||
**Follow [preliminary steps](preliminary-steps.mdx) page before you configure and run a `nym-node`!**
|
||||
|
||||
@@ -13,12 +13,12 @@ To setup any type of Nym Node, start with either building [Nym's platform](../bi
|
||||
|
||||
Once [VPS and Nym wallet are configured](preliminary-steps.mdx), binaries ready, the operators of `nym-node` need to:
|
||||
|
||||
1. **[Setup](nym-nde/setup.mdx) the node**
|
||||
1. **[Setup](nym-node/setup.mdx) the node**
|
||||
|
||||
2. **[Configure](nym-node/configuration.mdx) the node and optionally automation, Wireguard, WSS, reversed proxy ...**
|
||||
|
||||
3. **[Run](nym-node/setup.mdx#initialise--run) the node or [the service](nym-node/configuration.md#systemd)**
|
||||
|
||||
4. **[Bond](nym-node/bonding.md) the node to the Nym API, using Nym wallet**
|
||||
4. **[Bond](nym-node/bonding.mdx) the node to the Nym API, using Nym wallet**
|
||||
|
||||
Make sure to follow the steps thoroughly, in case you find any point difficult don't hesitate to ask in our [Operators channel](https://matrix.to/#/#operators:nymtech.chat).
|
||||
|
||||
@@ -1,7 +1,27 @@
|
||||
import { Callout } from 'nextra/components';
|
||||
import { Tabs } from 'nextra/components';
|
||||
import { VarInfo } from 'components/variable-info.tsx';
|
||||
import { Steps } from 'nextra/components'
|
||||
import { Steps } from 'nextra/components';
|
||||
import { AccordionTemplate } from 'components/accordion-template.tsx'
|
||||
|
||||
export const ManagerIPOutput = () => (
|
||||
<div>
|
||||
Correct <code>./network_tunnel_manager.sh fetch_and_display_ipv6</code> output
|
||||
</div>
|
||||
);
|
||||
|
||||
export const ManagerTablesOutput = () => (
|
||||
<div>
|
||||
Correct <code>./network_tunnel_manager.sh check_nymtun_iptables</code> output
|
||||
</div>
|
||||
);
|
||||
|
||||
export const ShowTun = () => (
|
||||
<div>
|
||||
Correct <code>ip addr show nymtun0</code> output
|
||||
</div>
|
||||
);
|
||||
|
||||
|
||||
|
||||
# Nym Node Configuration
|
||||
@@ -220,7 +240,8 @@ For everyone participating in Delegation Program or Service Grant program, this
|
||||
### Quick IPv6 Check
|
||||
|
||||
You can always check IPv6 address and connectivity by using some of these methods:
|
||||
|
||||
<br />
|
||||
<AccordionTemplate name="Testing IPv6 methods">
|
||||
```sh
|
||||
# locally listed IPv6 addresses
|
||||
ip -6 addr
|
||||
@@ -239,6 +260,7 @@ curl -6 https://ipv6.icanhazip.com
|
||||
# using telnet
|
||||
telnet -6 ipv6.telnetmyip.com
|
||||
```
|
||||
</AccordionTemplate>
|
||||
|
||||
<Callout type="warning" emoji="⚠️">
|
||||
Make sure to keep your IPv4 address enabled while setting up IPv6, as the majority of routing goes through that one!
|
||||
@@ -292,13 +314,14 @@ chmod +x network_tunnel_manager.sh && \
|
||||
```sh
|
||||
./network_tunnel_manager.sh fetch_and_display_ipv6
|
||||
```
|
||||
|
||||
<br />
|
||||
<AccordionTemplate name={<ManagerTablesOutput/>}>
|
||||
```sh
|
||||
# EXPECTED OUTPUT
|
||||
iptables-persistent is already installed.
|
||||
Using IPv6 address: 2001:db8:a160::1/112 #the address will be different for you
|
||||
operation fetch_ipv6_address_nym_tun completed successfully.
|
||||
```
|
||||
</AccordionTemplate>
|
||||
|
||||
###### 4. Check Nymtun IP tables:
|
||||
|
||||
@@ -309,8 +332,9 @@ operation fetch_ipv6_address_nym_tun completed successfully.
|
||||
- If there's no process running it wouldn't return anything.
|
||||
- In case you see `nymtun0` but not active, this is probably because you are setting up a new (never bonded) node and not upgrading an existing one.
|
||||
|
||||
<br />
|
||||
<AccordionTemplate name={<ManagerIPOutput/>}>
|
||||
```sh
|
||||
# EXPECTED OUTPUT
|
||||
iptables-persistent is already installed.
|
||||
network Device: eth0
|
||||
---------------------------------------
|
||||
@@ -337,6 +361,7 @@ Chain FORWARD (policy DROP 0 packets, 0 bytes)
|
||||
0 0 ACCEPT all nymtun0 eth0 ::/0 ::/0
|
||||
operation check_nymtun_iptables completed successfully.
|
||||
```
|
||||
</AccordionTemplate>
|
||||
|
||||
###### 5. Apply rules for wireguad routing
|
||||
|
||||
@@ -356,8 +381,9 @@ operation check_nymtun_iptables completed successfully.
|
||||
ip addr show nymtun0
|
||||
```
|
||||
|
||||
<br />
|
||||
<AccordionTemplate name={<ShowTun/>}>
|
||||
```sh
|
||||
# EXPECTED OUTPUT
|
||||
# your addresses will be different
|
||||
8: nymtun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1420 qdisc fq_codel state UNKNOWN group default qlen 500
|
||||
link/none
|
||||
@@ -368,6 +394,7 @@ ip addr show nymtun0
|
||||
inet6 fe80::ad08:d167:5700:8c7c/64 scope link stable-privacy
|
||||
valid_lft forever preferred_lft forever`
|
||||
```
|
||||
</AccordionTemplate>
|
||||
|
||||
- Validate your IPv6 and IPv4 networking by running a joke test via Mixnet:
|
||||
```sh
|
||||
|
||||
+13
-3
@@ -1,7 +1,14 @@
|
||||
import { Callout } from 'nextra/components';
|
||||
import { Tabs } from 'nextra/components';
|
||||
import { VarInfo } from 'components/variable-info.tsx';
|
||||
import { Steps } from 'nextra/components'
|
||||
import { Steps } from 'nextra/components';
|
||||
import { AccordionTemplate } from 'components/accordion-template.tsx';
|
||||
|
||||
export const IndexPage = () => (
|
||||
<>
|
||||
An example template for <code>index.html</code> page
|
||||
</>
|
||||
);
|
||||
|
||||
# Reverse Proxy & Web Secure Socket
|
||||
|
||||
@@ -60,6 +67,8 @@ mkdir -p /var/www/<HOSTNAME>
|
||||
|
||||
- Use your own html code (check this [markdown to html tool](https://markdowntohtml.com/)) or copy the template below to a new file called `index.html` located in `/var/www/<HOSTNAME>` directory.
|
||||
|
||||
|
||||
<AccordionTemplate name={<IndexPage/>}>
|
||||
```html
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
@@ -276,6 +285,7 @@ specified IP:port combination. Please be considerate when using these options.</
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
</AccordionTemplate>
|
||||
|
||||
###### 3. If you used the template above - before you save and close the file, make sure to edit the text, especially the information in these points:
|
||||
|
||||
@@ -394,7 +404,7 @@ nano /etc/nginx/sites-available/<HOSTNAME>
|
||||
```
|
||||
- Paste the text below to the editor and change `<HOSTNAME>` occurrences to your domain name:
|
||||
|
||||
```
|
||||
```ini
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
@@ -552,7 +562,7 @@ nano /etc/nginx/sites-available/wss-config-nym
|
||||
```
|
||||
- Paste the block below. Don't forget to insert your correct values.
|
||||
|
||||
```bash
|
||||
```ini
|
||||
#############################################################
|
||||
# EXCHANGE ALL <HOSTNAME> & <ANNOUNCE_WSS_PORT> VARIABLES ! #
|
||||
#############################################################
|
||||
|
||||
@@ -1,25 +1,20 @@
|
||||
{/*
|
||||
import { MyTab } from '../../../../components/operators/nodes/node-run-command-tabs'
|
||||
import Mixnode from './snippets/mixnode-run-tab-snippet.mdx';
|
||||
import EntryGateway from './snippets/entry-gateway-run-tab-snippet.mdx';
|
||||
import ExitGateway from './snippets/exit-gateway-run-tab-snippet.mdx';
|
||||
import Mixnode from './snippets/mixnode-run-tab-snippet.mdx';
|
||||
*/}
|
||||
import { Callout } from 'nextra/components';
|
||||
import { Tabs } from 'nextra/components';
|
||||
import { RunTabs } from 'components/operators/nodes/node-run-command-tabs';
|
||||
import { VarInfo } from 'components/variable-info.tsx';
|
||||
import { MigrateTabs } from 'components/operators/nodes/node-migrate-command-tabs'
|
||||
import { MigrateTabs } from 'components/operators/nodes/node-migrate-command-tabs';
|
||||
import BuildInfo from 'components/outputs/command-outputs/nym-node-build-info.md';
|
||||
import NymNodeHelp from 'components/outputs/command-outputs/nym-node-help.md';
|
||||
import NymNodeRunHelp from 'components/outputs/command-outputs/nym-node-run-help.md';
|
||||
import { AccordionTemplate } from 'components/accordion-template.tsx';
|
||||
|
||||
# Nym Node Setup & Run
|
||||
|
||||
This documentation page provides a guide on how to set up and run a [NYM NODE](nym-node.md), along with explanations of available flags, commands, and examples.
|
||||
This documentation page provides a guide on how to set up and run a [NYM NODE](../nym-node.mdx), along with explanations of available flags, commands, and examples.
|
||||
|
||||
## Current version
|
||||
|
||||
```
|
||||
<!-- cmdrun ../../../../target/release/nym-node --version -->
|
||||
```
|
||||
<BuildInfo />
|
||||
|
||||
## Summary
|
||||
|
||||
@@ -73,15 +68,13 @@ You can always use `--help` flag to see the commands or arguments associated wit
|
||||
|
||||
Run `./nym-node --help` to see all available commands:
|
||||
|
||||
```
|
||||
<!-- cmdrun ../../../../target/release/nym-node --help -->
|
||||
```
|
||||
<NymNodeHelp />
|
||||
|
||||
To list all available flags for each command, run `./nym-node <COMMAND> --help` for example `./nym-node run --help`:
|
||||
|
||||
```
|
||||
<!-- cmdrun ../../../../target/release/nym-node run --help -->
|
||||
```
|
||||
<AccordionTemplate name="Command output">
|
||||
<NymNodeRunHelp />
|
||||
</AccordionTemplate>
|
||||
|
||||
<Callout type="warning" emoji="⚠️">
|
||||
The Wireguard flags currently have limited functionality. From version `1.1.6` ([`v2024.9-topdeck`](https://github.com/nymtech/nym/releases/tag/nym-binaries-v2024.9-topdeck)) wireguard is available and recommended to be switched on for nodes running as Gateways. Keep in mind that this option needs a bit of a special [configuration](configuration.md#wireguard-setup).
|
||||
@@ -159,7 +152,7 @@ In such case, you can `run` a node to initalise it or try if everything works, b
|
||||
### Migrate
|
||||
|
||||
<Callout type="warning">
|
||||
Migration is a must for all deprecated nodes (`nym-mixnode`, `nym-gateway`). For backward compatibility we created an [archive section](../archive/nodes/setup-guides.md) with all the guides for individual binaries. However, the binaries from version 1.1.35 (`nym-gateway`) and 1.1.37 (`nym-mixnode`) onwards will no longer have `init` command.
|
||||
Migration is a must for all deprecated nodes (`nym-mixnode`, `nym-gateway`). These binaries from version 1.1.35 (`nym-gateway`) and 1.1.37 (`nym-mixnode`) onwards will no longer have `init` command and `nym-node` is the only binary to use for `gateway` or `mixnode` fucntionalities.
|
||||
|
||||
**Nym cannot promise 100% serialisation for operators migrating from long outdated versions to the newest ones. If you are about to migrate, start with [`nym-node v1.1.0`](https://github.com/nymtech/nym/releases/tag/nym-binaries-v2024.3-eclipse) and keep upgrading version by version all the way to the latest one.**
|
||||
</Callout>
|
||||
@@ -176,4 +169,4 @@ Make sure to use `--deny-init` flag to prevent initialisation of a new node.
|
||||
|
||||
If there are any problems checkout the troubleshooting section or report an issue.
|
||||
|
||||
Follow up with [configuration](configuration.md) page for automation, reversed proxy setup and other tweaks, then head straight to [bonding](bonding.md) page to finalise your setup.
|
||||
Follow up with [configuration](configuration.mdx) page for automation, reversed proxy setup and other tweaks, then head straight to [bonding](bonding.mdx) page to finalise your setup.
|
||||
|
||||
@@ -16,8 +16,8 @@ There are multiple ways to monitor performance of nodes and the machines on whic
|
||||
|
||||
A list of different scripts, templates and guides for easier navigation:
|
||||
|
||||
* [`nym-gateway-probe`](gateway-probe.md) - a useful tool used under the hood of [harbourmaster.nymtech.net](https://harbourmaster.nymtech.net)
|
||||
* [Prometheus and Grafana](prometheus-grafana.md) self-hosted setup
|
||||
* [`nym-gateway-probe`](perfomance-and-testing/gateway-probe.mdx) - a useful tool used under the hood of [harbourmaster.nymtech.net](https://harbourmaster.nymtech.net)
|
||||
* [Prometheus and Grafana](performance-and-testing/prometheus-grafana.mdx) self-hosted setup
|
||||
* [Nym-node CPU cron service](https://gist.github.com/tommyv1987/97e939a7adf491333d686a8eaa68d4bd) - an easy bash script by Nym core developer [@tommy1987](https://gist.github.com/tommyv1987), designed to monitor a CPU usage of your node, running locally
|
||||
* Nym's script [`prom_targets.py`](https://github.com/nymtech/nym/blob/develop/scripts/prom_targets.py) - a useful python program to request data from API and can be run on its own or plugged to more sophisticated flows
|
||||
|
||||
@@ -45,4 +45,3 @@ We do testing in order to **understand and increase the overall quality of the N
|
||||
7. Adjust rewarding based on the machine specs and server pricing
|
||||
|
||||
Visit [Nym Harbour Master](https://harbourmaster.nymtech.net/) monitoring page to monitor network components (nodes) performance.
|
||||
|
||||
|
||||
+10
-8
@@ -3,6 +3,8 @@ import { Callout } from 'nextra/components';
|
||||
import { VarInfo } from 'components/variable-info.tsx';
|
||||
import { Steps } from 'nextra/components';
|
||||
import { MyTab } from 'components/generic-tabs.tsx';
|
||||
import NodeApiCheckHelp from 'components/outputs/command-outputs/node-api-check-help.md';
|
||||
import NodeApiCheckQueryHelp from 'components/outputs/command-outputs/node-api-check-query-help.md'
|
||||
|
||||
# Node API Check
|
||||
|
||||
@@ -120,21 +122,21 @@ Now you are ready to check your node.
|
||||
./node_api_check.py --help
|
||||
```
|
||||
|
||||
- Output:
|
||||
```python
|
||||
<!--cmdrun cd ../../../../scripts && python ./node_api_check.py --help-->
|
||||
```
|
||||
- Command Output:
|
||||
|
||||
<NodeApiCheckHelp />
|
||||
|
||||
#### `query_stats`
|
||||
|
||||
When you want to see all the options connected to any command, add a `--help` flag after the command of your choice, like in this example:
|
||||
When you want to see all the options connected to any command, add a `--help` flag after the command of your choice. Command `query_stats` is the most useful one of this program.
|
||||
|
||||
```sh
|
||||
./node_api_check query_stats --help
|
||||
```
|
||||
|
||||
```python
|
||||
<!--cmdrun cd ../../../../scripts && python ./node_api_check.py query_stats --help-->
|
||||
```
|
||||
- Command output:
|
||||
|
||||
<NodeApiCheckQueryHelp/ >
|
||||
|
||||
The most common usage may be `./node_api_check.py query_stats <ID_KEY>` where `<ID_KEY>` is required, substitute it with node Identity Key.
|
||||
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
|
||||
There are a couple of steps that need completing before starting to set up your `nym-node`:
|
||||
|
||||
1. **[Prepare your wallet](preliminary-steps/wallet-preparation.md):** [desktop](https://nymtech.net/docs/wallet/desktop-wallet.html) or [CLI](https://nymtech.net/docs/wallet/cli-wallet.html).
|
||||
2. **[Requisition and setup a VPS](preliminary-steps/vps-setup.md)** (Virtual Private Server)
|
||||
1. **[Prepare your wallet](preliminary-steps/wallet-preparation.mdx):** [desktop](https://nymtech.net/docs/wallet/desktop-wallet.html) or [CLI](../../developers/tools/nym-cli/commands.mdx).
|
||||
2. **[Requisition and setup a VPS](preliminary-steps/vps-setup.mdx)** (Virtual Private Server)
|
||||
|
||||
Make sure to follow these steps carefully as it prevents a lot of troubleshooting later on.
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import { Callout } from 'nextra/components';
|
||||
import { Tabs } from 'nextra/components';
|
||||
import { VarInfo } from 'components/variable-info.tsx';
|
||||
import { Steps } from 'nextra/components';
|
||||
import {Accordion, AccordionItem} from "@nextui-org/react";
|
||||
import { AccordionTemplate } from 'components/accordion-template.tsx';
|
||||
|
||||
# Validators
|
||||
|
||||
@@ -100,7 +100,8 @@ At this point, you will have a copy of the `nyxd` binary in your `build/` direct
|
||||
```
|
||||
|
||||
You should see a similar help menu printed to you:
|
||||
|
||||
<br />
|
||||
<AccordionTemplate name="Console output">
|
||||
```sh
|
||||
Nyx Daemon (server)
|
||||
|
||||
@@ -136,6 +137,7 @@ Flags:
|
||||
|
||||
Use "nyxd [command] --help" for more information about a command.
|
||||
```
|
||||
</AccordionTemplate>
|
||||
|
||||
### Linking `nyxd` to `libwasmvm.so`
|
||||
|
||||
@@ -169,6 +171,8 @@ nyxd
|
||||
|
||||
- This should return the regular help menu:
|
||||
|
||||
<br />
|
||||
<AccordionTemplate name="Console output">
|
||||
```sh
|
||||
Nyx Daemon (server)
|
||||
|
||||
@@ -204,6 +208,7 @@ Flags:
|
||||
|
||||
Use "nyxd [command] --help" for more information about a command.
|
||||
```
|
||||
</AccordionTemplate>
|
||||
|
||||
## Initialising your validator
|
||||
|
||||
|
||||
@@ -3,6 +3,9 @@ import { Tabs } from 'nextra/components';
|
||||
import { VarInfo } from 'components/variable-info.tsx';
|
||||
import { Steps } from 'nextra/components';
|
||||
import {Accordion, AccordionItem} from "@nextui-org/react";
|
||||
import ApiBuildInfo from 'components/outputs/command-outputs/nym-api-build-info.md';
|
||||
import NymApiHelp from 'components/outputs/command-outputs/nym-api-help.md';
|
||||
import { AccordionTemplate } from 'components/accordion-template.tsx';
|
||||
|
||||
# Nym API Setup
|
||||
|
||||
@@ -103,9 +106,8 @@ DKG ceremony in points:
|
||||
* From the perspective of validator operators, this is all they had to do. Under the hood, each `nym-api` instance then took part in several rounds of key submission, verification, and derivation. This will continue until quorum is acheived.
|
||||
|
||||
## Current version
|
||||
```
|
||||
<!-- cmdrun ../../../../target/release/nym-api --version | grep "Build Version" | cut -b 21-26 -->
|
||||
```
|
||||
|
||||
<ApiBuildInfo />
|
||||
|
||||
## Setup and Usage
|
||||
|
||||
@@ -118,10 +120,7 @@ You can check that your binary is properly compiled with:
|
||||
|
||||
Which should return a list of all available commands.
|
||||
|
||||
|
||||
```
|
||||
<!-- cmdrun ../../../../target/release/nym-api --help -->
|
||||
```
|
||||
<NymApiHelp />
|
||||
|
||||
You can also check the various arguments required for individual commands with:
|
||||
|
||||
@@ -211,6 +210,8 @@ You can also change the value of `local_validator` in the config file found by d
|
||||
|
||||
This process is quite noisy, but informative:
|
||||
|
||||
<br />
|
||||
<AccordionTemplate name="Console output">
|
||||
```bash
|
||||
Starting nym api...
|
||||
2023-12-12T14:29:55.800Z INFO rocket::launch > 🔧 Configured for release.
|
||||
@@ -288,6 +289,7 @@ Starting nym api...
|
||||
2023-12-12T14:31:56.290Z INFO nym_api::nym_contract_cache::cache::refresher > Updating validator cache. There are 888 mixnodes and 105 gateways
|
||||
2023-12-12T14:31:56.291Z INFO nym_api::node_status_api::cache::refresher > Updating node status cache
|
||||
```
|
||||
</AccordionTemplate>
|
||||
|
||||
## Automation
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ Nym node operators can run their nodes in Nym Sandbox testnet environment. Wheth
|
||||
Below are steps to [setup your environment](#sandbox-environment-setup) and an introduction to [Sandbox token faucet](#sandbox-token-faucet).
|
||||
|
||||
<Callout type="info" emoji="ℹ️">
|
||||
This page is for Nym node operators. If you want to run NymVPN CLI over Sandbox testnet, visit [Nym Developers portal](https://nymtech.net/docs/developers/nymvpn/cli.html#testnet-environment).
|
||||
This page is for Nym node operators. If you want to run NymVPN CLI over Sandbox testnet, visit [NymVPN CLI Testnet guide](https://nym-vpn-cli.sandbox.nymtech.net/).
|
||||
</Callout>
|
||||
|
||||
## Sandbox Environment Setup
|
||||
@@ -49,7 +49,7 @@ curl -o sandbox.env -L https://raw.githubusercontent.com/nymtech/nym/develop/env
|
||||
###### 3. Bond your node to Nym Sandbox environment
|
||||
- Open [Nym Wallet](https://nymtech.net/download/wallet) and switch to testnet
|
||||
- Go to [faucet.nymtech.net](https://faucet.nymtech.net) and aquire 101 testnet NYM tokens
|
||||
- Follow the steps on the [bonding page](nodes/bonding.mdx)
|
||||
- Follow the steps on the [bonding page](nodes/nym-node/bonding.mdx)
|
||||
|
||||

|
||||
|
||||
|
||||
+15
-3
@@ -1,10 +1,22 @@
|
||||
|
||||
import { Callout } from 'nextra/components';
|
||||
import { Tabs } from 'nextra/components';
|
||||
import { RunTabs } from 'components/operators/nodes/node-run-command-tabs';
|
||||
import { VarInfo } from 'components/variable-info.tsx';
|
||||
import { MigrateTabs } from 'components/operators/nodes/node-migrate-command-tabs';
|
||||
import NyxPercentStake from 'components/outputs/nyx-outputs/nyx-percent-stake.md';
|
||||
import NyxTotalStake from 'components/outputs/nyx-outputs/nyx-total-stake.md';
|
||||
import { TimeNow } from 'components/time-now.tsx';
|
||||
|
||||
# Nyx Validator Rewards
|
||||
|
||||
<TimeNow />
|
||||
|
||||
## Summary
|
||||
|
||||
* Nyx Validators are rewarded in NYM tokens from the Nym mixmining pool and increasingly from apps that run on the Nym mixnet, the first of which is the NymVPN.
|
||||
* Validators are rewarded for two different types of work: signing blocks in the Nyx chain and running the NymAPI to monitor mixnet routing and sign zk-nym credentials.
|
||||
* New validators can join via a NYM-to-NYX swap contract. The contract will not allow more than 1% of total stake increase per month to prevent sudden hostile takeovers. Current stake is <!-- cmdrun ../scripts/nyx-total-stake.sh --> million Nyx. Rate: 1:4.8 ~ 288k NYX for 60k NYM => <!-- cmdrun ../scripts/nyx-percent-stake.sh --> voting power
|
||||
* New validators can join via a NYM-to-NYX swap contract after contacting us and getting whitelisted. The contract will not allow more than 1% of total stake increase per month to prevent sudden hostile takeovers. Current stake is <span style={{display: 'inline-block'}}><NyxTotalStake /></span> million Nyx. Rate: 1:4.8 ~ 288k NYX for 60k NYM \=\> <span style={{display: 'inline-block'}}><NyxPercentStake /></span> voting power
|
||||
* NYX tokens serve no other purpose than self-delegation for voting power and governance. All rewards are in NYM and distributed directly to the validators self-delegation address and are not distributed to stakers.
|
||||
* The contract will only allow swapping NYM to NYX and will **not** allow exchanging NYX back to NYM. A NYX holder who wishes to sell their NYX stake will have to do so via OTC trades.
|
||||
|
||||
@@ -22,7 +34,7 @@ Validator rewards initially come from the Nym mixmining pool with additional rew
|
||||
|
||||
1. **From mixmining pool** - at a rate of 1000 NYM per hour, of which 2/3 are distributed for signing blocks and 1/3 for zk-nyms. These are stable in NYM, and therefore will fluctuate in their fiat value depending on exchange rate.
|
||||
|
||||
2. **From vpn user subscriptions** - the rate is tied to the growth of NymVPN subscriptions and will be stable in fiat, fluctuating in NYM depending on exchange rate. 1/3 will be distributed for signing blocks and 2/3 for zk-nyms.
|
||||
2. **From vpn user subscriptions** - the rate is tied to the growth of NymVPN subscriptions and will be stable in fiat, fluctuating in NYM depending on exchange rate. 1/3 will be distributed for signing blocks and 2/3 for zk-nyms.
|
||||
|
||||
| Source | Signing blocks | Running NymAPI | Currency |
|
||||
| :-- | --: | --: | :---: |
|
||||
@@ -52,4 +64,4 @@ The smart contract will have two parameters:
|
||||
|
||||
### Maximum Amount of NYX Available for Purchase per Month
|
||||
|
||||
The contract will not allow more than 1% of total stake increase per month to prevent sudden hostile takeovers. Current stake level is <!-- cmdrun ../scripts/nyx-total-stake.sh --> million Nyx.
|
||||
The contract will not allow more than 1% of total stake increase per month to prevent sudden hostile takeovers. Current stake level is <span style={{display: 'inline-block'}}><NyxTotalStake /></span> million Nyx.
|
||||
@@ -32,7 +32,7 @@ We have scripts which automatically include the Git commit hash and Git tag in t
|
||||
What to do?
|
||||
|
||||
* Follow the instructions in the Binaries section to [build nym from source](../binaries/building-nym.mdx) or [download precompiled binaries](../binaries/pre-build-binaries.mdx)
|
||||
* To upgrade, follow the [upgrade instructions](../nodes/maintenance/manual-upgrade/mdx)
|
||||
* To upgrade, follow the [upgrade instructions](../nodes/maintenance/manual-upgrade.mdx)
|
||||
|
||||
## General Node Config
|
||||
|
||||
@@ -104,9 +104,9 @@ First of all check the 'Mixnodes' section of either of the Nym Network Explorers
|
||||
* [Mainnet](https://explorer.nymtech.net/)
|
||||
* [Sandbox testnet](https://sandbox-explorer.nymtech.net/)
|
||||
|
||||
You can also check [Nym Harbourmaster](https://harbourmaster.nymtech.net) which now also includes mixnode mode.
|
||||
You can also check [Nym Harbourmaster](https://harbourmaster.nymtech.net) which now also includes mixnode mode.
|
||||
|
||||
There are a few community explorers as well.
|
||||
There are a few community explorers as well.
|
||||
|
||||
* [ExploreNYM](https://explorenym.net/)
|
||||
* [Mixplorer](https://mixplorer.xyz/)
|
||||
@@ -319,7 +319,7 @@ Let your Gateway run and follow these steps:
|
||||
|
||||
<Steps>
|
||||
|
||||
###### 1. Check if your [firewall configuration](../nodes/preliminary-steps/vps-setup.mdx#configure-your-firewall)
|
||||
###### 1. Check if your [firewall configuration](../nodes/preliminary-steps/vps-setup.mdx#configure-your-firewall)
|
||||
|
||||
- If `ufw` is active and if the necessary ports are open / allowed, including the ones for Swagger page and Reversed proxy/WSS if this is your case.
|
||||
|
||||
@@ -365,7 +365,7 @@ If your logs show that your Node has `cover down: 0.00` that means that the embe
|
||||
|
||||
###### 6. [Check out if your `syslog`s](vps-isp.mdx#pruning-logs) aren't eating all your disk space and prune them
|
||||
|
||||
###### 7. When all problems are addressed: Restart the node service
|
||||
###### 7. When all problems are addressed: Restart the node service
|
||||
|
||||
Don't forget `systemctl daemon-reload`) and wait until your node gets above 50% of performance (average of last 24h) - this will likely take 24-48 hours. During this time your node is tested by `nym-api` and every positive response picks up your routing score.
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
{/*
|
||||
TODO - MAKE PLUGIN WHICH CAN RUN PYTHON SCRIPT TO PRINT CSV LOCATED IN ../../data/csv/variables.csv
|
||||
*/}
|
||||
import { Callout } from 'nextra/components'
|
||||
import VariablesTable from 'components/outputs/csv2md-outputs/variables.md';
|
||||
|
||||
# Essential Parameters & Variables
|
||||
|
||||
@@ -14,6 +12,6 @@ Below is a table listing the most essential variables and parameters which they
|
||||
To prevent over-flooding of our documentation we cannot provide with every single command syntax as there is a large combination of possibilities. Remember that you can always print the options using a `--help` flag together with any binary command.
|
||||
</Callout>
|
||||
|
||||
|
||||
<VariablesTable />
|
||||
|
||||
|
||||
|
||||
@@ -137,3 +137,8 @@ input:focus-visible {
|
||||
a.MuiLink-root {
|
||||
color: var(--colorPrimary) !important;
|
||||
}
|
||||
|
||||
|
||||
.MuiPaper-root.MuiAccordion-root {
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,337 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
import argparse
|
||||
import os
|
||||
import requests
|
||||
import json
|
||||
import sys
|
||||
import pandas as pd
|
||||
from collections import namedtuple
|
||||
from time import gmtime, strftime
|
||||
import time
|
||||
|
||||
############################################
|
||||
############## GENERAL FNs #################
|
||||
############################################
|
||||
|
||||
def get_url(args, **kwargs):
|
||||
config_file = "./api_targets_config.json"
|
||||
with open(config_file, "r") as f:
|
||||
config = json.load(f)
|
||||
env = args.api
|
||||
endpoint = args.endpoint
|
||||
if env == "github":
|
||||
url = f"{config[env]}/{endpoint}"
|
||||
else:
|
||||
url = f"{config[env]}/api/v1/{endpoint}"
|
||||
return url
|
||||
|
||||
def subparser_read(args):
|
||||
url = get_url(args)
|
||||
r = requests.get(url)
|
||||
response = r.json()
|
||||
return response
|
||||
|
||||
|
||||
def print_time_now(args):
|
||||
#now = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
|
||||
#now = time.ctime()
|
||||
day = strftime("%d", gmtime())
|
||||
if day[0] == "0":
|
||||
day = day[1]
|
||||
if day == "1" or day == "21" or day == "31":
|
||||
suffix = "st"
|
||||
elif day == "2" or day == "22":
|
||||
suffix = "nd"
|
||||
elif day == "3" or day == "23":
|
||||
suffix = "rd"
|
||||
else:
|
||||
suffix = "th"
|
||||
now = strftime(f"%A, %B {day}{suffix} %Y, %X UTC", gmtime())
|
||||
print(now)
|
||||
|
||||
############################################
|
||||
########### NYX RELATED FNs ################
|
||||
############################################
|
||||
|
||||
def convert_u_nym(unym):
|
||||
unym = float(unym)
|
||||
nym = unym / 1000000
|
||||
nym = int(nym)
|
||||
return nym
|
||||
|
||||
def thousand_separator(n, separator):
|
||||
if separator == " ":
|
||||
n = f'{n:_}'
|
||||
n = remove_underscore(n)
|
||||
else:
|
||||
n = f'{n:{separator}}'
|
||||
return n
|
||||
|
||||
def remove_underscore(arg):
|
||||
string = arg.replace("_", " ")
|
||||
string = string.title()
|
||||
return string
|
||||
|
||||
def display_supply_table(response, args):
|
||||
separator = args.separator
|
||||
df = pd.DataFrame(response)
|
||||
df = df.T
|
||||
del df['denom']
|
||||
# df.set_axis(['**Item**', '**Amount in NYM**'], axis=1, inplace=True)
|
||||
df = df.rename_axis('index1').reset_index()
|
||||
df = df.rename(columns={'index1': '**Item**', 'amount': '**Amount in NYM**'})
|
||||
df['**Item**'] = df['**Item**'].apply(remove_underscore)
|
||||
df['**Amount in NYM**'] = df['**Amount in NYM**'].apply(convert_u_nym)
|
||||
desc_column = _get_desc_column()
|
||||
df.insert(1, '**Description**', desc_column, True)
|
||||
stake_saturation = _get_stake_saturation()
|
||||
df.loc[len(df.index)] = ['Stake Saturation', 'Optimal size of node self-bond + delegation', stake_saturation]
|
||||
df['**Amount in NYM**'] = df['**Amount in NYM**'].apply(thousand_separator, args=(separator, ))
|
||||
table = df.to_markdown(index=False,colalign=("left","left","right"))
|
||||
print(table)
|
||||
|
||||
def _get_stake_saturation():
|
||||
reward_params = get_api("https://validator.nymtech.net/api/v1/epoch/reward_params")
|
||||
stake_saturation = get_dict_value(reward_params,["interval","stake_saturation_point"])
|
||||
stake_saturation = convert_u_nym(stake_saturation)
|
||||
return stake_saturation
|
||||
|
||||
def _get_desc_column():
|
||||
supply = "Maximum amount of NYM token in existence"
|
||||
reserve = "Tokens releasing for operators rewards"
|
||||
vesting = "Tokens locked outside of cicrulation for future claim"
|
||||
circulating = "Amount of unlocked tokens"
|
||||
desc_column = [supply, reserve, vesting, circulating]
|
||||
return desc_column
|
||||
|
||||
def read_supply(args):
|
||||
separator = args.separator
|
||||
response = subparser_read(args)
|
||||
if args.endpoint == "circulating-supply":
|
||||
if args.value:
|
||||
value = get_nested_value(response, args)
|
||||
value = convert_u_nym(value)
|
||||
value = thousand_separator(value, separator)
|
||||
print(value)
|
||||
elif args.format == "markdown":
|
||||
display_supply_table(response, args)
|
||||
else:
|
||||
value = response
|
||||
print(value)
|
||||
elif args.endpoint == "epoch/reward_params":
|
||||
value = get_reward_params(response, args, separator)
|
||||
print(value)
|
||||
|
||||
def get_reward_params(response, args, separator):
|
||||
value = get_nested_value(response, args)
|
||||
if args.format == "percent":
|
||||
value = _return_percent_annotation(value)
|
||||
else:
|
||||
value = convert_u_nym(value)
|
||||
value = thousand_separator(value, separator)
|
||||
return value
|
||||
|
||||
def get_nested_value(response, args):
|
||||
value = response
|
||||
for key in args.value:
|
||||
value = value[key]
|
||||
return value
|
||||
|
||||
def _return_percent_annotation(value):
|
||||
value = float(value) * 100
|
||||
value = f"{value}%"
|
||||
return value
|
||||
|
||||
###########################################
|
||||
############# CALCULATE FNs ###############
|
||||
###########################################
|
||||
|
||||
def calculate(args):
|
||||
separator = args.separator
|
||||
reward_params = get_api("https://validator.nymtech.net/api/v1/epoch/reward_params")
|
||||
circulating_supply = get_api("https://validator.nymtech.net/api/v1/circulating-supply")
|
||||
if args.staking_target:
|
||||
display_staking_target(args, reward_params, circulating_supply, separator)
|
||||
|
||||
def get_api(url):
|
||||
r = requests.get(url)
|
||||
response = r.json()
|
||||
return response
|
||||
|
||||
|
||||
def display_staking_target(args, reward_params, circulating_supply, separator):
|
||||
keys = ["interval", "staking_supply_scale_factor"]
|
||||
staking_supply_scale_factor = get_dict_value(reward_params, keys)
|
||||
keys = ["circulating_supply", "amount"]
|
||||
circulating_supply = get_dict_value(circulating_supply, keys)
|
||||
staking_target = float(staking_supply_scale_factor) * float(circulating_supply)
|
||||
staking_target = convert_u_nym(staking_target)
|
||||
if args.separator:
|
||||
staking_target = thousand_separator(staking_target, separator)
|
||||
print(staking_target)
|
||||
|
||||
def get_dict_value(json, keys):
|
||||
value = json
|
||||
for key in keys:
|
||||
value = value[key]
|
||||
return value
|
||||
|
||||
|
||||
###########################################
|
||||
############ GH RELATED FNs ###############
|
||||
###########################################
|
||||
|
||||
def get_nym_vpn_version(args):
|
||||
response = subparser_read(args)
|
||||
if args.client == "desktop":
|
||||
version = current_desktop_version(args, response)
|
||||
elif args.client == "cli":
|
||||
version = current_cli_version(args, response)
|
||||
else:
|
||||
print("Incorrect argument for -c, --client")
|
||||
sys.exit(-1)
|
||||
|
||||
def current_cli_version(args, response):
|
||||
df = pd.DataFrame(response)
|
||||
print(df)
|
||||
|
||||
# NEEDS THIS IN PYTHON:
|
||||
# current_cli_version=$(curl -s $release_url | jq -r '.[].tag_name' | grep '^nym-vpn-cli-v' | sort -Vr | head -n 1 | awk -F'-v' '{print $NF}')
|
||||
|
||||
|
||||
def current_desktop_version(args, response):
|
||||
# NEEDS THIS IN PYTHON:
|
||||
df = pd.DataFrame(response)
|
||||
print(df)
|
||||
# version=$(curl -s $release_url | jq -r '.[].tag_name' | grep '^nym-vpn-desktop-v' | sort -Vr | head -n 1 | awk -F'-v' '{print $NF}')
|
||||
|
||||
|
||||
###########################################
|
||||
############### MAIN PARSER ###############
|
||||
###########################################
|
||||
|
||||
def parser_main():
|
||||
parser = argparse.ArgumentParser(
|
||||
prog="Nym API scraper",
|
||||
description='''Get any live data from Nyx validator''',
|
||||
epilog=''
|
||||
)
|
||||
subparsers = parser.add_subparsers(help="")
|
||||
parser_supply = subparsers.add_parser('validator',
|
||||
help='Reads validaor API enpoints',
|
||||
aliases=['v']
|
||||
)
|
||||
|
||||
parser_supply.add_argument(
|
||||
"-a","--api",
|
||||
type=str,
|
||||
default="mainnet",
|
||||
help="choose: mainnet, perf, sandbox"
|
||||
)
|
||||
parser_supply.add_argument(
|
||||
"-e","--endpoint",
|
||||
type=str,
|
||||
help="choose from: https://validator.nymtech.net/api/swagger/index.html"
|
||||
)
|
||||
parser_supply.add_argument(
|
||||
"-v","--value",
|
||||
type=str,
|
||||
help="dictionary keys to get needed value separated by a space",
|
||||
nargs = '+'
|
||||
)
|
||||
|
||||
parser_supply.add_argument(
|
||||
"-f","--format",
|
||||
type=str,
|
||||
help="'markdown' formats the output for documentation purpose; 'percent' returns a number with % annotation",
|
||||
)
|
||||
|
||||
parser_supply.add_argument(
|
||||
"-s", "--separator",
|
||||
type=str,
|
||||
default=" ",
|
||||
help="Add custom thousand separator to --format flag (default is none)"
|
||||
)
|
||||
|
||||
parser_supply.set_defaults(func=read_supply)
|
||||
|
||||
|
||||
|
||||
|
||||
parser_calculate = subparsers.add_parser('calculate',
|
||||
help='Calculate and print the values of optional args',
|
||||
aliases=['c']
|
||||
)
|
||||
|
||||
parser_calculate.add_argument(
|
||||
"--staking_target",
|
||||
action="store_true",
|
||||
help="A multiplier of staking supply scale factor and circulating supply"
|
||||
)
|
||||
|
||||
parser_calculate.add_argument(
|
||||
"-s", "--separator",
|
||||
type=str,
|
||||
default=" ",
|
||||
help="Add custom thousand separator to --format flag (default is none)"
|
||||
)
|
||||
# parser_calculate.add_argument(
|
||||
# "--api",
|
||||
# default="mainnet",
|
||||
# )
|
||||
|
||||
parser_calculate.set_defaults(func=calculate)
|
||||
|
||||
parser_time_now = subparsers.add_parser('time_now',
|
||||
help='Prints UTC time now',
|
||||
aliases=['time', 't']
|
||||
)
|
||||
|
||||
parser_time_now.set_defaults(func=print_time_now)
|
||||
|
||||
|
||||
parser_nym_vpn = subparsers.add_parser('nym_vpn',
|
||||
help='reads NymVPN latest version',
|
||||
aliases=['n']
|
||||
)
|
||||
|
||||
parser_nym_vpn.add_argument(
|
||||
"-c","--client",
|
||||
type=str,
|
||||
default="desktop",
|
||||
help="choose: desktop, cli - default: desktop"
|
||||
)
|
||||
|
||||
parser_nym_vpn.add_argument(
|
||||
"-a","--api",
|
||||
type=str,
|
||||
default="github",
|
||||
help="choose: mainnet, perf, sandbox"
|
||||
)
|
||||
|
||||
parser_nym_vpn.add_argument(
|
||||
"-e","--endpoint",
|
||||
type=str,
|
||||
help="add the url suffix",
|
||||
default="repos/nymtech/nym-vpn-client/releases"
|
||||
)
|
||||
|
||||
|
||||
parser_nym_vpn.set_defaults(func=get_nym_vpn_version)
|
||||
|
||||
|
||||
|
||||
|
||||
args = parser.parse_args()
|
||||
try:
|
||||
args.func(args)
|
||||
except AttributeError as e:
|
||||
print("Error on argparser")
|
||||
sys.exit(-1)
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser_main()
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"sandbox": "https://sandbox-nym-api1.nymtech.net",
|
||||
"perf": "https://api.performance.nymte.ch",
|
||||
"mainnet": "https://validator.nymtech.net",
|
||||
"github": "https://api.github.com"
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
stake_unyx=$(curl -s -L https://api.nymtech.net/cosmos/staking/v1beta1/pool | jq 'values["pool"]["bonded_tokens"]')
|
||||
stake_unyx=$(python -c "print(int($stake_unyx))")
|
||||
stake_nyx=$(python -c "print($stake_unyx / 1000000)")
|
||||
voting288k_percent=$(python -c "print(288000 / $stake_nyx * 100)")
|
||||
echo ${voting288k_percent:0:4}%
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
stake=$(curl -s -L https://api.nymtech.net/cosmos/staking/v1beta1/pool | jq 'values["pool"]["bonded_tokens"]')
|
||||
echo ${stake:1:2}.${stake:3:3}
|
||||
Executable
+36
@@ -0,0 +1,36 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
cd ../scripts &&
|
||||
python csv2md.py -s 1 ../docs/data/csv/variables.csv > ../docs/components/outputs/csv2md-outputs/variables.md &&
|
||||
python csv2md.py -s 0 ../docs/data/csv/isp-sheet.csv > ../docs/components/outputs/csv2md-outputs/isp-sheet.md &&
|
||||
cd cmdrun &&
|
||||
./nyx-percent-stake.sh > ../../docs/components/outputs/nyx-outputs/nyx-percent-stake.md &&
|
||||
./nyx-total-stake.sh > ../../docs/components/outputs/nyx-outputs/nyx-total-stake.md &&
|
||||
cd ../api-scraping &&
|
||||
python api_targets.py time_now > ../../docs/components/outputs/api-scraping-outputs/time-now.md &&
|
||||
cd ../../../scripts &&
|
||||
echo '```python' > ../documentation/docs/components/outputs/command-outputs/node-api-check-query-help.md &&
|
||||
python node_api_check.py query_stats --help >> ../documentation/docs/components/outputs/command-outputs/node-api-check-query-help.md &&
|
||||
echo '```' >> ../documentation/docs/components/outputs/command-outputs/node-api-check-query-help.md &&
|
||||
echo '```python' > ../documentation/docs/components/outputs/command-outputs/node-api-check-help.md &&
|
||||
python node_api_check.py --help >> ../documentation/docs/components/outputs/command-outputs/node-api-check-help.md &&
|
||||
echo '```' >> ../documentation/docs/components/outputs/command-outputs/node-api-check-help.md &&
|
||||
cd ../target/release/ &&
|
||||
echo '```sh' > ../../documentation/docs/components/outputs/command-outputs/nym-node-help.md &&
|
||||
./nym-node --help >> ../../documentation/docs/components/outputs/command-outputs/nym-node-help.md &&
|
||||
echo '```' >> ../../documentation/docs/components/outputs/command-outputs/nym-node-help.md &&
|
||||
echo '```sh' > ../../documentation/docs/components/outputs/command-outputs/nym-node-run-help.md &&
|
||||
./nym-node run --help >> ../../documentation/docs/components/outputs/command-outputs/nym-node-run-help.md &&
|
||||
echo '```' >> ../../documentation/docs/components/outputs/command-outputs/nym-node-run-help.md &&
|
||||
echo '```sh' > ../../documentation/docs/components/outputs/command-outputs/nymvisor-help.md &&
|
||||
./nymvisor --help >> ../../documentation/docs/components/outputs/command-outputs/nymvisor-help.md &&
|
||||
echo '```' >> ../../documentation/docs/components/outputs/command-outputs/nymvisor-help.md &&
|
||||
echo '```sh' > ../../documentation/docs/components/outputs/command-outputs/nym-api-help.md &&
|
||||
./nym-api --help >> ../../documentation/docs/components/outputs/command-outputs/nym-api-help.md &&
|
||||
echo '```' >> ../../documentation/docs/components/outputs/command-outputs/nym-api-help.md &&
|
||||
|
||||
echo "prebuild finished"
|
||||
Reference in New Issue
Block a user