You're missing Crypto package. If I remember well, it is python-crypto in Debian/Ubuntu.
It was the Bitcointalk forum that inspired us to create Bitcointalksearch.org - Bitcointalk is an excellent site that should be the default page for anybody dealing in cryptocurrency, since it is a virtual gold-mine of data. However, our experience and user feedback led us create our site; Bitcointalk's search is slow, and difficult to get the results you need, because you need to log in first to find anything useful - furthermore, there are rate limiters for their search functionality.
The aim of our project is to create a faster website that yields more results and faster without having to create an account and eliminate the need to log in - your personal data, therefore, will never be in jeopardy since we are not asking for any of your data and you don't need to provide them to use our site with all of its capabilities.
We created this website with the sole purpose of users being able to search quickly and efficiently in the field of cryptocurrency so they will have access to the latest and most accurate information and thereby assisting the crypto-community at large.
Unhandled error in Deferred:
Unhandled Error
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/Twisted-12.3.0-py2.7-linux-x86_64.egg/twisted/application/service.py", line 405, in loadApplication
application = sob.loadValueFromFile(filename, 'application', passphrase)
File "/usr/local/lib/python2.7/dist-packages/Twisted-12.3.0-py2.7-linux-x86_64.egg/twisted/persisted/sob.py", line 210, in loadValueFromFile
exec fileObj in d, d
File "launcher.tac", line 36, in
mining.setup(on_startup)
File "/usr/local/lib/python2.7/dist-packages/Twisted-12.3.0-py2.7-linux-x86_64.egg/twisted/internet/defer.py", line 1214, in unwindGenerator
return _inlineCallbacks(None, gen, Deferred())
------
File "/usr/local/lib/python2.7/dist-packages/Twisted-12.3.0-py2.7-linux-x86_64.egg/twisted/internet/defer.py", line 1071, in _inlineCallbacks
result = g.send(result)
File "/opt/stratum-mining/mining/__init__.py", line 30, in setup
from lib.block_template import BlockTemplate
File "/opt/stratum-mining/lib/block_template.py", line 7, in
import halfnode
File "/opt/stratum-mining/lib/halfnode.py", line 13, in
from Crypto.Hash import SHA256
exceptions.ImportError: No module named Crypto.Hash
#!/bin/bash
/usr/bin/bitcoind -daemon -blocknotify="/home/user/stratum-mining/scripts/blocknotify.sh --password SECRET --host localhost --port 3333"
while true
do
getinfo="$(/usr/bin/bitcoind getinfo 2>&1)"
NOW=$(date +"%Y-%m-%d %H:%M:%S")
if [[ "$getinfo" == *"couldn't connect to server"* ]]
then
echo "$NOW: Couldn't connect to Bitcoin Daemon yet. Sleeping 5 seconds."
sleep 5
else
echo "$NOW: Bitcoin Daemon seems up and running."
exit;
fi
done
-> bitcoind
sleep 10
-> pool
sleep 5
-> proxy
-> bitcoind
sleep 10
-> pool
sleep 5
-> proxy
2013-01-08 16:52:19,879 INFO proxy jobs.submit # Submitting share 444d3d05 diff 2/2
2013-01-08 16:52:20,611 INFO proxy jobs.submit # Submitting share b8da8bee diff 8/2
2013-01-08 16:52:20,626 INFO proxy jobs.submit # Submitting share ae1b8987 diff 4/2
2013-01-08 16:52:21,531 INFO proxy client_service.handle_event # New job 7b7a for prevhash fce0b8c2, clean_jobs=True
2013-01-08 16:52:21,537 INFO proxy getwork_listener._on_lp_broadcast # LP broadcast for worker 'xxx'
2013-01-08 16:52:21,542 WARNING proxy getwork_listener.render_POST # Worker 'xxx' subscribed for LP
2013-01-08 16:52:21,650 INFO proxy jobs.submit # Submitting share 0aaf5e54 diff 9/2
2013-01-08 16:52:21,650 INFO proxy jobs.submit # Job not found
2013-01-08 16:52:21,650 WARNING proxy getwork_listener._on_submit # [0ms] Share from 'xxx' REJECTED
2013-01-08 16:52:22,130 INFO proxy jobs.submit # Submitting share 651f8694 diff 4/2
2013-01-08 16:52:25,340 INFO proxy jobs.submit # Submitting share c82ad212 diff 4/2
2013-01-08 16:52:26,197 INFO proxy client_service.handle_event # New job 7b7b for prevhash fce0b8c2, clean_jobs=False
2013-01-08 16:52:26,363 INFO proxy jobs.submit # Submitting share d4f3d527 diff 3/2
2013-01-08 16:52:26,579 INFO proxy jobs.submit # Submitting share 9bf6352b diff 7/2
2013-01-08 16:52:26,630 INFO proxy jobs.submit # Submitting share 320cd927 diff 2/2
2013-01-08 16:52:26,880 INFO proxy jobs.submit # Submitting share a5d9d0a8 diff 2/2
2013-01-08 16:52:28,020 INFO proxy jobs.submit # Submitting share f69333c7 diff 2/2
2013-01-08 16:52:29,133 INFO proxy jobs.submit # Submitting share 32194c07 diff 5/2
2013-01-08 17:11:36,686 INFO proxy jobs.submit # Submitting share cc48b0bc diff 3/2
2013-01-08 17:11:38,198 INFO proxy jobs.submit # Submitting share 97d627b5 diff 19/2
2013-01-08 17:11:39,335 INFO proxy client_service.handle_event # New job 7ba2 for prevhash fce0b8c2, clean_jobs=False
2013-01-08 17:11:40,469 INFO proxy jobs.submit # Submitting share 420bc001 diff 3/2
2013-01-08 17:11:40,856 INFO proxy jobs.submit # Submitting share 82517ba6 diff 36/2
2013-01-08 17:11:41,105 INFO proxy jobs.submit # Submitting share 55f1c8b9 diff 2/2
2013-01-08 17:11:42,227 INFO proxy jobs.submit # Submitting share 45be6ce3 diff 4/2
2013-01-08 17:11:43,356 INFO proxy jobs.submit # Submitting share 8280834b diff 5/2
2013-01-08 17:11:44,854 INFO proxy jobs.submit # Submitting share 17f85864 diff 3/2
2013-01-08 17:11:44,897 INFO proxy jobs.submit # Submitting share b2f7eec6 diff 9/2
2013-01-08 17:11:44,939 INFO proxy jobs.submit # Submitting share 0bf1a7ce diff 3/2
2013-01-08 17:11:46,015 INFO proxy jobs.submit # Submitting share 4e378813 diff 3/2
2013-01-08 17:11:46,281 INFO proxy jobs.submit # Submitting share 7292f80f diff 2/2
2013-01-08 17:11:46,608 INFO proxy jobs.submit # Submitting share 688891d3 diff 2/2
2013-01-08 17:11:47,233 INFO proxy jobs.submit # Submitting share e943f6c9 diff 3/2
2013-01-08 17:11:47,517 INFO proxy jobs.submit # Submitting share 6ce77628 diff 4/2
2013-01-08 17:11:47,737 INFO proxy jobs.submit # Submitting share dfb7d8dd diff 4/2
2013-01-08 17:11:48,701 INFO proxy jobs.submit # Submitting share e2f03289 diff 17/2
2013-01-08 17:11:48,735 INFO proxy jobs.submit # Submitting share d85a653b diff 17/2
2013-01-08 17:11:49,017 INFO proxy jobs.submit # Submitting share 7b7e3ea0 diff 739/2
2013-01-08 17:11:50,984 INFO proxy jobs.submit # Submitting share f8190c47 diff 2/2
2013-01-08 17:11:51,077 INFO proxy jobs.submit # Submitting share 0d0b3a53 diff 3/2
diff -Naur stratum-mining-proxy-master//mining_libs/getwork_listener.py stratum-1.3.0//mining_libs/getwork_listener.py
--- stratum-mining-proxy-master//mining_libs/getwork_listener.py 2012-12-13 18:52:36.000000000 +0100
+++ stratum-1.3.0//mining_libs/getwork_listener.py 2012-12-19 18:48:13.894302270 +0100
@@ -36,7 +36,7 @@
def _on_submit(self, result, request, msg_id, blockheader, worker_name, start_time):
response_time = (time.time() - start_time) * 1000
if result == True:
- log.warning("[%dms] Share from '%s' accepted, diff %d" % (response_time, worker_name, self.job_registry.difficulty))
+ log.debug("[%dms] Share from '%s' accepted, diff %d" % (response_time, worker_name, self.job_registry.difficulty))
else:
log.warning("[%dms] Share from '%s' REJECTED" % (response_time, worker_name))
@@ -81,7 +81,7 @@
if 'params' not in data or not len(data['params']):
# getwork request
- log.info("Worker '%s' asks for new work" % worker_name)
+ log.debug("Worker '%s' asks for new work" % worker_name)
extensions = request.getHeader('x-mining-extensions')
no_midstate = extensions and 'midstate' in extensions
request.write(self.json_response(data.get('id', 0), self.job_registry.getwork(no_midstate=no_midstate)))
diff -Naur stratum-mining-proxy-master//mining_libs/jobs.py stratum-1.3.0//mining_libs/jobs.py
--- stratum-mining-proxy-master//mining_libs/jobs.py 2012-12-13 18:52:36.000000000 +0100
+++ stratum-1.3.0//mining_libs/jobs.py 2012-12-19 18:59:29.825631912 +0100
@@ -92,6 +92,7 @@
self.target_hex = ''
self.difficulty = 1
self.set_difficulty(1)
+ self.target1 = self.target
self.target1_hex = self.target_hex
# Relation between merkle and job
@@ -223,14 +224,17 @@
rev = ''.join([ header_bin[i*4:i*4+4][::-1] for i in range(0, 20) ])
hash_bin = utils.doublesha(rev)
block_hash = ''.join([ hash_bin[i*4:i*4+4][::-1] for i in range(0, 8) ])
+
#log.info('!!! %s' % header[:160])
- log.info("Submitting %s" % utils.format_hash(binascii.hexlify(block_hash)))
-
- if utils.uint256_from_str(hash_bin) > self.target:
+ difs = utils.uint256_from_str(hash_bin)
+ if difs > self.target:
log.debug("Share is below expected target")
return True
-
+
+ share = utils.format_hash(binascii.hexlify(block_hash))
+ log.info("Submitting share %s diff %d/%d" % (share, int(self.target1 / difs), self.difficulty))
+
# 2. Lookup for job and extranonce used for creating given block header
try:
(job, extranonce2) = self.get_job_from_header(header)
Linux 2.6.32-5-amd64 x86_64 GNU/Linux
Description: Debian GNU/Linux 6.0.6 (squeeze)
Python 2.6.6
Current stratum-mining-proxy version:
commit 27e8dce29b82c300a66dc28017dedad1b06e3519
------
File "/usr/local/lib/python2.6/dist-packages/Twisted-12.2.0-py2.6-linux-x86_64.egg/twisted/internet/defer.py", line 134, in maybeDeferred
result = f(*args, **kw)
File "/home/pioruns/stratum-mining-proxy/mining_libs/worker_registry.py", line 37, in authorize
d = self.f.rpc('mining.authorize', [worker_name, password])
File "/usr/local/lib/python2.6/dist-packages/stratum-0.2.11-py2.6.egg/stratum/socket_transport.py", line 89, in rpc
raise custom_exceptions.TransportException("Not connected")
stratum.custom_exceptions.TransportException: Not connected
Unhandled error in Deferred:
Unhandled Error
Traceback (most recent call last):
File "/usr/local/lib/python2.6/dist-packages/Twisted-12.2.0-py2.6-linux-x86_64.egg/twisted/web/server.py", line 156, in process
self.render(resrc)
File "/usr/local/lib/python2.6/dist-packages/Twisted-12.2.0-py2.6-linux-x86_64.egg/twisted/web/server.py", line 191, in render
body = resrc.render(self)
File "/usr/local/lib/python2.6/dist-packages/Twisted-12.2.0-py2.6-linux-x86_64.egg/twisted/web/resource.py", line 216, in render
return m(request)
File "/home/pioruns/stratum-mining-proxy/mining_libs/getwork_listener.py", line 163, in render_POST
d = defer.maybeDeferred(self.workers.authorize, worker_name, password)
------
File "/usr/local/lib/python2.6/dist-packages/Twisted-12.2.0-py2.6-linux-x86_64.egg/twisted/internet/defer.py", line 134, in maybeDeferred
result = f(*args, **kw)
File "/home/pioruns/stratum-mining-proxy/mining_libs/worker_registry.py", line 37, in authorize
d = self.f.rpc('mining.authorize', [worker_name, password])
File "/usr/local/lib/python2.6/dist-packages/stratum-0.2.11-py2.6.egg/stratum/socket_transport.py", line 89, in rpc
raise custom_exceptions.TransportException("Not connected")
stratum.custom_exceptions.TransportException: Not connected
Unhandled error in Deferred:
Unhandled Error
Traceback (most recent call last):
File "/usr/local/lib/python2.6/dist-packages/Twisted-12.2.0-py2.6-linux-x86_64.egg/twisted/web/server.py", line 156, in process
self.render(resrc)
File "/usr/local/lib/python2.6/dist-packages/Twisted-12.2.0-py2.6-linux-x86_64.egg/twisted/web/server.py", line 191, in render
body = resrc.render(self)
File "/usr/local/lib/python2.6/dist-packages/Twisted-12.2.0-py2.6-linux-x86_64.egg/twisted/web/resource.py", line 216, in render
return m(request)
File "/home/pioruns/stratum-mining-proxy/mining_libs/getwork_listener.py", line 163, in render_POST
d = defer.maybeDeferred(self.workers.authorize, worker_name, password)
------
File "/usr/local/lib/python2.6/dist-packages/Twisted-12.2.0-py2.6-linux-x86_64.egg/twisted/internet/defer.py", line 134, in maybeDeferred
result = f(*args, **kw)
File "/home/pioruns/stratum-mining-proxy/mining_libs/worker_registry.py", line 37, in authorize
d = self.f.rpc('mining.authorize', [worker_name, password])
File "/usr/local/lib/python2.6/dist-packages/stratum-0.2.11-py2.6.egg/stratum/socket_transport.py", line 89, in rpc
raise custom_exceptions.TransportException("Not connected")
stratum.custom_exceptions.TransportException: Not connected
Unhandled error in Deferred:
Unhandled Error
Traceback (most recent call last):
File "/usr/local/lib/python2.6/dist-packages/Twisted-12.2.0-py2.6-linux-x86_64.egg/twisted/web/server.py", line 156, in process
self.render(resrc)
File "/usr/local/lib/python2.6/dist-packages/Twisted-12.2.0-py2.6-linux-x86_64.egg/twisted/web/server.py", line 191, in render
body = resrc.render(self)
File "/usr/local/lib/python2.6/dist-packages/Twisted-12.2.0-py2.6-linux-x86_64.egg/twisted/web/resource.py", line 216, in render
return m(request)
File "/home/pioruns/stratum-mining-proxy/mining_libs/getwork_listener.py", line 163, in render_POST
d = defer.maybeDeferred(self.workers.authorize, worker_name, password)
------
File "/usr/local/lib/python2.6/dist-packages/Twisted-12.2.0-py2.6-linux-x86_64.egg/twisted/internet/defer.py", line 134, in maybeDeferred
result = f(*args, **kw)
File "/home/pioruns/stratum-mining-proxy/mining_libs/worker_registry.py", line 37, in authorize
d = self.f.rpc('mining.authorize', [worker_name, password])
File "/usr/local/lib/python2.6/dist-packages/stratum-0.2.11-py2.6.egg/stratum/socket_transport.py", line 89, in rpc
raise custom_exceptions.TransportException("Not connected")
stratum.custom_exceptions.TransportException: Not connected
2012-12-29T12:16:55: 001-0: ztex_ufm1_15y1-04A3919EA0-4: Error: jsonParse: Parameter `data' not found: Disabling URL http://localhost:4990 for 60s
2012-12-29 12:23:31,334 INFO proxy jobs.# Using C extension for midstate speedup. Good!
2012-12-29 12:23:52,471 WARNING proxy mining_proxy.main # Stratum proxy version: 1.3.0
2012-12-29 12:23:52,472 WARNING proxy mining_proxy.main # Trying to connect to Stratum pool at mint.bitminter.com:5050
Unhandled error in Deferred:
Unhandled Error
Traceback (most recent call last):
Failure: stratum.custom_exceptions.TransportException: SocketTransportClientFactory connection timed out
2012-12-29 12:25:52,474 ERROR proxy client_service.on_timeout # Connection to upstream pool timed out
2012-12-29 12:27:52,474 ERROR proxy client_service.on_timeout # Connection to upstream pool timed out
001-0: ztex_ufm1_15y1-04A346F601-4: Error: Connection refused: Disabling URL http://localhost:4990 for 60s
Linux 2.6.32-5-amd64 x86_64 GNU/Linux
Description: Debian GNU/Linux 6.0.6 (squeeze)
Python 2.6.6
Current stratum-mining-proxy version:
commit 27e8dce29b82c300a66dc28017dedad1b06e3519
log.info("%s (%s) %s %s" % (block_hash, share_diff, 'valid' if is_valid else 'INVALID', worker_name))