Nymjackie Chan - NYM mixnode ubuntu server setup
Check IPv6 address is available
Order an additional IPv6 address from your provider before the server setup. To ensure everything is okay view all addresses of your host, should output both IPv4 and IPv6 addresses
hostname -I
194.135.119.150 2a12:e340:2000:7::2
Ping external IPv6 address
ping6 -c 5 ipv6.google.com
PING ipv6.google.com(par21s20-in-x0e.1e100.net (2a00:1450:4007:818::200e)) 56 data bytes
64 bytes from par21s20-in-x0e.1e100.net (2a00:1450:4007:818::200e): icmp_seq=1 ttl=115 time=72.2 ms
64 bytes from par21s20-in-x0e.1e100.net (2a00:1450:4007:818::200e): icmp_seq=2 ttl=115 time=72.1 ms
64 bytes from par21s20-in-x0e.1e100.net (2a00:1450:4007:818::200e): icmp_seq=3 ttl=115 time=73.0 ms
64 bytes from par21s20-in-x0e.1e100.net (2a00:1450:4007:818::200e): icmp_seq=4 ttl=115 time=72.2 ms
64 bytes from par21s20-in-x0e.1e100.net (2a00:1450:4007:818::200e): icmp_seq=5 ttl=115 time=73.3 ms
Add a mixnode user
adduser mixnode
Give ‘sudo’ privileges to a new user
usermod -aG sudo mixnode
Login as a ‘mixnode’ user
su - mixnode
Install necessary software
Update system software
sudo apt-get update
sudo apt-get upgrade
Install necessary packages
sudo apt-get install pkg-config build-essential libssl-dev curl jq git
Install rust compiler. Get the actual url here
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Log out and log in again to get cargo path available in the current shell
Enable firewall
Install ufw firewall if needed
sudo apt-get install ufw
Enable it and deny everything by default
sudo ufw enable
Allow nym-mixnode ports (1789,1790,8000) and ssh (22)
sudo ufw allow 1789,1790,8000,22/tcp
Check firewall status
sudo ufw status
Build nym-mixnode from sources
Set the actual release version in checkout command
git clone https://github.com/nymtech/nym.git
cd nym
git checkout release/v1.1.3
cargo build --release
Initialize a mixnode
Go to nym-mixnode binary directory
cd target/release
Upload a file named ‘wallet.txt’ with a wallet address inside you want to bond this node, you will use it in the command below. Run a mixnode initialization and save output into ‘bonding.txt’, you will need it to bond your node in the next step.
./nym-mixnode init --id pineapple --host $(curl ifconfig.me) --wallet-address $(cat wallet.txt) > bonding.txt
The directory ‘~/.nym’ with configs and keys will be created.
Bond your mixnode
Recommended way to bond is via desktop wallet. Open the wallet and press the Bonding menu.
Step 1. Fill all the needed information using bonding.txt in the previous step
Step 2. Set the ‘Amount’ to bond starting from the 100 NYM and a ‘Profit margin’ (usually 1-10%).
Run mixnode as a service
A service allows you to run a mixnode in a background and start it automatically after server reboots. Upload a file ‘/etc/systemd/system/nym-mixnode.service’ with a content below
[Unit]
Description=Nym Mixnode (1.1.3)
StartLimitInterval=350
StartLimitBurst=10
[Service]
User=mixnode
LimitNOFILE=65536
ExecStart=/home/mixnode/nym/target/release/nym-mixnode run --id pineapple
KillSignal=SIGINT
Restart=on-failure
RestartSec=30
[Install]
WantedBy=multi-user.target
Start a service
sudo systemctl enable nym-mixnode.service
sudo service nym-mixnode start
Describe a mixnode
Edit a file ‘~/.nym/mixnodes/pineapple/config/description.toml’ to your liking
name = "Pineapple on the pizza"
description = "We, the supporters of pineapple pizza, declare our resistance to all forms of taste oppression. We refuse to be dictated to by arbitrary prejudices and conventional tastes. We believe that everyone has the right to choose what they want to eat, without fear of reprisal or discrimination."
link = "https://pastenym.ch/#/5F5D49XB&key=c6872aafb31dbdfa8e411d884248a14d"
location = "Pizza, Atop"
Restart a service to get node description updated
sudo service nym-mixnode restart
Check your node in a explorer, replace %NODE_ID% with your ‘Identity Key’
https://mixnet.explorers.guru/mixnode/%NODE_ID%
Verify open files limit
Processes in linux usually have an open files limitation. Check it with a command below
grep -i "open files" /proc/$(ps -A -o pid,cmd|grep nym-mixnode | grep -v grep |head -n 1 | awk '{print $1}')/limits
If 65535 in the output, that everything is okay, otherwise go to the next step.
sudo echo DefaultLimitNOFILE=65535 >> /etc/systemd/user.conf
sudo echo DefaultLimitNOFILE=65535 >> /etc/systemd/system.conf
Reboot the server
Check mixnode status
Check if the node is started successfully
sudo journalctl -u nym-mixnode -o cat | grep "Since startup mixed"
Mixed packets should not be zero in the output
2022-12-18T05:23:59.829Z INFO nym_mixnode::node::node_statistics > Since startup mixed 4271 packets! (0 in last 30 seconds)
2022-12-18T05:24:59.831Z INFO nym_mixnode::node::node_statistics > Since startup mixed 4271 packets! (0 in last 30 seconds)
2022-12-18T05:25:59.832Z INFO nym_mixnode::node::node_statistics > Since startup mixed 4283 packets! (12 in last 30 seconds)
2022-12-18T05:26:59.834Z INFO nym_mixnode::node::node_statistics > Since startup mixed 4283 packets! (0 in last 30 seconds)