WF-2021 / BTC_FPGA_MINER

Other
14 stars 5 forks source link

Exception in thread Thread-2 #2

Closed torukskywalker closed 3 years ago

torukskywalker commented 3 years ago

我们使用anaconda2.7 或 python2 测试,发现需要先更改urllib,否则会有no module error…

import urllib.parse # URL库

from urlparse import urlparse

tcp_url = urllib.parse.urlparse(self._tcp_url)

tcp_url = urlparse(self._tcp_url)

之后再执行会有以下有问题,目前不知问题在那?

成功完成订阅任务! 成功完成账户登录任务! ('\xe5\xbd\x93\xe5\x89\x8d\xe9\x9a\xbe\xe5\xba\xa6\xe4\xb8\xba\xef\xbc\x9a', 32768) ('\xe5\xbd\x93\xe5\x89\x8d\xe6\x8c\x96\xe7\x9f\xbf\xe7\x9b\xae\xe6\xa0\x87\xe4\xb8\xba\xef\xbc\x9a', '000000000001ffffffffffffffffffffffffffffffffffffffffffffffffffff') 成功完成改变难度,计算目标任务! Exception in thread Thread-2: Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner self.run() File "/usr/lib/python2.7/threading.py", line 754, in run self.target(*self.args, **self.__kwargs) File "bitcoin.py", line 233, in _tcp_rx_handle self.tcp_handle_reply(request=request, reply=reply) File "bitcoin.py", line 282, in tcp_handle_reply self.hash_prefix_calc() File "bitcoin.py", line 372, in hash_prefix_calc print('extranounce2_bin = ', extranounce2_bin.hex()) AttributeError: 'str' object has no attribute 'hex

WF-2021 commented 3 years ago

我们的上位机是基于python3开发的,其中的部分语句与python2中是不通用的,也建议您使用python3开发。 根据您粘贴的打印信息最后一个错,我们认为是python2中str类型没有hex函数造成的,可以参考网页https://blog.csdn.net/whatday/article/details/105661116 还有一点想说明的是,我们更偏向FPGA开发,对python等软件语言也是边学边做的,不一定能帮您解决问题。 助调试顺利!