Nodes

guruGuru
search

Nym - Setup Guide

Back to projectRU
Stuck? AsktelegramNodes Guru telegram community

Rent on

This guide covers installation of Nym mixnode for the Mainnet

!!!!!! YOU MUST SAVE YOUR KEYS FILES FROM ~/.nym/mixnodes/<your_id>/data (four .pem files) IN SAFE PLACE! And wallet mnemonic phrase.

Installing

Replace YOUR_WALLET with your Nym Mainnet wallet address.

wallet=YOUR_WALLET
echo 'export wallet='$wallet >> $HOME/.bash_profile


Use our script for a quick installation:

wget -O nym_mainnet.sh https://api.nodes.guru/nym_mainnet.sh && chmod +x nym_mainnet.sh && ./nym_mainnet.sh

Open Nym Wallet App. Log in with the mnemonic phrase or with password.
Go to the Bond wallet section and fill out all the lines, the data for filling can be found by running the command:

. $HOME/.bash_profile
nym-mixnode node-details --id $node_id

Press BOND, everything should go without errors. If all went well you should get this result


Let’s get back to terminal and check when your node starts mixing packets.
Command to check:

journalctl -u nym-mixnode -o cat | grep "Since startup mixed" 


1.5 Make sure you have your ports open: 1789, 1790, 8000 (and 443, 22, 80) for correct operation and rewards. More info about ports in official docs.
If everything goes correctly, your node will appear in NG Mixnet Explorer

DELEGATION

To delegate, you need to open a wallet and select Delegate, do not forget to leave a coin for the commission.
Mixnode Identity – Identity key of mixnode to delegate to (Nodes.Guru mixnode 8D5QgyAGqCgChDCxMqQKZpYPNb8hpDNQS43eBJUWagnW)
Amount to delegate – amount of tokens to delegate
Click DELEGATE STAKE.

You can check your delegation in the list of that mixnode you delegate to at NG Mixnet Explorer

Useful commands

Describe your mixnode(the name that will be displayed in the explorer):

nym-mixnode describe --id $node_id
systemctl restart nym-mixnode

Check how many packets your node mixed:

journalctl -u nym-mixnode -o cat | grep "Since startup mixed" | tail -1

Restart your node:

systemctl restart nym-mixnode

Update node:

wget -O nym_update.sh https://api.nodes.guru/nym_update.sh && chmod +x nym_update.sh && ./nym_update.sh

Extend ulimit (important for mixnode’s health in future):
– oneliner autoscript

wget -O nym_ulimit.sh https://api.nodes.guru/nym_ulimit.sh && chmod +x nym_ulimit.sh && ./nym_ulimit.sh

– commands for manual change

echo "DefaultLimitNOFILE=65535" >> /etc/systemd/system.conf
sudo systemctl daemon-reload
sudo systemctl stop nym-mixnode
sudo systemctl start nym-mixnode

Check that ulimit has changed to 65535

grep -i "Max open files" /proc/$(ps -A -o pid,cmd|grep nym-mixnode | grep -v grep |head -n 1 | awk '{print $1}')/limits

Ipv6 checks
See whats your external ipv6:

curl http://v4v6.ipv6-test.com/api/myip.php && echo

Check connection via ipv6 to google.de:

ping6 www.google.de

Check if you got ipv6 on your network settings:

hostname -I

Decypher your public Identity and Sphinx keys:
Run commands (snapd may be installed differently on your OS):

apt install snapd
snap install base58
ls -1 $HOME/.nym/mixnodes/*/data/public_identity.pem | while read F; do echo === $F ===; grep -v ^- $F | openssl base64 -A -d | base58; echo; done
ls -1 $HOME/.nym/mixnodes/*/data/public_sphinx.pem | while read F; do echo === $F ===; grep -v ^- $F | openssl base64 -A -d | base58; echo; done

Delete node:

sudo systemctl stop nym-mixnode
sudo systemctl disable nym-mixnode
rm -rf ~/nym ~/.nym
rm -f /etc/systemd/system/nym-mixnode.service
rm -f /usr/bin/nym-mixnode

Troubleshooting

If you still got problems with node (for example ‘could not create TCP Listener’; or mixed packets are still 0 after 10 minutes of running), check the following:
1) is TCP 1789 port opened on server?
2) is TCP 1789 port opened for inbound and outbount on Firewall at your server control panel (website)?
3) If you use Google Cloud, AWS, run node on hostings outside those NodesGuru recommend, or even run it at desktop or virtual machine:
4.1) check that you got static ip
4.2) check official docs about custom –init and how to set internal/external ips as host/announce host
4.3) make sure you put external ip in Bond form

Undelegate NYM tokens from the mixnode via cli, NOT REQUIRED FOR MIXNODE OPERATORS.

Binary installation:

wget -q -O nyx.sh https://api.nodes.guru/nyx.sh && chmod +x nyx.sh && sudo /bin/bash nyx.sh && source ~/.bash_profile

Restore Wallet:

nyxd keys add wallet --recover

Tokens undelegation. Replace only $IDENTITY with the Identity Key of the mixnode you delegated to, don’t change anything else:

nyxd tx wasm execute n14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sjyvg3g '{"undelegate_from_mixnode":{"mix_identity":"$IDENTITY"}}' --from wallet --fees=50000unym --chain-id nyx --broadcast-mode block --note "undelegating through NG" --node https://rpc-1.nyx.nodes.guru:443/ --gas=auto --gas-adjustment 1.4

Full command example:

nyxd tx wasm execute n14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sjyvg3g '{"undelegate_from_mixnode":{"mix_identity":"HzBojijGgFWV7oPWnDRyL4ejEYsBjDfMYmaxC4uQhxrf"}}' --from wallet --fees=50000unym --chain-id nyx --broadcast-mode block --note "undelegating through NG" --node https://rpc-1.nyx.nodes.guru:443/ --gas=auto --gas-adjustment 1.4