Pages:
Author

Topic: How to run your own P2Pool in Ubuntu 14.04 LTS with merged mining - page 7. (Read 54246 times)

full member
Activity: 196
Merit: 100
huntercoin - i get error at linking. will look into this as well [update: i see in huntercoin forums that others have issues compiling under 14.04 but there is no solution that I found yet. They say if you compile namecoin you are good to go. We apparently compile namecoin OK but doesn't work]

I had the same problem with HUC on 14.04 - I've quoted this on the HUC thread in the hope they get the problem sorted  Wink

I pulled updates from git today as they were some available but still it doesn't work....

Any other SHA-256 merge-minable coins I could add?
full member
Activity: 196
Merit: 100
Added information to merge mine Fusioncoin as well.
full member
Activity: 196
Merit: 100
Added instructions on how to start P2Pool after a reboot automatically.
sr. member
Activity: 379
Merit: 250
Welcome to dogietalk.bs
huntercoin - i get error at linking. will look into this as well [update: i see in huntercoin forums that others have issues compiling under 14.04 but there is no solution that I found yet. They say if you compile namecoin you are good to go. We apparently compile namecoin OK but doesn't work]

I had the same problem with HUC on 14.04 - I've quoted this on the HUC thread in the hope they get the problem sorted  Wink
full member
Activity: 196
Merit: 100
The git link to ixcoin is not for the latest version.

The latest ixcoin client is https://github.com/FrictionlessCoin/iXcoin

Notice also the capital "X" in iXcoin that is also used in the folder name - but not the daemon itself.

Peace (again)  Wink

Done! Updated documentation and binaries.

Thanks for all your help. Let me know if you find something else!
hero member
Activity: 924
Merit: 1000
Watch out for the "Neg-Rep-Dogie-Police".....
The git link to ixcoin is not for the latest version.

The latest ixcoin client is https://github.com/FrictionlessCoin/iXcoin

Notice also the capital "X" in iXcoin that is also used in the folder name - but not the daemon itself.

Peace (again)  Wink
full member
Activity: 196
Merit: 100
I would also include "strip *coind" (without the "'s) after compiling each coin daemon - this reduces the size of each *coind by a considerable amount. ie: strip bitcoind or strip namecoind, etc.

Peace  Smiley

Thanks for the tip!

Added to the guide and updated the binaries.

Note I don't compile bitcoind - I use the binaries from PPA Smiley

Indeed now the tar with the binaries is down to 7MB!
hero member
Activity: 924
Merit: 1000
Watch out for the "Neg-Rep-Dogie-Police".....
I would also include "strip *coind" (without the "'s) after compiling each coin daemon - this reduces the size of each *coind by a considerable amount. ie: strip bitcoind or strip namecoind, etc.

Peace  Smiley
full member
Activity: 196
Merit: 100
I added binaries and the config files so that you don't have to go through all the compilation process.

This makes installation much faster and easier.
full member
Activity: 196
Merit: 100
I updated the guide with i0coin.

Fusioncoin - there was some issue with the rpc ports - should be my fault with the config that i have to check
huntercoin - i get error at linking. will look into this as well [update: i see in huntercoin forums that others have issues compiling under 14.04 but there is no solution that I found yet. They say if you compile namecoin you are good to go. We apparently compile namecoin OK but doesn't work]
full member
Activity: 196
Merit: 100
Nice work Murdof - the old guide was in desperate need of updating - kudos  Smiley

Not sure if it's worth it, but maybe add HUC & FSC to the mix? Just in case users want that little bit extra......although HUC can be a bit of a resource hog.

Will update it with I0Coin and Fusioncoin. HUC never compiled it - never heard of it Tongue Will google and see what I find to add it as well.
Any other SHA256 coins that might be interesting?
hero member
Activity: 686
Merit: 500
WANTED: Active dev to fix & re-write p2pool in C
Nice work Murdof - the old guide was in desperate need of updating - kudos  Smiley

Not sure if it's worth it, but maybe add HUC & FSC to the mix? Just in case users want that little bit extra......although HUC can be a bit of a resource hog.
full member
Activity: 196
Merit: 100
START P2POOL AFTER BOOT:

So you have your pool up and running and you want to create a "batch" file to start everything after a reboot.
Then do this:
Code:
cat >~/start-p2pool
/usr/bin/bitcoind
/home/mine/bin/ixcoind
/home/mine/bin/namecoind
/home/mine/bin/devcoind
sleep 200
screen -d -m -S p2pool ~/p2pool/run_p2pool.py bitcoin h3wby4zWjGwywZ --merged http://ixcoin:[email protected]:8338/ --merged http://namecoin:[email protected]:7333 --merged http://devcoin:[email protected]:6333
[PRESS CTRL-D to exit]
Code:
chmod +x start-p2pool

When you want to start P2Pool after a reboot you just do:
Code:
~/start-p2pool
and you are good to go. Note there is a command that says "sleep 200". This means to wait 200 seconds before starting P2Pool. The reason for this is because it takes time to verify and sync the blockchain. Remember that during your reboot/downtime - transactions were going on and you are not up to sync. So depending on how fast your connection/server is you might have to adjust this value up or down.

If you want to setup automatic startup of P2Pool after a reboot do the following (after you have created the script above):
crontab -e -u (YOUR USER)
e.g.
Code:
crontab -e -u murdof
An editor will open. Add to the end the command:
@reboot /home/(YOUR USER)/start-p2pool
e.g.
Code:
@reboot /home/murdof/start-p2pool

LIST LOCAL WALLETS - VALUE:

Create a file called "listallcoins":
Code:
cat >~/listallcoins
echo BTC
/usr/bin/bitcoind -rpcpassword=h3wby4zWjGwywZ listaccounts
echo IXC
~/bin/ixcoind -rpcpassword=KouZ4RvmT3WkKZ listaccounts
echo NMC
~/bin/namecoind -rpcpassword=e9s4bmEaHvofEZ listaccounts
echo DVC
~/bin/devcoind -rpcpassword=KouZ4RvmT3WkKZ listaccounts
echo I0C
~/bin/i0coind -rpcpassword=KouZ4RvmT3WkKZ listaccounts
PRESS CTRL-D
Code:
chmod +x listallcoins
Make sure you replace the rpcpasswords if you have changed them and only list the coins you have.

ENABLE FIREWALL ON YOUR SERVER:
If you are running on a hosted linux system, there is usually no firewall so your server is open to the internet.
It is a good measure to lock down everything except the things we need. Credits to KyrosKrane:
Execute the following commands only once. The settings are saved and you don't need to execute them again. If you are running other services on the same server (e.g. http/ftp) make sure you enable those ports as well

Code:
# Set up and configure a firewall
# Note that we do NOT enable the RPC port for any coins!
sudo ufw default deny    # Deny everything unless expressly permitted
sudo ufw allow 22/tcp    # SSH
sudo ufw allow 8333/tcp  # bitcoin peer to peer
sudo ufw allow 8334/tcp  # namecoin peer to peer
sudo ufw allow 8337/tcp  # ixcoin peer to peer
sudo ufw allow 6334/tcp  # devcoin peer to peer
sudo ufw allow 7337/tcp  # i0coin peer to peer
sudo ufw allow 8492/tcp  # fusioncoin peer to peer
sudo ufw allow 9333/tcp  # P2pool peer to peer
sudo ufw allow 9332/tcp  # P2Pool connections and Web interface
sudo ufw --force enable  # Turn it on

Alternatively just do:
Code:
wget http://pool.nitro.gr/install-p2pool-firewall.sh
sudo sh ./install-p2pool-firewall.sh


List of ports used by coins for reference:

Coin / Listen Port / RPC Port
Bitcoin: 8333 / 8332
Devcoin: 6334 / 6333
Fusioncoin: 8492 / 18491
Huntercoin: 8398 / 8399
i0coin: 7337 / 7338
iXcoin: 8337 / 8338
namecoin: 8334 / 7333
full member
Activity: 196
Merit: 100
Updates:
17-May-2017: Updated guide for Ubuntu 16.04 LTS
15-June-2014: Fixed an error in the i0coin.conf included in p2pool-files.tar.gz
15-June-2014: Added instructions on automatic startup after reboot
15-June-2014: Added fusioncoin (for merge mining) and updated binaries
16-June-2014: Added Lazy guy's installation method
16-June-2014: Added namecoin.conf in p2pool-files.tar.gz and fixed start-p2pool
16-June-2014: Added rpcallowip=127.0.0.1 to all config files
21-June-2014: Added huntercoin to the guide
21-June-2014: Implemented a lot of suggestions from KyrosKrane. Addded a firewall script and reordered the commands for "lazy" installation method.
15-July-2014: Updated huntercoind and added bitcoin 0.9.2.1 in the binaries (I didn't compile it, I just used the 64-bit precompiled binary from bitcoin.org) as PPA has older version.
24-August-2014: Updated namecoind and huntercoind. Note that you might have to download blockchain of namecoin again after updating.
9-September-2014: Updated again namecoind and huntercoind to latest versions.

MAJOR UPDATE:
Please visit KyrosKrane page at: http://bitcoin.kyros.info/
He provides a more complete automated script.

If you still need to read all the details on how everything is done please read on!


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

Announcing: Lazy guy's installation method
So you are too bored to read all this?
This is too technical for you?
Do you want to have P2Pool up and running within 5 minutes with only 2 commands to execute?

After you install Linux Ubuntu 14.04 LTS, login and execute the following commands:
Code:
wget http://pool.nitro.gr/install-p2pool.sh
sudo sh ./install-p2pool.sh
sudo chown -R $(whoami):$(whoami) .*
sudo chown -R $(whoami):$(whoami) *
It will install everything (it will use the binaries not compile everything again) and you just have to wait...
Do a reboot and you are done.

Then jump to "END OF COMPILATION OF FILES"

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 NMC, DVC and IXC (in order to match GHash.io's offering).
Note that althought BTC mining is distributed among P2Pool miners, merged coins (e.g. NMC and IXC) 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 14.04 LTS Server from here: http://www.ubuntu.com/download/server
(note do not install Ubuntu DESKTOP 14.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 60GB (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 for Ubuntu and reboot your machine:
Code:
sudo apt-get dist-upgrade

Grab Bitcoin from repository and install it:
Code:
apt-get -y install software-properties-common aptitude
sudo add-apt-repository ppa:bitcoin/bitcoin
(Press ENTER to accept)
sudo apt-get update

Install the following prerequisites to build NMC,DVC and IXC plus to install the Bitcoin client:

Note - the following is one line and will download and install a lot of packages:
Code:
sudo aptitude install bitcoind python-software-properties screen git python-rrdtool python-pygame python-scipy python-twisted python-twisted-web python-imaging build-essential libglib2.0-dev libglibmm-2.4-dev libqt4-dev python-dev libssl-dev libdb5.1++-dev libboost1.55-all-dev dh-autoreconf libcurl4-openssl-dev libminiupnpc-dev ufw

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

For the next part I provide two solutions.
One solution is to compile everything on your own. In that case you need all the prerequisites above.
The other, easier and faster solution is to download the binaries compiled and as a bonus I have all the configuration files mentioned below.

So to grab the precompiled files just do:
Code:
cd ~
wget http://pool.nitro.gr/p2pool-files.tar.gz
tar xvzf p2pool-files.tar.gz

To verify that the file you have downloaded is correct do the following:
Code:
md5sum p2pool-files.tar.gz
You should get:
5f1826181effbd32bd24ce5cb2b713e6 p2pool-files.tar.gz

If all is good - then you can do "rm p2pool-files.tar.gz" to delete the package as everything is already extracted or hang on to it.

If you prefer to compile everything or see what I have included in the p2pool-files.tar.gz please read on:

START OF COMPILATION AND CREATION OF FILES:

Create a directory to install the binaries and the directories for each coin:
Code:
mkdir ~/bin
mkdir ~/.bitcoin
mkdir ~/.namecoin
mkdir ~/.ixcoin
mkdir ~/.devcoin

Grab Namecoin, compile it and copy it to the ~/bin directory:
Code:
cd ~
git clone https://github.com/namecoin/namecoin
cd ~/namecoin/src
make -f Makefile
strip namecoind
cp namecoind ~/bin

Grab IXC, compile it and copy it to the ~/bin directory:
Code:
cd ~
git clone https://github.com/FrictionlessCoin/iXcoin
cd ~/iXcoin/src
make -f makefile.unix
strip ixcoind
cp ixcoind ~/bin

Grab Devcoin, compile it and copy it to the ~/bin directory:
Code:
cd ~
git clone git://gitorious.org/devcoin/devcoin.git
cd ~/devcoin/src
make -f makefile.unix USE_PNP=1 devcoind
strip devcoind
cp devcoind ~/bin

Create the configuration files for each coin (bitcoin.conf,namecoin.conf,ixcoin.conf,devcoin.conf):
Note - copy/paste only the "cat" command, press enter - then copy paste the rest of the commands.
Code:
cat >~/.bitcoin/bitcoin.conf
server=1
daemon=1
rpcuser=bitcoin
rpcpassword=h3wby4zWjGwywZ
rpcallowip=127.0.0.1
Press CTRL-D

Code:
cat >~/.namecoin/namecoin.conf
server=1
daemon=1
rpcuser=namecoin
rpcpassword=e9s4bmEaHvofEZ
rpcport=7333
rpcallowip=127.0.0.1
Press CTRL-D

Code:
cat >~/.ixcoin/ixcoin.conf
server=1
daemon=1
rpcuser=ixcoin
rpcpassword=KouZ4RvmT3WkKZ
port=8337
rpcport=8338
rpcallowip=127.0.0.1
Press CTRL-D

Code:
cat >~/.devcoin/devcoin.conf
server=1
daemon=1
rpcuser=devcoin
rpcpassword=KouZ4RvmT3WkKZ
rpcport=6333
port=6334
rpcallowip=127.0.0.1
Press CTRL-D

END OF COMPILATION OF FILES

You are not ready to start P2Pool just yet. The BTC/NMC/DVC/IXC blockchain has to be downloaded first and it will take about 2 days.
So execute these commands and wait...

Code:
/usr/bin/bitcoind 
~/bin/ixcoind
~/bin/namecoind
~/bin/devcoind

Make sure that blockchain has finished downloading for all coins.
You can check that by going into .bitcoin/.namecoin/.ixcoin and do tail -f debug.log.
If you see downloading of old dates then you should wait before even starting P2Pool.

Run this command to start P2Pool:
Code:
screen -d -m -S p2pool ~/p2pool/run_p2pool.py bitcoin h3wby4zWjGwywZ --merged http://ixcoin:[email protected]:8338/ --merged http://namecoin:[email protected]:7333 --merged http://devcoin:[email protected]:6333 

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)

EXTRA COINS (already available in the precompiled files):

I0C - i0coin

Compile i0coin:
Code:
cd ~
git clone http://github.com/rsnel/i0coin/
cd i0coin/src
make -f makefile.unix i0coind
strip i0coind
cp i0coind ~/bin

Create i0coin configuration file:
Code:
mkdir ~/.i0coin
cat >~/.i0coin/i0coin.conf
server=1
daemon=1
rpcuser=i0coin
rpcpassword=KouZ4RvmT3WkKZ
port=7337
rpcport=7338
rpcallowip=127.0.0.1
Press Ctrl-D

Start ~/bin/i0coind and wait for the blockchain to download as well.
Add it to your startup script if needed and modify P2Pool startup to include it. Just append at the end of the p2pool command:
Code:
 --merged http://i0coin:[email protected]:7338
e.g.
Code:
screen -d -m -S p2pool ~/p2pool/run_p2pool.py bitcoin h3wby4zWjGwywZ --merged http://ixcoin:[email protected]:8338/ --merged http://namecoin:[email protected]:7333 --merged http://devcoin:[email protected]:6333 --merged http://i0coin:[email protected]:7338

FSC - Fusioncoin (NOT Friendshipcoin)

Don't confuse Fusioncoin with Friendshipcoin. Fusioncoin is SHA-256 while is Frinedshipcoin is Scrypt!

Compile fusioncoin:
Code:
cd ~
git clone https://github.com/fusioncoin/fusioncoin
cd ~/fusioncoin/src
make -f makefile.unix
strip fusioncoind
cp fusioncoind ~/bin

Create fusioncoin configuration file:
Code:
mkdir ~/.fusioncoin
cat >~/.fusioncoin/fusioncoin.conf
server=1
daemon=1
rpcuser=fusioncoin
rpcpassword=KouZ4RvmT3WkKZ
port=8492
rpcport=18491
rpcallowip=127.0.0.1
Press Ctrl-D

Start ~/bin/fusioncoin and wait for the blockchain to download as well.
Add it to your startup script if needed and modify P2Pool startup to include it. Just append at the end of the p2pool command:
Code:
--merged http://fusioncoin:[email protected]:18491
e.g.
Code:
screen -d -m -S p2pool ~/p2pool/run_p2pool.py bitcoin h3wby4zWjGwywZ --merged http://ixcoin:[email protected]:8338/ --merged http://namecoin:[email protected]:7333 --merged http://devcoin:[email protected]:6333 --merged http://i0coin:[email protected]:7338 --merged http://fusioncoin:[email protected]:18491

HUC - Huntercoin

Note that Huntercoin drains a lot of resources to sync. Syncing of the blockchain may also take a week before you can start merge mining it.
After syncing CPU/memory usage is normal.


Compile huntercoin:
Code:
cd ~
git clone https://github.com/chronokings/huntercoin
cd ~/huntercoin/src
make -f Makefile
strip huntercoind
cp huntercoind ~/bin

Create huntercoin configuration file:
Code:
mkdir ~/.huntercoin
cat >~/.huntercoin/huntercoin.conf
server=1
daemon=1
rpcuser=huntercoin
rpcpassword=KouZ4RvmT3WkKZ
port=8398
rpcport=8399
rpcallowip=127.0.0.1
Press Ctrl-D

Start ~/bin/huntercoin and wait for the blockchain to download as well.
Add it to your startup script if needed and modify P2Pool startup to include it. Just append at the end of the p2pool command:
Code:
--merged http://huntercoin:[email protected]:8399
Pages:
Jump to: