Setting up your own Monero mining pool with node-cryptonote-pool and Ubuntu 14
Feel free to use our Monero mining pool. mnrpool.tekyhost.com
In this how to we will be setting up Monero mining pool with node-cryptonote-pool. We will be using Ubuntu-14.04 VPS running on VirtualBox
Monero
Monero first came around in April 2014. One of its main attractions is anonymity and security. Monero incorporates features into the cryptocurrency itself. It also implements a few features that Bitcoin does not offer. With its stealth addresses setup it generates addresses for receiving Monero that are essentially encrypted the recipient can retrieve the funds, but no one can link that stealth address to the owner. And it also uses something called “ring confidential transactions,” which hides the amount of every transaction.
Definitions
Mining pool: Mining pool is the pooling of resources by miners who join there computer power together to perform tasks that keep cryptocurrency healthy and secure. In return they share crypto coins they get for performing there tasks.
Monero: Monero is a secure, private, and untraceable cryptocurrency. It is open-source and accessible to all.
Prerequisites
1. Setup Ubuntu-14.04.5 VPS server with 2048G of RAM and at least 120G hard drive. We use virtual machine running on VirtualBox with following partitions.
/ /boot /swap
2. Install prerequisites
sudo apt-get install libssl-dev sudo apt-get install libboost-all-dev sudo apt-get install build-essential libtool autotools-dev autoconf pkg-config libssl-dev sudo apt-get install libboost-all-dev git npm nodejs nodejs-legacy libminiupnpc-dev redis-server
3. Since this is just demo install we will disable firewall so it will be easier to troubleshoot in case of errors.
sudo ufw disbale
Pool Installation
Setup Coin daemon
Go to https://getmonero.org/downloads/ and download Linux, 64-bit (Command-Line Tools Only)
tar jxvf monero-linux-x64-v0.11.1.0.tar.bz2 cd monero-v0.11.1.0/
In order to speed up synchronization we will download the current blockchain and import it into the daemon.
wget https://downloads.getmonero.org/blockchain.raw
Import blockchain file
sudo ./monero-blockchain-import --verify 0 --input-file blockchain.raw
This may take quite some time. In our case it took almost 30 hours with connection at 30mbps. You will also need close to 20G of space on your drive. Ones completed blockchain.raw file can be deleted.
Install node-cryptonote-pool.
Make sure you ate in the directory where you want software installed. In our case /opt
cd /opt git clone https://github.com/zone117x/node-cryptonote-pool.git pool cd pool npm update
WEB Server Install
In our case we will use apache web server to serve basic web pages from same vm where all other components installed. This does not have to be the case and web server can be located on different system.
Install apache
sudo apt-get update sudo apt-get install apache2
Copy example site files
cd pool/website_example/ sudo cp -r * /var/www/html/
Edit the variables in the /var/www/html/config.js file to use your pool’s specific configuration. You will need to change line below to your link.
var poolHost = "cryppit.com";
In case you need to customize your site, files below are included in web example directory
custom.css for creating your own pool style custom.js for changing the functionality of your pool website
After configuration completed you will need to restart web service
sudo service apache2 restart
Configuration after install
1. Start by copying the config_example.json file to config.json
cd pool cp config_example.json config.json
2. Start Coin deamon in the background
cd monero-v0.11.1.0/ sudo ./monerod --detach
In order to monitor output you can run
tail -f ~/.bitmonero/bitmonero.log
3. Setup CLI wallet
cd monero-v0.11.1.0 ./monero-wallet-cli
Follow the screen to setup your wallet. Ones completed type address to get your wallet address
address
Copy this address and enter it in your pool configuration file under pool address.
4. Start the pool with forever so it can run after exit of ssh
cd pool sudo npm install -g forever sudo forever start init.js
You can also start pool without using forever
sudo node init.js
Client side configuration
We will take a look at using two different client cpuminer and xmr-stak-cpu
Cpuminer
In this example our client will be connecting from Ubuntu workstation with cpuminer
sudo apt-get install git libcurl4-openssl-dev build-essential libjansson-dev autotools-dev automake git clone https://github.com/hyc/cpuminer-multi cd cpuminer-multi sudo ./autogen.sh CFLAGS="-march=native" sudo ./configure make sudo
Connect to our pool
sudo /usr/local/bin/./minerd -a scrypt -o stratum+tcp://192.168.0.16:3333 -u WALLET_ADDRESS_HERE -p x -t 3
Remember to replace WALLET_ADDRESS_HERE with your own Monero wallet’s public address. The “-t 3” option determines how many of your CPU threads will be used for mining.
Xmr-stak-cpu
XMR-Stak is a universal Stratum pool miner. This miner supports CPUs, AMD and NVIDIA gpus and can be used to mine the crypto currency Monero and Aeon.
We will be installing it on our client system which is running Ubuntu workstation
sudo apt-get --assume-yes update sudo apt-get --assume-yes install libmicrohttpd-dev libssl-dev cmake build-essential libhwloc-dev screen git nano cd /usr/local/src/ git clone https://github.com/fireice-uk/xmr-stak-cpu.git cd xmr-stak-cpu cmake . make install
Start xmr-stak-cpu
cd bin/ chmod +x xmr-stak-cpu ./xmr-stak-cpu
You will get output similar to the one below.
sudo ./xmr-stak-cpu The configuration for 'cpu_threads_conf' in your config file is 'null'. The miner evaluates your system and prints a suggestion for the section `cpu_threads_conf` to the terminal. The values are not optimal, please try to tweak the values based on notes in config.txt. Please copy & paste the block within the asterisks to your config. **************** Copy&Paste BEGIN **************** "cpu_threads_conf" : [ { "low_power_mode" : false, "no_prefetch" : true, "affine_to_cpu" : 0 }, { "low_power_mode" : false, "no_prefetch" : true, "affine_to_cpu" : 1 }, { "low_power_mode" : false, "no_prefetch" : true, "affine_to_cpu" : 2 }, { "low_power_mode" : false, "no_prefetch" : true, "affine_to_cpu" : 3 }, ], **************** Copy&Paste END ****************
We will need to edit configuration file called config.txt and edit the following sections
"pool_address" : "test.com:3333", "wallet_address" : "xxx", "pool_password" : "xxx", "cpu_threads_conf" : [ { "low_power_mode" : false, "no_prefetch" : true, "affine_to_cpu" : 0 }, { "low_power_mode" : false, "no_prefetch" : true, "affine_to_cpu" : 1 }, { "low_power_mode" : false, "no_prefetch" : true, "affine_to_cpu" : 2 }, { "low_power_mode" : false, "no_prefetch" : true, "affine_to_cpu" : 3 }, ],
Now you can start xmr-stak-cpu
./xmr-stak-cpu