Title: How to start your own mining pool using bitcoind + eloipool. Post by: whitehathacker on March 02, 2014, 05:21:27 AM This was a struggle for me. So my struggle bears fruit for you!
Eloipool is a Python3 based pool server with stratum support. You can read more about it on Luke-Jr's post here: https://bitcointalk.org/index.php?topic=61731.0 I would like to thank Luke-Jr, jgarzik, and the folks at the following threads for helping me get this sucker rolling. https://bitcointalk.org/index.php?topic=61731.0;all https://bitcointalk.org/index.php?topic=158105.0;all This is example is being installed on Ubuntu (Precise). You may have to adjust the downloading of packages to fit your system. 1. Add the bitcoin repository to your sources and update (ubuntu) Code: add-apt-repository ppa:bitcoin/bitcoin Code: apt-get update 2. Install bitcoind Code: apt-get install bitcoind 3. Run bitcoind Code: bitcoind -daemon You should receive an error that says something like this: Code: lsError: To use the "-daemon" option, you must set a rpcpassword in the configuration file: 4. Edit your bitcoin.conf file (at ~/.bitcoin/bitcoin.conf) to read Code: server=1 5. Run bitcoind again Code: bitcoind -daemon If you check the log file ~/.bitcoin/debug.log you should see it start the block download. This syncs up with the network. This will take a long time so run this now and you can finish set up. If you want a better visual representation and your system has a desktop installed, install bitcoin-qt (apt-get intall bitcoin.qt). By leaving it up you can watch the progress bar at the bottom. 6. Make eloipool directory Pick a directory where you want to store eloipool. I used "/bitcoin". This is in the root directory and different than "~/.bitcoin" Code: mkdir /bitcoin 7. Install python 3.2 Code: apt-get install python3.2 python3.2-dev 8. Download python-bitcoinrpc Code: cd /bitcoin Make sure you check out an older commit due to bugs with the current commit: Code: cd python-bitcoinrpc Then go back to the main folder Code: cd ../../ 9. Download python-base58 Code: git clone git://gitorious.org/bitcoin/python-base58 10. Download and compile midstate This is the only one you will have to compile yourself. Code: git clone http://gitorious.org/midstate/midstate We have to edit midstate's Makefile to adhere to our system. Verify your python flags are correct first by running these two commands: Code: python3.2-config --ldflags The output of these should match the last entry in the CFLAGS line and LDFLAGS line. I edited mine from this: Code: CFLAGS = -march=native -Wall -funroll-all-loops -O3 -fstrict-aliasing -Wall -std=c99 -I/usr/include/python3.2 to this: Code: CFLAGS = -march=native -Wall -funroll-all-loops -O3 -fstrict-aliasing -Wall -std=c99 -I/usr/include/python3.2mu Then make Code: sudo make Then go back Code: cd ../ 11. Download eloipool Code: sudo git clone git://gitorious.org/bitcoin/eloipool.git 12. Edit config.py Copy the file "config.py.example" to "config.py" and edit it. Code: cp config.py.example config.py Change "TrackerAddr" to reflect the address of the local machine's bitcoin wallet. MAKE SURE YOU CHANGE THIS TO YOUR ADDRESS! Code: TrackerAddr = '14tpWuy3pMf8A1zMxysg3rrEhD3bpveXGC' If you are solo mining with a private pool, comment out the following line: Code: CoinbaserCmd = 'echo -e "1\\n$((%d / 100))\\n1579aXhdwvKZEMrAKoCZhzGuqMa8EonuXU"' Update Template Sources primary and comment out the secondary entry: Use the rpcuser and rpcpassword you listed in your ~/.bitcoin/bitcoin.conf file Code: TemplateSources = ( Comment out or delete all entrties in TemplateChecks Code: TemplateChecks = ( Change UpstreamBitcoindNode to: Code: UpstreamBitcoindNode = ('127.0.0.1', 8333) Change UpstreamNetworkId from testnet to main Code: UpstreamNetworkId = b'\xF9\xBE\xB4\xD9' Disable (comment) transaction-related but workaround: Code: #POT = 2 Unless you want to use SQL for sharelogging, comment out all but the entry with type 'logfile'. In order to use MySQL, you must install PyMySql. Code: ShareLogging = ( For your LogFile setting, I recommend changing the backup count depending on your preferences. It backs up every midnight, and the number reflects how many backups to keep (the oldest being deleted). 13. Create scripts Go to your "/bitcoin" directory and create a file called "run-bitcoind.sh" and enter the following. NOTE: your paths may be different depending on where you chose your directory. For this example I used my /bitcoin one. Code: #!/bin/sh Now create the file "newblock.sh" and enter this VERBATIM: Code: #!/bin/sh Now change directory into your "eloipool" folder (for me it was /bitcoin/eloipool) and create this script called run-eloipool.sh. Again, your directories may be different, but leave "./eloipool" as is: Code: #!/bin/bash Make sure all the scripts are executable by issuing these commands: Code: chmod 0755 /bitcoin/run-bitcoind.sh 14. Run! Bitcoind/bitcoin-qt MUST BE FULLY SYNC'd TO THE NETWORK. Make sure you're firewalls and port forwarding allows port 3334 on TCP. For a better connection to the bitcoin network, allow 8333 in as well (such as you notice only 8 connections max when synchronizing) Make sure all related processes are not running. I added the scripts and eloipool in case you tried a different setup first: Code: killall bitcoind Run bitcoind from the script. Code: ./run-bitcoind.sh Wait a little bit for bitcoind to start up. Then run eloipool from the script. Code: ./run-eloipool.sh To verify that both processes are running, run the following commands. They should return with a PID and the name of the process. Such as: Code: ps -e | grep bitcoin should return something like: Code: 26762 ? 03:27:37 bitcoind Code: ps -e | grep eloipool.py should return something like: Code: 26788 ? 03:30:00 eloipool.py 15. Check connection Now test your connecton by pointing your miner at your server with the settings: user: YourBitcoinAddress pass: x (this doesnt matter, it is ignored with the allow all setting in config.py) address: stratum+tcp://IpAddressOrDomainName:3334 An example for bfgminer: Code: bfgminer.exe --userpass 134dV6U7gQ6wCFbfHUz2CMh6Dth72oGpgH:snoogins --url stratum+tcp://192.168.0.22:3334 Port 3334 is the port used for the Stratum Protocol. Known Errors: ----- If you have an error such as: Code: 2013-05-12 23:08:19,014 merkleMaker CRITICAL Traceback (most recent call last): A known fix is to change the line in python-bitcoinrpc/bitcoinrpc/authproxy.py somewhere around line 72 Code: self.__auth_header = "Basic %s" % base64.b64encode(authpair) to read: Code: self.__auth_header = "Basic %s" % base64.b64encode(authpair).decode() An error reading: Code: TypeError: _stratum_mining_subscribe() takes exactly 1 positional argument ( Can be resolved by editing eloipool/stratumserver.py around lines 106-107 from Code: if not hasattr(e, 'StratumQuiet'): to read: Code: if not hasattr(e, 'StratumQuiet'): Using MySql to log from Eloipool This one took me a little bit. Change directory to this location: Code: cd /usr/local/lib/python3.2/dist-packages/PyMySQL3-0.5-py3.2.egg/pymysql/ Locate the lines that look like this: (they should be together) Code: def unpack_int24(n): Delete them all and in their place put this: Code: def unpack_int24(n): Save and quit. Make sure your database configurations are correct in your correct in your config.py and now you are logging to MySQL. ---------------------------------------------------------------- If you have any questions please post them below. If I don't have the answer hopefully somebody will. If you see any errors in my guide that I dont see please let me know and I will fix it. If you liked this guide, feel free to tip/donate me for my time. bitcoin:1Nnb5S3z8kPMiiej9fUnvRqHorwb5C5mzq (bitcoin:1Nnb5S3z8kPMiiej9fUnvRqHorwb5C5mzq) Title: Re: How to start your own mining pool using bitcoind + eloipool. Post by: vmfx on March 20, 2014, 05:22:31 AM Awesome guide, will be trying this out now!!! What version of ubuntu are you running here ?
Sorry - just caught it - Precise 12 :) Title: Re: How to start your own mining pool using bitcoind + eloipool. Post by: softron on March 23, 2014, 10:55:17 AM Great work, + bookmark for later use.
Thanks Title: Re: How to start your own mining pool using bitcoind + eloipool. Post by: Elerntta on March 23, 2014, 02:58:19 PM Thanks a lot for this guide! I am going to try to create my own pool and wish it would be succesful a least now I know main points of creating it
Title: Re: How to start your own mining pool using bitcoind + eloipool. Post by: 7queue on May 13, 2014, 12:35:03 AM At one point I had this working...
With a fresh install of Ubuntu 12.04.4 LTS (GNU/Linux 3.8.0-39-generic x86_64) Python 3.2 bitcoin-0.9.1 on testnet Code: git clone https://github.com/jgarzik/python-bitcoinrpc python-bitcoinrpc Code: git clone https://github.com/jgarzik/python-bitcoinrpc python-bitcoinrpc-solo Code: diff ./python-bitcoinrpc/bitcoinrpc/authproxy.py ./python-bitcoinrpc-solo/bitcoinrpc/authproxy.py I see no difference ?? is that branch still available? Get this in the log file Code: ../eloipool/stratumserver.py", line 63, in found_terminator With bfgminer-master it starts at diff 15 then goes to diff 0 with nothing but stale shares. Ubuntu 14.04 LTS & Python 3.4 is a no go. 8 ) Title: Re: How to start your own mining pool using bitcoind + eloipool. Post by: BitCoinDream on June 18, 2014, 09:16:41 PM As it is python based, can it be implemented on Google app engine ?
Title: Re: How to start your own mining pool using bitcoind + eloipool. Post by: bgibso01 on June 19, 2014, 09:22:38 PM This guide has helped me the most at getting my solo pool up and running. My only problem is not being about to get the pool to use var diff. All of my miners return diff 1 shares.
In my config.py I've got ShareTarget = 0x000000000ff......... DynamicTargetGoal = 6 DynamicTargetWindow = 120 Am I missing another setting somewhere? Title: Re: How to start your own mining pool using bitcoind + eloipool. Post by: Luke-Jr on June 19, 2014, 09:28:18 PM This guide has helped me the most at getting my solo pool up and running. My only problem is not being about to get the pool to use var diff. All of my miners return diff 1 shares. I don't think you enabled it?In my config.py I've got ShareTarget = 0x000000000ff......... DynamicTargetGoal = 6 DynamicTargetWindow = 120 Am I missing another setting somewhere? Title: Re: How to start your own mining pool using bitcoind + eloipool. Post by: bgibso01 on June 19, 2014, 10:06:46 PM This guide has helped me the most at getting my solo pool up and running. My only problem is not being about to get the pool to use var diff. All of my miners return diff 1 shares. I don't think you enabled it?In my config.py I've got ShareTarget = 0x000000000ff......... DynamicTargetGoal = 6 DynamicTargetWindow = 120 Am I missing another setting somewhere? Thanks Luke-Jr. I have tried DynamicTargetting=1 and 2. Neither seem to make a difference. Is it a typo for "Targetting"? DynamicTargetting=2 Never mind. Found the problem. Was using master that didn't have the var diff files. Title: Re: How to start your own mining pool using bitcoind + eloipool. Post by: bgibso01 on June 26, 2014, 01:20:50 AM Has anyone got this working with Ubuntu 14.04? I made the mistake of doing a fresh install with updates instead of 12.10. I figure either 14 doesn't work with it or I've got something screwed up again. At least I'm getting some practice. It's been a long time since I used a terminal for very long.
Title: Re: How to start your own mining pool using bitcoind + eloipool. Post by: pjcltd on June 26, 2014, 10:08:53 AM Has anyone got this working with Ubuntu 14.04? I made the mistake of doing a fresh install with updates instead of 12.10. I figure either 14 doesn't work with it or I've got something screwed up again. At least I'm getting some practice. It's been a long time since I used a terminal for very long. Hi i use nomp on 14.04 work fine no problems at all Title: Re: How to start your own mining pool using bitcoind + eloipool. Post by: cheeha on August 11, 2014, 11:03:00 AM I get the error "jsonrpc_getwork WARNING Error importing 'midstate' module; work will not provide midstates".
I found someone else came across the same error on https://bitcointa.lk/threads/avalon-users-bitcoind-eloipool-configuration.93173/page-3 (https://bitcointa.lk/threads/avalon-users-bitcoind-eloipool-configuration.93173/page-3) but they don't say they fixed it. Any ideas? Posted from Bitcointa.lk - #aX5f29tbI3UolmyL Title: Re: How to start your own mining pool using bitcoind + eloipool. Post by: 7queue on August 14, 2014, 06:08:36 PM Has anyone got this working with Ubuntu 14.04? I made the mistake of doing a fresh install with updates instead of 12.10. I figure either 14 doesn't work with it or I've got something screwed up again. At least I'm getting some practice. It's been a long time since I used a terminal for very long. What version of Python are you using? I ran into this when I went to 14.04 https://bitcointalk.org/index.php?topic=61731.msg6735551#msg6735551 8 ) Title: Re: How to start your own mining pool using bitcoind + eloipool. Post by: NginUS on September 27, 2015, 06:46:00 AM My bitcoind & eloipool are running, but when I do this:
<code>C:/Progra~1/bfgminer-5.3.0-win64/bfgminer.exe --userpass 1DPLoA65tQmkA9RBqgYXuwbFvfbhF24Sjr:password --url stratum+tcp://173.246.106.141:3334,</code> I get this error: <code>No servers could be used! Exiting.</code> What do I have to do to fix it? Title: Re: How to start your own mining pool using bitcoind + eloipool. Post by: jmintuck02 on September 29, 2015, 06:09:12 PM My bitcoind & eloipool are running, but when I do this: <code>C:/Progra~1/bfgminer-5.3.0-win64/bfgminer.exe --userpass 1DPLoA65tQmkA9RBqgYXuwbFvfbhF24Sjr:password --url stratum+tcp://173.246.106.141:3334,</code> I get this error: <code>No servers could be used! Exiting.</code> What do I have to do to fix it? What worked for me was C:/Progra~1/bfgminer-5.3.0-win64/bfgminer.exe --url stratum+tcp://173.246.106.141:3334 --userpass 1DPLoA65tQmkA9RBqgYXuwbFvfbhF24Sjr:password ? That is how I configure my miner bat file. I put the Stratum FIRST, you had it the wrong way, methinks. Title: Re: How to start your own mining pool using bitcoind + eloipool. Post by: whitehathacker on November 08, 2016, 04:58:41 AM So... funny thing...
I start looking into starting up a pool again. So I come across this thread thinking "oh good, step by step". Then I realize, oh $#!t ... I WROTE THIS. I'm happy that this is helping people still, I'm working on getting mine back up and running on 16.04.1 LTS and have found a couple of things in the guide that could be improved on. Currently re-syncing my blockchain. |