Set-Up a Validator Node in the Nym Network: Guide

FAST
5 min readSep 12, 2023

In this guide, we’ll walk you through the process of setting up a Validator node in the Nym network, an essential part of ensuring the privacy and security of the network. Validators play a crucial role in maintaining the network’s integrity, and this guide will help you become a part of this critical ecosystem.

Prerequisites:

Before diving into the setup process, ensure that you have the necessary dependencies installed on your system:

git, gcc, jq: You can install these on Debian-based systems with the following command:

apt install git build-essential jq

For arch-based systems, use:

pacman -S git gcc jq

Go installation:

Nym validators are written in Go. You can install Go using the following commands (taken from the Go Download and Install page):

# Remove any existing old Go installation and extract the archive into /usr/local
# You may need to run the command as root or through sudo
rm -rf /usr/local/go && tar -C /usr/local -xzf go1.20.6.linux-amd64.tar.gz

# Add /usr/local/go/bin to the PATH environment variable
export PATH=$PATH:/usr/local/go/bin
source $HOME/.profile

Verify that Go is installed correctly by running:

go version

It should display something like: go version go1.20.4 linux/amd64.

Downloading a precompiled validator binary:

You have the option to download precompiled binaries for Ubuntu 22.04 and 20.04 for both Mainnet and the Sandbox testnet from the provided links.

Compiling your validator binary (optional):

If you prefer to compile the Nyx validator binary from the source code, follow these steps:

1. Clone the Nyx validators repository:

git clone https://github.com/nymtech/nyxd.git
cd nyxd
git checkout release/<NYXD_VERSION>

Replace <NYXD_VERSION> with the desired release version.

2. Compile the binary:

make build

You will find the nyxd binary in the build/ directory.

3. Verify the compilation by running:

./build/nyxd

It should display a help menu.

Adding nyxd to your $PATH:

To run nyxd from anywhere in your terminal, you need to add its location to your system's PATH environment variable.

To run nyxd from anywhere in your terminal, you need to add its location to your system's PATH environment variable.

Initializing your validator:

Choose a name for your validator, and use it in place of <ID> in the following command:

# Mainnet
nyxd init <ID> --chain-id=nyx

# Sandbox testnet
nyxd init <ID> --chain-id=sandbox

This command generates private validator key files and a genesis file for your validator.

Configuring config.toml:

Edit the config.toml file to configure various options for your validator. You'll need to specify peers, enable Prometheus metrics, and add a human-readable moniker to your node.

Configuring app.toml:

In the app.toml file, set values related to gas prices and ensure that the API server is enabled.

Set-Up your validator admin user:

You’ll need an admin account to manage your validator. Create one using the following command:

nyxd keys add nyxd-admin

This command adds keys for your administrator account to your system’s keychain and logs essential information. Be sure to write down your mnemonic.

Starting your validator:

Start your validator using the command:

nyxd start

Please be patient, as it may take some time for your validator to sync with the network.

Syncing from a snapshot:

You have the option to sync from a snapshot, which can expedite the syncing process. Detailed commands are provided for both Mainnet and the Sandbox testnet.

Joining consensus:

When you’re ready to join consensus and produce blocks, use the nyxd tx staking create-validator command with the appropriate parameters based on the network you're joining.

Automating uour validator with systemd:

To ensure that your validator restarts automatically if your server reboots, you can follow the provided tutorial.

Installing and configuring nginx for HTTPS (Optional):

For improved security and performance, you can set up reverse proxying using nginx. Detailed instructions are available in the provided tutorial.

Setting the ulimit:

Linux limits the number of open files a user can have (ulimit). You may need to increase this limit to ensure your validator functions correctly. Instructions for changing the ulimit value are provided.

Using your validator:

Learn how to perform common operations with your validator, such as un-jailing, upgrading, and handling potential issues that may lead to your validator being jailed. Here is a more in-depth look:

Un-Jailing your validator:

# Mainnet
nyxd tx slashing unjail
--broadcast-mode=block
--from="KEYRING_NAME"
--chain-id=nyx
--gas=auto
--gas-adjustment=1.4
--fees=7000unyx

For the Sandbox Testnet, use a similar command with the appropriate chain ID.

Upgrading your validator:

When it’s time to upgrade your validator, follow the steps outlined in the provided maintenance page.

Common reasons for jailing:

Understanding why your validator may get jailed can help you avoid common issues. One common reason is that your validator runs out of memory due to bloated syslogs. Check your server’s partition size using the df -H command and consider pruning .gz syslog archives if necessary.

Day 2 Operations:

After your validator is up and running, you may want to perform additional operations:

  • Checking Balances: You can check your current token balances using the nymd query bank balances ${ADDRESS} command. This command helps you keep track of your validator's financial status.
  • Staking Tokens: You can stake your available tokens back to your validator using the appropriate nyxd tx staking delegate command. Be sure to allocate some tokens for gas costs.

This comprehensive guide should provide you with a detailed understanding of how to set up and manage a Validator node in the Nym network. Remember that validators play a crucial role in ensuring the network privacy and security, and your participation is valued.

By following these instructions and staying informed about the network updates, you can contribute to the Nym network success while maintaining your validator efficiently.

Please ensure that you replace placeholders like <ID>, <NYXD_VERSION>, and other variables with your specific information when executing the commands. Additionally, always exercise caution when dealing with tokens and cryptographic keys, and keep your system and configurations up to date.

Nym | Nym on Twitter | My twitter

--

--