Crypto-Expert / stratum-mining

AIO Stratum mining server for various coins
Other
365 stars 348 forks source link

getwork removed? #358

Closed ivoras closed 7 years ago

ivoras commented 9 years ago

I'm using bitcoind 0.10 and it looks like the getwork RPC is removed:

# bitcoin-cli getwork
error: {"code":-32601,"message":"Method not found"}

The getblocktemplate RPC still works.

However, it looks like stratum-mining uses getwork, and so cannot be used with the latest version of bitcoind - is this correct?

ahmedbodi commented 9 years ago

Hi

Stratum uses GetBlockTemplate to communicate with bitcoind. Older versions of stratum mining did support getwork mining but its been deprecated a long time ago on our end.

Ahmed

ivoras commented 9 years ago

hi,

I'm not writing this ticket because I want to use getwork, I'm writing it because I've checked out stratum-mining yesterday and followed the instructions in the wiki, and it reports the following in the logs:

2015-04-17 07:24:27,286 INFO block_updater block_updater.run # Checking for new block.
2015-04-17 07:24:27,287 ERROR block_updater block_updater.run # UpdateWatchdog.run failed
Traceback (most recent call last):
  File "/srv/stratum/stratum-mining/lib/block_updater.py", line 49, in run
    prevhash = util.reverse_hash((yield self.bitcoin_rpc.prevhash()))
Error: 404 Not Found
2015-04-17 07:24:27,288 DEBUG block_updater block_updater.schedule # Next prevhash update in 4.994 sec

I've attached tcpdump and seen that the "404" is returned by bitcoind for "method not found" in response to the getwork json-rpc call.

So I'm asking you for verification: is my conclusion that I need to be running bitcoind 0.9 with stratum-mining correct?

ahmedbodi commented 9 years ago

stratum mining does not use getwork anywhere. So you are mistaken.

ivoras commented 9 years ago

I could be mistaken, but the log output I've quoted is not.

Can you help me sort this out then? I have the latest version of https://github.com/Crypto-Expert/stratum-mining :

commit b9f2bcea36faea27c81a980565f56733a30035b9
Author: ahmedbodi <ahmed_bodi@msn.com>
Date:   Thu Jun 26 22:35:41 2014 +0100

... and in externals/stratum, by following the instructions from the wiki at https://github.com/Crypto-Expert/stratum-mining/wiki/Getting-Started-With-Stratum , I have:

commit 8ba1b5fd8a802b981f31dace4cf920cfb4a3907c
Author: slush <info@bitcoin.cz>
Date:   Sat Mar 30 22:49:10 2013 +0100

Are these not the latest versions?

Grepping for "getwork" in the stratum-mining root shows that getwork is used in the prevhash() method in lib/bitcoin_rpc.py:

142     @defer.inlineCallbacks
143     def prevhash(self):
144         resp = (yield self._call('getwork', []))
145         try:
146             defer.returnValue(json.loads(resp)['result']['data'][8:72])
147         except Exception as e:
148             log.exception("Cannot decode prevhash %s" % str(e))
149             raise

... which is the source of the exception I'm seeing in logs.

ahmedbodi commented 9 years ago

Ah. I was under the impression that you meant getwork for mining. I would then assume that you have to use a BTC base of > 0.10 then im afraid. I will try finishing my cleaned up fork when i get the chance with a fix for getwork.

Ahmed

Traffim commented 9 years ago

Have you found a solution?

ivoras commented 9 years ago

Hi, No, stratum-mining simply doesn't support recent bitcoind versions. We have not investigated further.

ahmedbodi commented 9 years ago

I know of a solution. I shall attempt to get it implemented as soon as i get some free time. However, if anyone wants to contribute a bounty to get it further up in my todo list. my donation adress is: 19A7fSEUmv4RaMYq8gmQMB3SDLFZDsQyws

Ahmed

AsicTrade commented 9 years ago

import pkg_resources Unhandled Error Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/twisted/application/app.py", line 642, in run runApp(config) File "/usr/lib/python2.7/dist-packages/twisted/scripts/twistd.py", line 23, in runApp _SomeApplicationRunner(config).run() File "/usr/lib/python2.7/dist-packages/twisted/application/app.py", line 376, in run self.application = self.createOrGetApplication() File "/usr/lib/python2.7/dist-packages/twisted/application/app.py", line 441, in createOrGetApplication application = getApplication(self.config, passphrase) --- --- File "/usr/lib/python2.7/dist-packages/twisted/application/app.py", line 452, in getApplication application = service.loadApplication(filename, style, passphrase) File "/usr/lib/python2.7/dist-packages/twisted/application/service.py", line 405, in loadApplication application = sob.loadValueFromFile(filename, 'application', passphrase) File "/usr/lib/python2.7/dist-packages/twisted/persisted/sob.py", line 210, in loadValueFromFile exec fileObj in d, d File "/home/coin/dash/stratum-mining/launcher.tac", line 21, in import mining File "/home/coin/dash/stratum-mining/mining/init.py", line 1, in from service import MiningService File "/home/coin/dash/stratum-mining/mining/service.py", line 7, in from interfaces import Interfaces File "/home/coin/dash/stratum-mining/mining/interfaces.py", line 8, in from lib.util import b58encode File "/home/coin/dash/stratum-mining/lib/util.py", line 7, in import bitcoin_rpc exceptions.IndentationError: expected an indented block (bitcoin_rpc.py, line 151)

Failed to load application: expected an indented block (bitcoin_rpc.py, line 151)

need help)

engren commented 8 years ago

@ahmedbodi I am still getting the same errors in regards to getwork not being supported. Any plans on deploying your fix for this? (or if anyone else has any ideas for that matter....)

chrysophylax69 commented 8 years ago

im now getting a similar issue with stratum on dash ...

is there a workaround that we are missing here? ...

crysx

ahmedbodi commented 8 years ago

Your best bet is to run something like UNOMP for dash to be honest. I'd say its much more supported

ahmedbodi commented 7 years ago

OK this should finally be fixed. i got round to it eventually lol