Author

Topic: Guide: How to run your own P2Pool in Ubuntu 16.04 LTS with merged mining (Read 3470 times)

full member
Activity: 196
Merit: 100
This is a guide on how to run P2Pool on Ubuntu 16.04 LTS Server with merged mining (emercoin)

17-May-2017: 1st version - Please report any issues

IMPORTANT SECURITY NOTE: If you are running your server on a VPS with full internet access make sure you change the rpcpassword or edit your config files and add rpcallowip=127.0.0.1

Some history:
I created this guide to have up to date P2Pool installation instructions on latest version of Ubuntu LTS (currently 14.04).
People may consider it difficult to get a P2Pool node up and running but in fact it's very simple if you have some basic Linux knowledge.
In this guide I will provide BTC and merged mining.
Note that althought BTC mining is distributed among P2Pool miners, merged coins will not be distributed to others but you will solo mine those.
If you mine exclusively with P2Pool you will get the same profit (and a bit more) compared to mining to other pools. In the long run NMC/DVC/IXC profit will be the same.

Install Ubuntu 16.04 LTS Server from here: http://www.ubuntu.com/download/server
(note do not install Ubuntu DESKTOP 16.04 LTS - you need Server version for text only install)

I will not cover instructions on how to do this. You can install it in a virtual machine or a physical machine.
For virtual machine start with 2 Processors and 4GB memory. Suggested disk size is 300GB (that's a lot but you will have room to grow).

Create a user and run all the commands as a user NOT as root.

If you find any mistakes please let me know!

First thing after you install ubuntu is to install all updates and prerequisites for Ubuntu:
Code:
sudo apt -y update
sudo apt -y install software-properties-common aptitude dialog
sudo add-apt-repository -y ppa:bitcoin/bitcoin
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv B58C58F4
sudo add-apt-repository 'deb http://download.emercoin.com/ubuntu xenial emercoin'
sudo apt -y update
sudo apt -y install bitcoind emercoin screen python python-rrdtool python-pygame python-scipy python-twisted python-twisted-web python-imaging
sudo apt -y dist-upgrade

Grab P2Pool:
Code:
cd ~
sudo git clone git://github.com/forrestv/p2pool.git

Setup Bitcoin config file:
Code:
mkdir ~/.bitcoin/
echo server=1 >~/.bitcoin/bitcoin.conf
echo daemon=1 >>~/.bitcoin/bitcoin.conf
echo rpcuser=bitcoin >>~/.bitcoin/bitcoin.conf
echo rpcpassword=h3wby4zWjGwywZ >>~/.bitcoin/bitcoin.conf
echo rpcallowip=127.0.0.1 >>~/.bitcoin/bitcoin.conf

About emercoin:
We have already emercoin binary already from official repo.
For each installation a random RPC password is generated so do a:
sudo cat /var/lib/emc/.emercoin/emercoin.conf
Find the line:
rpcpassword=PheIHyBs99yyTBgrQGa6mUMmmO8Tq3ht

And hold on to this password.

Don't just copy paste the lines below.
Change the password after emccoinrpc to match your password you got above:
For example it should be: --merged http://emccoinrpc:[email protected]:6662/

Code:
echo /usr/bin/bitcoind  >~/start-p2pool
echo sleep 200 >>~/start-p2pool
echo screen -d -m -S p2pool ~/p2pool/run_p2pool.py bitcoin h3wby4zWjGwywZ --merged http://emccoinrpc:[email protected]:6662/ >>~/start-p2pool
chmod +x start-p2pool

You are not ready to start P2Pool just yet. The BTC blockchain has to be downloaded first and it will take some time...
So execute these commands and wait...


Run this command to start P2Pool:
Code:
screen -d -m -S p2pool ~/p2pool/run_p2pool.py bitcoin h3wby4zWjGwywZ --merged http://emccoinrpc:[email protected]:6662/ >>~/start-p2pool

You can view the P2Pool ouput using
Code:
screen -x p2pool

You disconnect from the P2Pool output by pressing: Ctrl-A and then D (nothing will show on screen)

When you reboot your server you can just start it by executing:
~/start-p2pool

The above command includes a wait of 200 seconds (so that bitcoind gets latest updates) before starting p2pool.

Enjoyed it? Buy me a beer Smiley
Send your donations to: 1mrdfyA1GhKmTPhaSkvyq5DBterQ5m7ZK
Jump to: