Tutorial: Setting up a MUTEX mining pool on Ubuntu 18.04

Mutex Crypto
Aug 31, 2018 · 4 min read

Recently we have seen an uptick in interest by existing and would-be pool operators wanting to add MUTEX to their lineup. This tutorial will walk through the process of setting up the most commonly used pool software (available on our github) and configuring it for large scale mining. On a decent machine I have seen this configuration easily handle 20MH+ of aggregate (CryptoNight algo) hash power from thousands of independent miners.


The first step is to set up a solid Ubuntu (18.04) server somewhere in the cloud that can sustain enough bandwidth to be responsive to hundreds or thousands of miners simultaneously. NOTE: if you are setting this up behind your firewall to be used only by your personal rigs then a smaller machine will probably do, but for a public pool I would suggest at least a 4CPU machine with 16GB of ram and at least 250-500GB of disk space. For a high volume pool you would want something closer to 16CPU+64GB of RAM but our coin does not currently see that volume of hash power so the smaller specs should suffice.

Prerequisites and overview

You will need a running MUTEX node (mutexd) and a running MUTEX rpc wallet server (mutex-wallet-rpc) which needs to open a wallet file that you must create beforehand using mutex-wallet-cli. All of these must be working so it makes sense to get them working first as a baseline. All of these are available in the MUTEX cli-tools release here: https://github.com/MutexProject/mutex/releases

You can also compile them from source if you prefer but we won’t cover that here.

Further Dependencies

The pool software also requires NodeJS and Redis, along with a webserver (I prefer Nginx) if you intend to run the GUI on the same machine. Pro Tip: run the GUI web UI on a static host like AWS S3 or similar to offload it from the actual pool server and protect against the most common DDoS attacks. This is the reason a lot of pools have the Web UI at one address and the pool connection at a secondary URL.

Several libraries such as OpenSSL and libboost++ are required to compile the native (c++) cryptography modules.

The pool software and additional information can be found here: https://github.com/MutexProject/mutex-nodejs-pool.git


Getting Started:

Log in and update the system with the following command:

sudo apt-get update && sudo apt-get upgrade

Install NodeJS by using NVM (https://github.com/creationix/nvm) to easily manage multiple Node Versions.

To install or update NVM, you can use the install script using cURL:

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash

Once NVM is installed, make sure it’s available in your environment by typing:

nvm ls-remote

If you see a list of various NodeJS versions type:

nvm install v10.8.0

nvm use v10.8.0

Now type node -v and you should see the output:

v10.8.0

At this point NodeJS should be installed and you can move on.

Install Redis (https://redis.io/) using whatever method you prefer. I generally compile it from source, but for simplicity, on Ubuntu you can use:

sudo add-apt-repository ppa:chris-lea/redis-server
sudo apt-get update
sudo apt-get install redis-server

Next install the required development/support libs for SSL and c++/boost:

sudo apt-get install libssl-dev libboost-all-dev

Clone the pool software from Github:

git clone https://github.com/MutexProject/mutex-nodejs-pool.git

Enter the pool directory and use NPM to install the JavaScript and native dependencies:

cd mutex-nodejs-pool && npm update

Copy the config_examples/mutex.json file to config.json then review each option and change any to match your preferred setup.

At the very least you will want to change the wallet address, the server and wallet-rpc connection addresses and admin console passwords.

IMPORTANT: Make sure you allow external access for the pool ports, usually 3333, 4444, 5555, 7777 and sometimes 8888 as defined by your settings in config.js.

You may also want to open up MUTEX p2p ports to make sure you have a strong connection to other MUTEX nodes. DO NOT open your Redis port to the outside world or you will regret it. Redis is not meant to be run in a publicly accessible network and it will likely get hacked if you allow access to it for anyone but your internal network or preferably, only local traffic on the pool sever itself.

Additionally, for high volume environments it is common to have Redis located on a separate dedicated server as it suffers from a heavy write load by the pool software. It can be very beneficial to easily spread out the resource usage between two servers using this method.

NOTE: When running your pool in production it pays to use the UNIX screen command to run each of the pool processes in a different screen so you can easily start and stop them independently. This will also allow you to detach from the screen that contains shells running the pool worker processes and resume them later. It also prevents the pool from stopping should your SSH connection be terminated unexpectedly.

This introduction may be useful: https://www.youtube.com/watch?v=hB6Y72DK8mc

Once in screen you will need to start each process in its own screen window.

node init.js -module pool

node init.js -module api

node init.js -module payments

node init.js -module unlocker

node init.js -module chartsDataCollector

NOTE: You can also run all of these at once using

node init.js

While simpler, this approach makes debugging quite a bit more challenging.

Running a highly available pool is a labor of love and a learning experience. this software suffers from a number of quirks but once worked out it should be very stable for months at a time.

Good luck!

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade