How to deploy a Nym Mixnode with Digital Ocean

It took me a few days to get this working and I was quite frustrated by how little documentation or information I could find online. So as a little geste for the world, here is a little guide for anyone who is trying to setup a Nym Mixnode.

What is a Nym Mixnode?

If you're reading this, you most likely know what Nym is, but in case, here is the link to their website. The one-liner is basically:

Tor but with a cryptocurrency to financially incentivise people to run nodes

Setting up your Ubuntu machine

It can be very hard to get this setup. You might know how to work with the Terminal, you might have some experience with Docker or running your apps on Heroku, but actually setting up a machine and SSH-ing into it was not straight forward at all for me.

The choice of platform is crucial here because there are so many things that can go wrong:

  • You don't get an IP address
  • The IP address keeps changing
  • The networking / firewall configuration is wrong
  • There is an internal/external IP address (GCP I'm looking at you)
  • You don't know how to use SSH

and whatever you do right or wrong during the actual installation, things might never work because of this.

The takeaway: be smart and choose the platform wisely. In this case, Digital Ocean is absolutely perfect. The default is exactly what you need. Just sign up, add your credit card and you're good to go.

Create a new Droplet

Simply create a new Droplet and go with all the basic options (this is for the Sandbox Testnet, so you don't need any sexy configurations).

You will need to create an SSH key (1Password can do this for you, else, they have a little tutorial).

And in the Additional settings section, make sure to enable IPv6 networking.

So to summarize this step:

  1. Ubuntu image
  2. Basic settings everywhere
  3. SSH key
  4. IPv6 in Additional settings

Install Nym on your machine

Once the new Droplet is created, you should be able to see a dashboard with important information. Namely the IP address and a console button. Click on that button to start installing stuff.

digital-ocean.png

The steps described in the Nym documentation are more or less correct, but there are some tricks due to the information being partly outdated.

So here is the working version as of May 2022:

Install basic dependencies...

sudo apt update
sudo apt install pkg-config build-essential libssl-dev curl jq

Install Rust

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Installing the Nym repo from github

git clone https://github.com/nymtech/nym.git
cd nym

Change to the Sandbox testnet version (careful! The current accurate version is v1.0.1 and not v1.0.0 as stated in the documentation.

git checkout tags/v1.0.1

Build the release version (this takes 10m)

NETWORK=sandbox cargo build --release

Move into the repository that contains the compiled data

cd target/release

Test if everything is working

./nym-mixnode --help

Here, you will see a nice Nym logo and some information. This means you've made it!!!!

Setup your Nym Mixnode

From here on, everything should be smooth, but stay focused :)

First, we instantiate the node with an id, a wallet associated with the id and the IP address connected to your machine. ifconfig.me does it for you.

./nym-mixnode init --id SOME_ID --wallet-address YOUR_WALLET --host $(curl ifconfig.me)

For example

./nym-mixnode init --id hello --wallet-address nymt1z0w2mdpvy9t7d03q6hlurezjkl6m4t9decg73d --host $(curl ifconfig.me)

Finally, we start running the node with the following command (make sure to remplace SOME_ID with your actual id created in the previous command.)

./nym-mixnode run --id SOME_ID

Congrats! You can check if everything is running fine by checking the /stats endpoint of your server. For example http://IP_ADDRESS:8000/stats, in my case: http://46.101.162.95:8000/stats

Thanks, you will also be able to see your mixnode on the sandbox explorer. Just search for your wallet address. Mine for example is sandbox.mixnet.explorers.guru/mixnode/sEGnx..

If anything is not working or if you have problems, please let me know!!