Show Posts
|
Pages: [1]
|
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.
|
|
|
Have just finished installing and setting up. Managed to get through everything reasonably well. Started mining via the testnet to confirm all is functioning only to get this error below 2014-03-08 04:54:38,424 merkleMaker INFO New block: 00000000a7b45a26837f6e134f3fc00cc042dd7a73edafedca1cdfd20301f8a8 (height: 203771; bits: 1b180ab0) 2014-03-08 04:54:38,448 JSONRPCServer INFO Waiting 15 seconds to longpoll 2014-03-08 04:54:42,694 JSONRPCServer INFO Ignoring longpoll attempt while another is waiting 2014-03-08 04:54:53,409 JSONRPCServer INFO Nobody to longpoll 2014-03-08 05:05:27,233 checkShare INFO BLKHASH: d739a915e14c3f70fde09220df14cef8097493ab8fa607783a767 2014-03-08 05:05:27,235 checkShare INFO TARGET: 180ab0000000000000000000000000000000000000000000000000 2014-03-08 05:05:27,235 checkShare INFO Submitting upstream 2014-03-08 05:05:27,237 checkShare INFO Real block payload: 02000000a8f80103d2df1ccaedafed737add42c00cc03f4f136e7f83265ab4a700000000857ab5db6004b9c70749b35841980b1877360390f9f7740b700d1593a6e63f724f181a53b00a181b03b8f8cc1101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff1103fb1b0304531a184f00000000c4010000ffffffff01f03b082a010000001976a91438ac799ceb934fec797fd7e8800661f5ab4bb7dd88ac000000000100000001f1b08e8ecc8bbb8363fd5c93b9c5ef63fa6b4a7daddb825d299dca400a269b07010000006b48304502200588fd6d120996b24cf61a052e8f489d2b806ace58c0a34ccaa2478c15657448022100fcdc87610b35bda8636e6197453c5418124bc948eeca5fc00afd7be8bbb9f9a1012102de1ac163350aac805928a479222242c01a963fa7b7dce662d3569221da9e1089ffffffff0200b33f71000000001976a9147d1209604fe6df84381948c41abcced208cd261088ac00e1f505000000001976a9146842cba8d7cee7c2fde067757c425eb4ca88982588ac000000000100000001c91cc4c73021007656b60d98130900b8ed7ec94a4fe8a56986fac318586a7033000000006b483045022100b95a362f417c67f4764d78a65e94cf6a6568e7b163b4f6ae09b1f07bc9bfdcf702206a60c99040f8714f23c9dd1cb776661a1b948fd94243e65426aa510004c35e62012103c716e13e73bcdbbf79b49a878425e755d0f65a67cbe4da00e1ccb6ec655582b8ffffffff0200e1f505000000001976a9143d4777c79d2495a608dbb20d0a942850c6695ad088ac8034010e000000001976a91496c1f972a3fdc6a51758b40c11281c2f5b32cc8b88ac000000000100000001d24fa4e2460e91e1d5996f31c2371fc18b19a67cf5635e61656f06e3b5956483010000006b483045022100e58806ddac889472558212ff5935a75673c62b5888a47b6b2538f427b488eeef022003b3114c94b1442d8719e23d194321d6f5135fc3ed87779370a1969c6c1c795e01210229e89b67ba82311e51f80ded9455d5a8fd4011cc8fbc085254a170dccae1f231ffffffff0200e1f505000000001976a9140ac5623d29bf4d551399f0717a82beec138a924e88ace016cd1d000000001976a914ca415b2cf503b0675c4d91844d36575c0d79992e88ac000000000100000001e16b56ba1559100351a98397aedfbae39c5b3833a00d2130f11abe4f2693d32f020000006b48304502203f2283f2a0ece89d00ead3a3860375ffd8ad597b85116ddaaf7bcf6c76529fa0022100b4d14f5701eacc1d78dda17130f110138b58ad715eee4e664675e89f0c9c496a01210322a9e92b2eaab7eb3c7b3e2f0efbc532ade9128963d46d3894c2fe801e05a152ffffffff037064080000000000232103a3dbfcaf0bda0fd6697890fb599cf7c111b96fa485e3d37ecf8b2f6ddcba97c2ac4c443201000000004752210322a9e92b2eaab7eb3c7b3e2f0efbc532ade9128963d46d3894c2fe801e05a1522103a3dbfcaf0bda0fd6697890fb599cf7c111b96fa485e3d37ecf8b2f6ddcba97c252ae621d7209000000001976a914d4c23edec54815eb9a3414385d32bf5b40aaf2ec88ac0000000001000000012ffd1b139f52cb35aa49724544515a3c4d49603a13f19631dddce09b84cec3df010000006b483045022100be70b1754b8673baea7c6fbb86f3be37872c60d49938d3a93efcae5ac5491d3f02201299064e9d60d7fc164e724e83d80a0f79bdb556c51ba746960b4e1af42e98aa012102c7a7662e89aec9dc452958d12c7fe86a5a9ef28ae2c9f6674eda7e610368bb6affffffff0200e1f505000000001976a9148beb2ecf4cf7e3acacd6d883ba8f3bd83d250e8d88ace0f7c223000000001976a9141f592a9185960b5c16f2821c08b0626ada6b058e88ac00000000010000000130e494352411e1852269c51f58edb6dadbfb88a085444ab3a5967c8d5b862ce5010000006a47304402203dc97a0728c1b60c8fa3bd3b26ed72de52c4864538141ec2f1dc37d4019cb8c002204bd41119b7631b022ac006f7524209c05268ee06e57fd7f247b772f322058e260121026de0e2c7e111ee6324066dc1e00a5b4b19c1d0d305d1b4407099f563b0708343ffffffff0200c2eb0b000000001976a914805d2cd148ff6813f9e21ab00a34a776e5b538ac88ac50b6520b000000001976a914178d76374321d56d5aeb9e3bab9a4364ff69de5488ac000000000100000001187c89f6e245ccb3736546bc09fb5258d924248eb0cbd0555cdde361dccbbf66000000006b4830450220614b5726cbf638bc13802aeb07ca6199b995422d3655e9f5f650b6accfa2a37e022100b219f6d912ff0f85c42d8532c5c5fdfed8228f542caa0e5f649da085911216a0012103eb0753af316368bded5edbf2316500a84318c12af2ee895067992d0aa87f2d1dffffffff0200e1f505000000001976a9146842cba8d7cee7c2fde067757c425eb4ca88982588ac7004530b000000001976a91465b8cae9acd8147606b6bb2d023ce68b741fdfdf88ac00000000010000000195da535ed8166e0e7cc9a88395cafbdcc57cf15d01aa58d5a4a21264a01be44d000000006b483045022100ca52d7ba237e165a8f318d240adce191e962e3b6c291ff818b2a1b42e47aed43022023b5e2b7f2cc1ee34f74c0809508d24c0373a78b34cc9d1b8ead049eb19b0162012102fc3f059e1153c11682268e339cfd0f4d531d7d2f9dd03defb141af4a9efc2626ffffffff02ce411300000000001976a914cecc896859245c49392ff24f58b4f77045529f2e88aca0860100000000001976a9149b3047b8596b0698feee5ac08f5c84f43df991a088ac000000000100000001d711bd5aa29b462367f78abd25c8fdcf7bc15932b41809199dd23f9df121a9aa000000006b48304502203e591160db14cf1d4add95bb9c346c16271a88381a27a9bbfcc2d73fa23d4e6c02210082126d55a552305221845fb692fa8e35277fe1bf90afd124434126f4299c4ae80121023047c17b363f969adfc3e16fc4927db40c3bbe07d97f0e53d1ff4d4f7e851b4affffffff02f0aa496b000000001976a914a1759feef65cbc92a6af1ef0d1e97b361e2e296488ac00e1f505000000001976a9146842cba8d7cee7c2fde067757c425eb4ca88982588ac000000000100000001614918e7ad92615b1a1c8697c11bec6c048b69b77255560a76fbeb3621daf33a010000006c493046022100f10b4bedc681b3c71845f99a10c79737ed285ea356bbf566d355bcddbbb2ee99022100a7a2f7b5cda232d85317c4ae7f3be00d384673376f46165e973354379df7db9a01210250f33d42507054f1ae91d5720725c4172c4892dab944916ba1cc7c1324002d56ffffffff0260fc5c05000000001976a914139509416a0c7d84554864f607e50f290c7fe6fc88ac00e1f505000000001976a9146842cba8d7cee7c2fde067757c425eb4ca88982588ac000000000100000001ace0e0e9f08c7ae9b318867d09fcd02667b65337f49277756824527484b7ecd1020000006b48304502204e05085e1a40251a74543a29fba945bd4d51ae422ad4f8af9282a89a3bf985ac022100845773e6431f28993cb1cfe6198da0db34a2ce86e6431d2bddeb529e8496196a0121038ec2a9148c7b846a34bc2927192d1cfd9e4cf3cc99c05bb5a8408664f35eed37ffffffff029e4000000000000023210322a9e92b2eaab7eb3c7b3e2f0efbc532ade9128963d46d3894c2fe801e05a152acd257f731000000001976a914544cff8187868bc439c2a5470331295c41bde0c488ac000000000100000001dee5e4040358ac27d6f233becc86b0bd597c78f95a0a1a9065aa3d3dd8019c6d010000006a4730440220614aaf9e65e3a111425d2e24d152449b64b75cbea1f7ff34e62928e9f55d09b202201be0bb53714b2c6d38bc368e4fe925c3b167caac8a55ddce3dfa77aa807502090121038ec2a9148c7b846a34bc2927192d1cfd9e4cf3cc99c05bb5a8408664f35eed37ffffffff02175600000000000023210322a9e92b2eaab7eb3c7b3e2f0efbc532ade9128963d46d3894c2fe801e05a152acabdaf631000000001976a914544cff8187868bc439c2a5470331295c41bde0c488ac000000000100000001074500659ebde6106fa14e175ef79093ed4c03148e3db0a72b19df9bda4de991020000006b48304502210092356efb5bf022205307d44115f84de62791cb8a6260a0d1c332e082560aff42022069cff759799c91c524bd315a786c126db09110644faf7ee03e4280ac5d2c047b0121038ec2a9148c7b846a34bc2927192d1cfd9e4cf3cc99c05bb5a8408664f35eed37ffffffff037064080000000000232103a3dbfcaf0bda0fd6697890fb599cf7c111b96fa485e3d37ecf8b2f6ddcba97c2ac4c44320100000000475221038ec2a9148c7b846a34bc2927192d1cfd9e4cf3cc99c05bb5a8408664f35eed372103a3dbfcaf0bda0fd6697890fb599cf7c111b96fa485e3d37ecf8b2f6ddcba97c252ae2d9b2b30000000001976a914544cff8187868bc439c2a5470331295c41bde0c488ac00000000010000000297ef87f5a4935dcca177e259b791de83677f1e7bf5a780719967a1106c785ace010000006b4830450221009ab6bc5935a978d7bc8f348bd6e8d26236071873f4fe14676e0681551ca845fc022067cfe975ce3b999cfd601283fe5c76b5dadec38e2a73f9e39d40b4ca75b6facb012103250024ec1bed8a47f0ef01b213aab498214c15d269d4ef36e37e1292a69609c1ffffffff9aa0f65e764d95528c862ca06649e84dbda5a0c55b0250158722c9b8155a4a55000000006a47304402204d32f55f96596660de7741c99ace5fa0a52bd70e4c1c8c39e4cd455e2adf67ee02205f1283550d44073ab9a703ec7a70306d37d091f69deb09fc1907464fc1aa0f07012103f1fe05d77885a3fb5d82823b9d86f24c297c846f397def3a6703758a12f11165ffffffff02608f8f03000000001976a914b06862dc95b700394657b45e5446d8bb515fccca88ac00e1f505000000001976a9146842cba8d7cee7c2fde067757c425eb4ca88982588ac0000000001000000016ad55da2d39e7da6b1e9c93339757e90c4221cdf662c5aed7c1de6801524d07b000000006b483045022100a65ffa9efd91b6570cb612eee1e0ba52a78ec8f99bac9a6d1afe5a34ec42caf7022069d66cd72342128a7a758f53e25bb76a0383feae5e0b55e6cafa1fc188b9ac2c0121021d12b8d583fb91efab50d92a3d47afe0a03023a76a19f1cc35bf990a7e16fbeaffffffff0280969800000000001976a9146842cba8d7cee7c2fde067757c425eb4ca88982588acd0d1f602000000001976a914ff55d0602c91c22a53c1a8f7b2953ee8d296f5c588ac000000000100000001ba970c27b1e275f19fd86a57fb2c2dc272c1bf6d9fa70a196c65c9b5d4688fac010000006c49304602210090efccb95f12b108b4c638c5301e2ae397807c50f9bce0daa2ea1b03b0d82339022100bf22af5521ad4c28d35ebbe82dcb81a0b696ab2d81e7e18bdd0492d7668f2de3012102da0f244f273886608401b7cb44548102f9a76dd1812d909c6364778ec1f16df4ffffffff0240145e02000000001976a9146c7b52824fd27501fae1779046afc9f58ac8773588ac80969800000000001976a9146842cba8d7cee7c2fde067757c425eb4ca88982588ac00000000 2014-03-08 05:05:27,240 merkleMaker INFO New block: 00000000000d739a915e14c3f70fde09220df14cef8097493ab8fa607783a767 (height: 203772; bits: 1b180ab0) 2014-03-08 05:05:27,249 JSONRPCServer INFO Nobody to longpoll 2014-03-08 05:05:27,251 Waker for BitcoinNode DEBUG Read wakeup 2014-03-08 05:05:27,258 BitcoinNode INFO Sent `block' to 1 nodes 2014-03-08 05:05:27,272 blockSubmission DEBUG Upstream 'primary' accepted block 2014-03-08 05:05:27,322 newBlockNotification INFO Received new block notification 2014-03-08 05:05:28,083 redflag CRITICAL Traceback (most recent call last): File "/usr/lib/python3.2/json/decoder.py", line 367, in raw_decode obj, end = self.scan_once(s, idx) StopIteration
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "./eloipool.py", line 382, in blockSubmissionThread reason = UpstreamBitcoindJSONRPC.submitblock(payload) File "/bitcoin/python-bitcoinrpc/bitcoinrpc/authproxy.py", line 114, in __call__ response = self._get_response() File "/bitcoin/python-bitcoinrpc/bitcoinrpc/authproxy.py", line 140, in _get_response parse_float=decimal.Decimal) File "/usr/lib/python3.2/json/__init__.py", line 322, in loads return cls(**kw).decode(s) File "/usr/lib/python3.2/json/decoder.py", line 351, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python3.2/json/decoder.py", line 369, in raw_decode raise ValueError("No JSON object could be decoded") ValueError: No JSON object could be decoded Found the answer (I thought) over here on this awesome post... https://bitcointalk.org/index.php?topic=495542.0being 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() Unfortunately, and not knowing how to code at all(Close friend who does do a lot of coding and away overseas at the moment) has actually banned me form coding, apparently I am "a menace to all society if I attempt to code")
The closest line to the answer above is self.__auth_header = b'Basic ' + base64.b64encode(authpair) I added the ".decode" as instructed above to this self.__auth_header = b'Basic ' + base64.b64encode(authpair).decode But this prevents the miner form connecting or finding the pool at all. I have spent hours on this, and have exhausted my frustration.. Could anyone assist with this. Cheers You have to add the () to the end of decode. In programing, parentheses "()" is where you put the input for a function or identifies a function. Because the "decode" is a function, it requires that parentheses at the end. I'm overseas right now as well, but the magic of the internet allows such collaboration :-) ~WHH
|
|
|
I can't comment on the error, I've never seen it. As for the calculation of speed (in php even): $shares = 200; //Number of shares of a given time. $timeLen = 10; //The given time in seconds.
$hashrate = pow(2, 32) * $shares / $timeLen; //85899345920 $hashrate = $hashrate / 1000000000; //85.899345920 $hashrate = round($hashrate, 2); //85.9
returns 85.9 which is 85.9 Gh/s 1000000000 could be changed to: 1000000000000 for Th/s 1000000 for Mh/s 1000 for Kh/s However if using VarDiff you need to modify your DB and config.py to log the Minimum difficulty of each share a 2 diff share = 2 shares, 32 diff = 32 shares. Or you can join my pool... just saying. NoctumDesignThats awesome, I appreciate that. How are you pulling shares per time length though? I understand grabbing a specific item in a column in a table, but over a specific time frame? Are you doing a comparison with the time column? EDIT: Here's a new one for you: 42014-03-04 00:02:36,648 sharelogging.logfile CRITICAL Traceback (most recent call last): File "/eloipool/sharelogging/logfile.py", line 54, in run self.flushlog() File "/eloipool/sharelogging/logfile.py", line 46, in flushlog with open(self.fn, "a") as logfile: IOError: [Errno 2] No such file or directory: 'share-logfile'
|
|
|
Every now and then I see this in the log: 2014-03-03 01:53:05,041 StratumHandler DEBUG Traceback (most recent call last): File "/eloipool/networkserver.py", line 47, in handle_read data = self.recv (self.ac_in_buffer_size) File "/usr/lib/python3.2/asyncore.py", line 384, in recv data = self.socket.recv(buffer_size) socket.error: [Errno 113] No route to host
Or this: 2014-03-02 06:07:20,231 StratumHandler DEBUG Traceback (most recent call last): File "/eloipool/networkserver.py", line 47, in handle_read data = self.recv (self.ac_in_buffer_size) File "/usr/lib/python3.2/asyncore.py", line 384, in recv data = self.socket.recv(buffer_size) socket.error: [Errno 110] Connection timed out
Is this normal? Also, how are you guys calculating hashrates? The sharelog isnt providing much information in terms of hashrates. Should we be deducing this from the "shares" table and "time" column? If so, how are you doing this (in PHP if possible, if not thats fine)?
|
|
|
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.0I 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;allhttps://bitcointalk.org/index.php?topic=158105.0;allThis 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) add-apt-repository ppa:bitcoin/bitcoin
2. Install bitcoind 3. Run bitcoind You should receive an error that says something like this: lsError: To use the "-daemon" option, you must set a rpcpassword in the configuration file: /home/user/.bitcoin/bitcoin.conf It is recommended you use the following random password: rpcuser=bitcoinrpc rpcpassword=*password redacted* <----This password is randomly generated by bitcoind (you do not need to remember this password) The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; for example: alertnotify=echo %s | mail -s "Bitcoin Alert" admin@foo.com
4. Edit your bitcoin.conf file (at ~/.bitcoin/bitcoin.conf) to read server=1 rpcuser=bitcoinrpc rpcpassword=*the password in the error above* rpcallowip=127.0.0.1 logtimestamps=1
5. Run bitcoind again 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" 7. Install python 3.2 apt-get install python3.2 python3.2-dev
8. Download python-bitcoinrpc cd /bitcoin git clone https://github.com/jgarzik/python-bitcoinrpc
Make sure you check out an older commit due to bugs with the current commit: cd python-bitcoinrpc git checkout -b 770881c8bd9b1f92427290270b37a28751cf9df0
Then go back to the main folder 9. Download python-base58 git clone git://gitorious.org/bitcoin/python-base58
10. Download and compile midstate This is the only one you will have to compile yourself. git clone http://gitorious.org/midstate/midstate cd 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: python3.2-config --ldflags python3.2-config --cflags
The output of these should match the last entry in the CFLAGS line and LDFLAGS line. I edited mine from this: CFLAGS = -march=native -Wall -funroll-all-loops -O3 -fstrict-aliasing -Wall -std=c99 -I/usr/include/python3.2 LDFLAGS = -Wl,-O1 -Wl,--as-needed -lpython3.2
to this: CFLAGS = -march=native -Wall -funroll-all-loops -O3 -fstrict-aliasing -Wall -std=c99 -I/usr/include/python3.2mu LDFLAGS = -Wl,-O1 -Wl,--as-needed -lpython3.2mu
Then make Then go back 11. Download eloipool sudo git clone git://gitorious.org/bitcoin/eloipool.git cd eloipool
12. Edit config.py Copy the file "config.py.example" to "config.py" and edit it. 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! TrackerAddr = '14tpWuy3pMf8A1zMxysg3rrEhD3bpveXGC'
If you are solo mining with a private pool, comment out the following line: 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 TemplateSources = ( { 'name': 'primary', 'uri': 'http://rpcuser:rpcpass@localhost:8332' 'priority': 0, 'weight': 1, } )
Comment out or delete all entrties in TemplateChecks Change UpstreamBitcoindNode to: UpstreamBitcoindNode = ('127.0.0.1', 8333)
Change UpstreamNetworkId from testnet to main UpstreamNetworkId = b'\xF9\xBE\xB4\xD9'
Disable (comment) transaction-related but workaround: 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. ShareLogging = ( { 'type': 'logfile', 'filename': 'share-logfile', 'format': "{time} {Q(remoteHost)} {username} {YN(not(rejectReason))} {dash(YN(upstreamResult))} {dash(rejectReason)} {solution}\n", }, )
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. #!/bin/sh /usr/bin/bitcoind -daemon -blocknotify=/bitcoin/newblock.sh
Now create the file "newblock.sh" and enter this VERBATIM: #!/bin/sh
killall -USR1 eloipool.py
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: #!/bin/bash
PYTHONPATH=/bitcoin/python-bitcoinrpc:/bitcoin/python-base58:/bitcoin/midstate \ nohup ./eloipool.py 2>&1 >/dev/null &
Make sure all the scripts are executable by issuing these commands: chmod 0755 /bitcoin/run-bitcoind.sh chmod 0755 /bitcoin/newblock.sh chmod 0755 /bitcoin/eloipool/run-eloipool.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: killall bitcoind killall run-bitcoind.sh killall eloipool.py
Run bitcoind from the script. Wait a little bit for bitcoind to start up. Then run eloipool from the script. 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: should return something like: 26762 ? 03:27:37 bitcoind
should return something like: 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: 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: 2013-05-12 23:08:19,014 merkleMaker CRITICAL Traceback (most recent call last): File "/usr/local/lib/python3.2/json/decoder.py", line 361, in raw_decode obj, end = self.scan_once(s, idx) StopIteration
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/home/eloipool/merklemaker.py", line 692, in run self.merkleMaker_I() File "/home/eloipool/merklemaker.py", line 682, in merkleMaker_I self.merkleMaker_II() File "/home/eloipool/merklemaker.py", line 648, in merkleMaker_II return self._updateMerkleTree() File "/home/eloipool/merklemaker.py", line 548, in _updateMerkleTree self._updateMerkleTree_I() File "/home/eloipool/merklemaker.py", line 512, in _updateMerkleTree_I r = self._updateMerkleTree_fromTS(TS) File "/home/eloipool/merklemaker.py", line 477, in _updateMerkleTree_fromTS MP = self._CallGBT(TS) File "/home/eloipool/merklemaker.py", line 327, in _CallGBT MP = access.getblocktemplate(self.GBTReq) File "/usr/local/lib/python3.2/site-packages/bitcoinrpc/authproxy.py", line 102, in __call__ response = self._get_response() File "/usr/local/lib/python3.2/site-packages/bitcoinrpc/authproxy.py", line 128, in _get_response parse_float=decimal.Decimal) File "/usr/local/lib/python3.2/json/__init__.py", line 320, in loads return cls(**kw).decode(s) File "/usr/local/lib/python3.2/json/decoder.py", line 345, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/local/lib/python3.2/json/decoder.py", line 363, in raw_decode raise ValueError("No JSON object could be decoded") ValueError: No JSON object could be decoded
A known fix is to change the line in python-bitcoinrpc/bitcoinrpc/authproxy.py somewhere around line 72 self.__auth_header = "Basic %s" % base64.b64encode(authpair)
to read: self.__auth_header = "Basic %s" % base64.b64encode(authpair).decode()
---------- An error reading: TypeError: _stratum_mining_subscribe() takes exactly 1 positional argument (
Can be resolved by editing eloipool/stratumserver.py around lines 106-107 from if not hasattr(e, 'StratumQuiet'): self.logger.debug(fexc)
to read: if not hasattr(e, 'StratumQuiet'): if fexc.find('takes exactly 1 positional argument') == -1: self.logger.debug(fexc)
Using MySql to log from EloipoolThis one took me a little bit. Change directory to this location: 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) def unpack_int24(n): return struct.unpack('B',n[0])[0] + (struct.unpack('B', n[1])[0] << 8) +\ (struct.unpack('B',n[2])[0] << 16)
def unpack_int32(n): return struct.unpack('B',n[0])[0] + (struct.unpack('B', n[1])[0] << 8) +\ (struct.unpack('B',n[2])[0] << 16) + (struct.unpack('B', n[3])[0] << 24)
def unpack_int64(n): return struct.unpack('B',n[0])[0] + (struct.unpack('B', n[1])[0]<<8) +\ (struct.unpack('B',n[2])[0] << 16) + (struct.unpack('B',n[3])[0]<<24)+\ (struct.unpack('B',n[4])[0] << 32) + (struct.unpack('B',n[5])[0]<<40)+\ (struct.unpack('B',n[6])[0] << 48) + (struct.unpack('B',n[7])[0]<<56)
Delete them all and in their place put this: def unpack_int24(n): try: return struct.unpack('B',n[0])[0] + (struct.unpack('B', n[1])[0] << 8) +\ (struct.unpack('B',n[2])[0] << 16) except TypeError: return n[0]+(n[1]<<8)+(n[2]<<16)
def unpack_int32(n): try: return struct.unpack('B',n[0])[0] + (struct.unpack('B', n[1])[0] << 8) +\ (struct.unpack('B',n[2])[0] << 16) + (struct.unpack('B', n[3])[0] << 24) except TypeError: return n[0]+(n[1]<<8)+(n[2]<<16)+(n[3]<<24)
def unpack_int64(n): try: return struct.unpack('B',n[0])[0] + (struct.unpack('B', n[1])[0]<<8) +\ (struct.unpack('B',n[2])[0] << 16) + (struct.unpack('B',n[3])[0]<<24)+\ (struct.unpack('B',n[4])[0] << 32) + (struct.unpack('B',n[5])[0]<<40)+\ (struct.unpack('B',n[6])[0] << 48) + (struct.unpack('B',n[7])[0]<<56) except TypeError: return n[0]+(n[1]<<8)+(n[2]<<16)+(n[3]<<24) \ +(n[4]<<32)+(n[5]<<40)+(n[6]<<48)+(n[7]<<56)
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
|
|
|
I got an error: makeCoinbaseTxn ERROR Coinbaser failed! then i do some debug line 105 in eloipool.py raise an error nout = int(p.stdout.readline()) I guess CoinbaserCmd is invalid, then i run the command in terminal echo -e "1\\n$((%d / 100))\\n1579aXhdwvKZEMrAKoCZhzGuqMa8EonuXU" the result is: bash: %d / 100: syntax error: operand expected (error token is "%d / 100") any ideas? My guess would be a non-BASH default shell... I found the reason return My default shell is Bash,I use Python 3.3.1 on Ubuntu If your default shell was BASH, you wouldn't get that result. i have the same with BASH, python 3.2 , on ubuntu 12. commenting CoinbaserCmd, may help but it isn't good solution... I can verify this. I switched my shell to bash and ran the same command. Same issue.
|
|
|
This is a known bug in pymysql. You have to modify pymysql, I can't remember exactly what line or file but I remember finding the solution in a google group somewhere. I found it with a little googling.
Thats the funny thing though, it WAS working. I am not much of a PHP-fu master to use the data yet, but I knew that was the best way to utilize it for the future. Also, an update: I started screwing around with things due to the bitcoinrpc bug and fucked up everything so I started from scratch again. Its ok though, since i'm documenting what works for me the more I struggle the easier it will be on others. ~WHH
|
|
|
Well, I did a reinstall and currently the only error I'm getting has to do with PyMySql (for share logging). 2014-02-27 15:20:29,964 sharelogging.sql CRITICAL Error inserting data: ('insert into shares (rem_host, username, our_result, upstream_result, reason, solution) values (%s, %s, %s, %s, %s, unhex(%s))', ('::ffff:2.50.70.154', '1Nnb5S3z8kPMiiej9fUnvRqHorwb5C5mzq', 'Y', None, None, '000000020fb44678de6c8516585ffd8178369745cca945fea47b2c870000000000000000f418f5e1a6e38a2291e92c237ce1b97a44fd7f0864b795c58a34e976bd5edadd530fc83319015f5339bd0823'))Traceback (most recent call last): File "/usr/local/lib/python3.2/dist-packages/PyMySQL3-0.5-py3.2.egg/pymysql/cursors.py", line 112, in execute result = self._query(query) File "/usr/local/lib/python3.2/dist-packages/PyMySQL3-0.5-py3.2.egg/pymysql/cursors.py", line 230, in _query conn.query(q) File "/usr/local/lib/python3.2/dist-packages/PyMySQL3-0.5-py3.2.egg/pymysql/connections.py", line 607, in query self._affected_rows = self._read_query_result() File "/usr/local/lib/python3.2/dist-packages/PyMySQL3-0.5-py3.2.egg/pymysql/connections.py", line 691, in _read_query_result result.read() File "/usr/local/lib/python3.2/dist-packages/PyMySQL3-0.5-py3.2.egg/pymysql/connections.py", line 873, in read self._read_ok_packet() File "/usr/local/lib/python3.2/dist-packages/PyMySQL3-0.5-py3.2.egg/pymysql/connections.py", line 880, in _read_ok_packet self.insert_id = self.first_packet.read_length_coded_binary() File "/usr/local/lib/python3.2/dist-packages/PyMySQL3-0.5-py3.2.egg/pymysql/connections.py", line 292, in read_length_coded_binary return unpack_int24(self.read(UNSIGNED_INT24_LENGTH)) File "/usr/local/lib/python3.2/dist-packages/PyMySQL3-0.5-py3.2.egg/pymysql/connections.py", line 161, in unpack_int24 return struct.unpack('B',n[0])[0] + (struct.unpack('B', n[1])[0] << 8) +\ TypeError: 'int' does not support the buffer interface
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/var/www/eloipool/sharelogging/sql.py", line 53, in _doInsert dbc.execute(stmt, params) File "/usr/local/lib/python3.2/dist-packages/PyMySQL3-0.5-py3.2.egg/pymysql/cursors.py", line 117, in execute self.errorhandler(self, exc, value) File "/usr/local/lib/python3.2/dist-packages/PyMySQL3-0.5-py3.2.egg/pymysql/connections.py", line 187, in defaulterrorhandler raise Error(errorclass, errorvalue) pymysql.err.Error: (<class 'TypeError'>, TypeError("'int' does not support the buffer interface",))
This is interesting because I havent changed any of it.
|
|
|
Weird.. Other than a couple extra signals, for restarting and stopping, my eloipool is unmolested. 2014-02-27 10:44:50,958 BitcoinLink DEBUG Received block inv over p2p for 0000000000000000fff2604f9110d1af25e302ae2c3bdd8fe4be10dc37c788ac 2014-02-27 10:44:51,046 newBlockNotification INFO Received new block notification 2014-02-27 10:44:51,734 merkleMaker INFO New block: 0000000000000000fff2604f9110d1af25e302ae2c3bdd8fe4be10dc37c788ac (height: 288136; bits: 19015f53) 2014-02-27 10:44:51,827 JSONRPCServer INFO Longpoll woke up 5 clients in 0.005 seconds 2014-02-27 10:44:52,846 JSONRPCServer INFO Waiting 3.98 seconds to longpoll 2014-02-27 10:44:56,920 JSONRPCServer INFO Longpoll woke up 5 clients in 0.092 seconds and my debug logs only show errors when I have restarted the server. So do you just get the new block notifications and the standard longpools in your logfile?
|
|
|
2014-02-26 20:43:30,962 StratumHandler DEBUG Traceback (most recent call last ): File "/var/www/eloipool/networkserver.py", line 47, in handle_read data = self.recv (self.ac_in_buffer_size) File "/usr/lib/python3.2/asyncore.py", line 384, in recv data = self.socket.recv(buffer_size) socket.error: [Errno 110] Connection timed out
bcnode.newBlock = lambda blkhash: MM.updateMerkleTree() File "/var/www/eloipool/merklemaker.py", line 561, in updateMerkleTree self._updateMerkleTree() File "/var/www/eloipool/merklemaker.py", line 549, in _updateMerkleTree self._updateMerkleTree_I() File "/var/www/eloipool/merklemaker.py", line 513, in _updateMerkleTree_I r = self._updateMerkleTree_fromTS(TS) File "/var/www/eloipool/merklemaker.py", line 478, in _updateMerkleTree_fromTS MP = self._CallGBT(TS) File "/var/www/eloipool/merklemaker.py", line 328, in _CallGBT MP = access.getblocktemplate(self.GBTReq) File "/var/www/eloipool/python-bitcoinrpc/bitcoinrpc/authproxy.py", line 112, in __call__ 'Content-type': 'application/json'}) File "/usr/lib/python3.2/http/client.py", line 967, in request self._send_request(method, url, body, headers) File "/usr/lib/python3.2/http/client.py", line 995, in _send_request self.putrequest(method, url, **skips) File "/usr/lib/python3.2/http/client.py", line 850, in putrequest raise CannotSendRequest(self.__state) http.client.CannotSendRequest: Request-sent
Luke-Jr seems to think this is a problem with the bitcoind rpc. I see this error when bitcoin isn't up to date or still starting. the first error I've not seen before. So is there a specific build of the bitcoind rpc that works works? I use this PPA, for my ubuntu box. It doesn't produce any errors for me. Interesting, I just checked my repo and I'm using the same one you are (Also ubuntu user)
|
|
|
2014-02-26 20:43:30,962 StratumHandler DEBUG Traceback (most recent call last ): File "/var/www/eloipool/networkserver.py", line 47, in handle_read data = self.recv (self.ac_in_buffer_size) File "/usr/lib/python3.2/asyncore.py", line 384, in recv data = self.socket.recv(buffer_size) socket.error: [Errno 110] Connection timed out
bcnode.newBlock = lambda blkhash: MM.updateMerkleTree() File "/var/www/eloipool/merklemaker.py", line 561, in updateMerkleTree self._updateMerkleTree() File "/var/www/eloipool/merklemaker.py", line 549, in _updateMerkleTree self._updateMerkleTree_I() File "/var/www/eloipool/merklemaker.py", line 513, in _updateMerkleTree_I r = self._updateMerkleTree_fromTS(TS) File "/var/www/eloipool/merklemaker.py", line 478, in _updateMerkleTree_fromTS MP = self._CallGBT(TS) File "/var/www/eloipool/merklemaker.py", line 328, in _CallGBT MP = access.getblocktemplate(self.GBTReq) File "/var/www/eloipool/python-bitcoinrpc/bitcoinrpc/authproxy.py", line 112, in __call__ 'Content-type': 'application/json'}) File "/usr/lib/python3.2/http/client.py", line 967, in request self._send_request(method, url, body, headers) File "/usr/lib/python3.2/http/client.py", line 995, in _send_request self.putrequest(method, url, **skips) File "/usr/lib/python3.2/http/client.py", line 850, in putrequest raise CannotSendRequest(self.__state) http.client.CannotSendRequest: Request-sent
Luke-Jr seems to think this is a problem with the bitcoind rpc. I see this error when bitcoin isn't up to date or still starting. the first error I've not seen before. So is there a specific build of the bitcoind rpc that works works?
|
|
|
Greetings! New poster, solved MOST problems. The only problems I have now are: 2014-02-26 20:43:30,962 StratumHandler DEBUG Traceback (most recent call last): File "/var/www/eloipool/networkserver.py", line 47, in handle_read data = self.recv (self.ac_in_buffer_size) File "/usr/lib/python3.2/asyncore.py", line 384, in recv data = self.socket.recv(buffer_size) socket.error: [Errno 110] Connection timed out
and 2014-02-26 20:43:30,962 StratumHandler DEBUG Traceback (most recent call last ): File "/var/www/eloipool/networkserver.py", line 47, in handle_read data = self.recv (self.ac_in_buffer_size) File "/usr/lib/python3.2/asyncore.py", line 384, in recv data = self.socket.recv(buffer_size) socket.error: [Errno 110] Connection timed out
bcnode.newBlock = lambda blkhash: MM.updateMerkleTree() File "/var/www/eloipool/merklemaker.py", line 561, in updateMerkleTree self._updateMerkleTree() File "/var/www/eloipool/merklemaker.py", line 549, in _updateMerkleTree self._updateMerkleTree_I() File "/var/www/eloipool/merklemaker.py", line 513, in _updateMerkleTree_I r = self._updateMerkleTree_fromTS(TS) File "/var/www/eloipool/merklemaker.py", line 478, in _updateMerkleTree_fromTS MP = self._CallGBT(TS) File "/var/www/eloipool/merklemaker.py", line 328, in _CallGBT MP = access.getblocktemplate(self.GBTReq) File "/var/www/eloipool/python-bitcoinrpc/bitcoinrpc/authproxy.py", line 112, in __call__ 'Content-type': 'application/json'}) File "/usr/lib/python3.2/http/client.py", line 967, in request self._send_request(method, url, body, headers) File "/usr/lib/python3.2/http/client.py", line 995, in _send_request self.putrequest(method, url, **skips) File "/usr/lib/python3.2/http/client.py", line 850, in putrequest raise CannotSendRequest(self.__state) http.client.CannotSendRequest: Request-sent
I've solved some of the issues I had already with this thread (thank you very much guys). Once I get this sucker running without errors I plan on helping out (if thats alright with you luke-jr) by documenting the whole process thoroughly. Also eventually working on a basic frontend. ~WHH
|
|
|
|