Quick and Simple Equihash Mining Pool Guide

This is a quick and simple mining pool setup guide for crypto-currencies like Zcash, Zclassic, and Komodo that use the Equihash algorithm. Experienced Linux users should be able to get the pool up and running within 30 minutes following this guide. This guide is not meant for absolute Linux novices or those new to crypto-currency mining like my previous guides.

This is by no means meant to be a guide so you can setup your own professional mining pool operation. Running your own mining pool that other miners other then yourself will use is not an easy undertaking. Professional mining pools that public users would mine on requires extensive systems administration experience as well as a large budget, patience, troubleshooting skills, and a solid knowledge of how crypto-currencies work. This guide will not be going over any security features either. It’s purely intended for your personal use.

We’ll be setting up a Z-Nomp mining pool with the Zcash Testnet for this guide. This should work for most of the other popular Equihash Algorithms that are forks of Zcash such as Zclassic, ZenCash, and Komodo. Bitcoin Gold is untested.

Here is the default look of the Z-Nomp pool. The interface does need help, but you can customize it in the future or build the API into your own offsite website.

Equihash Mining Pool (Z-Nomp) User Interface

 

Guide Requirements

While writing this guide I was using a Vultr Cloud Server Yes, those are referral links that we benefit from if you sign up.

This guide will assume you are starting with a fresh virtual machine. If you are running other pools and/or nodes on your preexisting virtual machine you may run into package conflicts.

The resource requirements are strictly intended for the guide and experimentation. I have heard of Zcash node’s using more than 4GB of memory so it may be wise to allocate more resources if you are relying on this mining pool in any real capacity.

 

Virtual Machine Prep

Login to your new virtual machine run the following commands in order.

adduser newusername

adduser newusername sudo

su newusername

cd

sudo apt-get update

sudo apt-get dist-upgrade

sudo apt-get install build-essential libtool autotools-dev apt-transport-https autoconf automake git 

sudo apt-get install pkg-config libssl-dev libsodium-dev libboost-all-dev npm nodejs nodejs-legacy redis-server

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

Close your current terminal session and relog. Remember, login to your new sudo user !

nvm install 8.9.4

npm install [email protected] -g

sudo apt-get autoremove

We just did a lot stuff and Ubuntu needs to be rebooted so everything takes affect.

reboot

 

Install & Configure Zcash Testnet

wget -qO - https://apt.z.cash/zcash.asc | sudo apt-key add -

echo "deb [arch=amd64] https://apt.z.cash/ jessie main" | sudo tee /etc/apt/sources.list.d/zcash.list

sudo apt-get update

sudo apt-get install zcash

zcash-fetch-params

This will take 5-10 minutes

zcashd

Should give a warning that no .conf exists. Press Ctrl + C if it hangs.

vi .zcash/zcash.conf

Input the following:

testnet=1
addnode=testnet.z.cash
rpcuser=zcashrpc
rpcpassword=replaceme
rpcallowip=127.0.0.1
rpcport=2500
daemon=1
server=1

zcash-cli getinfo

Run the getinfo command a few times, if blocks are updated then you are good!

zcash-cli getaccountaddress ""

Save this somewhere, this is the main address we’ll use in the pool config.

zcash-cli z_getnewaddress

Save this somewhere, this is the z address…

zcash-cli getnewaddress

Save this for later, this is the t address…

 

Install & Configure Z-Nomp

git clone https://github.com/joshuayabut/node-open-mining-portal.git z-nomp

cd z-nomp

npm update

npm install

cp config_example.json config.json

The default config should work in the meantime unless your redis is hosted offsite. Obviously change this in the future to change the site name, etc.

cd pool_configs

cp zcash_testnet_example.json zcash_testnet.json

vi zcash.json

Example zcash.json with proper addresses we got during the zcash install and zcash rpc creds from the zcash.conf. Make sure you actually enable the config and if your reward receipients are not set then do not leave the blank address “” next to 0.2 and 0.3 otherwise you’ll get an invalid checksum error

{
"enabled": true,
"coin": "zcash_testnet.json",

"address": "tmDRnE5HboRrCrheLT9Dr7KjApGHNy1RvpF",
"_comment_address": "a transparent address to send coinbase rewards to and to transfer to zAddress.",

"zAddress": "ztf5KC6k52hoWnw4dNaTXMj37hRjDCYgpq5PV3VMxkECpEQoNqVEsQxw52fGx4aaN6VzvcGqqfXPvFM5U9P1dh2BUvupMQx",
"_comment_zAddress": "a private address used to send coins to tAddress.",

"tAddress": "tmUUygQpitfE3oWmG3GYutzWVhhUJo4t16r",
"_comment_tAddress": "transparent address used to send payments, make this a different address, otherwise payments will not sen$

"walletInterval": 2.5,

"rewardRecipients": {},

"paymentProcessing": {
	"minConf": 10,
	"enabled": true,
	"paymentMode": "prop",
	"_comment_paymentMode":"prop, pplnt",
	"paymentInterval": 20,
	"minimumPayment": 0.1,
	"maxBlocksPerPayment": 3,
	"daemon": {
		"host": "127.0.0.1",
		"port": 2500,
		"user": "zcashrpc",
		"password": "replaceme"
	}
},

"tlsOptions": {
	"enabled": false,
	"serverKey":"",
	"serverCert":"",
	"ca":""
},

"ports": {
	"3032": {
		"diff": 0.05,
		"tls": false,
		"varDiff": {
			"minDiff": 0.04,
			"maxDiff": 16,
			"targetTime": 15,
			"retargetTime": 60,
			"variancePercent": 30
		}
	}
},

"daemons": [
	{
		"host": "127.0.0.1",
		"port": 2500,
		"user": "zcashrpc",
		"password": "replaceme"
	}
],

"p2p": {
	"enabled": false,
	"host": "127.0.0.1",
	"port": 19333,
	"disableTransactions": true
},

"mposMode": {
	"enabled": false,
	"host": "127.0.0.1",
	"port": 3306,
	"user": "me",
	"password": "mypass",
	"database": "zec",
	"checkPassword": true,
	"autoCreateWorker": false
}
}

cd ..

npm start

The pool should be started, connect your miner and check out the website at http://yourserverip:8080. If the blockchain is still syncing them you may need to wait until it syncs all the way.

Press Ctrl + C to

Now let’s set it to run in the background with PM2.

pm2 start npm -- start

To see logs, just type

pm2 logs

pm2 logs do not rotate logs by default, you may want to put something together in logrotate.d so you don’t have 100MB+ log files bogging down your system after a few days.

That’s it, your pool is running!

To connect with something like Claymore you’d use your coin wallet address for -zwal and any password for -zpsw such as x.

 

Miscellaneous Ideas & Suggestions

If you are having issues connecting, Ubuntu’s UFW is probably getting in the way. Either configure it properly or disable it and use your provider’s cloud firewall. Config Server & Security Firewall is also a nice and powerful iptables firewall and login failure daemon suite with a lot of cool features for limiting different types of attacks.

Zcashd won’t start on boot unless you set it to with systemd. Remember you need to start it from your user account that you used during this guide.

PM2 won’t start on boot either but you should use their Startup Script guide for this. PM2 is a very powerful piece of kit for node.js and has a pretty awesome Web UI. I suggest diving into their website and docs.

Running your node.js site bare is generally a bad idea. Most people like to use a NGINX Reverse Proxy. You could also use something like Caddy Server if you want an auto-renewing Let’s Encrypt SSL cert (free) for your website.

Look into setting up blocknotify on your coin node/daemon. While default Z-Nomp will auto poll the node and this works for the most part, there is a very slim chance you may miss finding a block between the polling interval and when the node is actually on a new block.

On larger scales, most pool operators will separate different components of their pool software. IE Payment Processor, Website, and Stratum are separated. It’s 2018, I recommending using Docker and something like Rancher + Kubernetes to achieve this. Z-Nomp will scale, you can put multiple Stratum containers behind a load-balancer. Just make sure you only have ONE, and I repeat ONE payment processor container no matter what!!!

Z-Nomp is PPLNS by default and you should dig into their documentation to understand the payout and difficulty settings.

Any questions or suggestions feel free to comment!

 

Zach A.

Mining Pool Operator & Mining Enthusiast.

1 Comment

  1. hannnes707   •  

    Thanks Zac! I Will try it and troubleshoot the pool today!

Leave a Reply