程序员最近都爱上了这个网站  程序员们快来瞅瞅吧!  it98k网:it98k.com

本站消息

站长简介/公众号

关注本站官方公众号:程序员总部,领取三大福利!
福利一:python和前端辅导
福利二:进程序员交流微信群,专属于程序员的圈子
福利三:领取全套零基础视频教程(python,java,前端,php)

  价值13000svip视频教程,python大神匠心打造,零基础python开发工程师视频教程全套,基础+进阶+项目实战,包含课件和源码

  出租广告位,需要合作请联系站长

+关注
已关注

分类  

暂无分类

标签  

暂无标签

日期归档  

暂无数据

TypeError: bind(): AF_INET 地址必须是元组,而不是 int

发布于2022-09-20 15:38     阅读(1031)     评论(0)     点赞(18)     收藏(2)


创建事务时发生错误。

from bitcoinrpc.proxy import AuthServiceProxy
from transaction_template import BCS_net
from pycoin.solve.utils import build_hash160_lookup
from pycoin.ecdsa.secp256k1 import secp256k1_generator
from configure import NETWORK_PARAMS


addr_to_send = 'BM3WwFWYvz7TdvvEp9EGUB6mSg2jiM5fW6'

Bcs_network = BCS_net(addr_to_send, rpc_user='bcs_tester', rpc_pass='iLoveBCS', NETWORK_PARAMS=NETWORK_PARAMS)
Bcs_network.create_tx(satoshis=1000000, solver_f=build_hash160_lookup, generator=secp256k1_generator)
print(Bcs_network.signed_new_tx)
print(Bcs_network.signed_new_tx_hex)
conn = AuthServiceProxy('http://bcs_tester:iLoveBCS@45.32.232.25:3669')
print(conn.decoderawtransaction((Bcs_network.signed_new_tx_hex, )))


print(conn.sendrawtransaction((Bcs_network.signed_new_tx_hex, )))

url = 'https://bcschain.info/api/tx/send'
Traceback (most recent call last):
  File "C:\Users\feels\Desktop\djangoProject_bcs\blockchain\transaction_manager\transaction_execution.py", line 15, in <module>
    print(conn.decoderawtransaction((Bcs_network.signed_new_tx_hex, )))
  File "C:\Users\feels\AppData\Local\Programs\Python\Python310\lib\site-packages\bitcoinrpc\proxy.py", line 92, in __call__
    self.__conn.request('POST', self.__url.path, postdata,
  File "C:\Users\feels\AppData\Local\Programs\Python\Python310\lib\http\client.py", line 1282, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "C:\Users\feels\AppData\Local\Programs\Python\Python310\lib\http\client.py", line 1328, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "C:\Users\feels\AppData\Local\Programs\Python\Python310\lib\http\client.py", line 1277, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "C:\Users\feels\AppData\Local\Programs\Python\Python310\lib\http\client.py", line 1037, in _send_output
    self.send(msg)
  File "C:\Users\feels\AppData\Local\Programs\Python\Python310\lib\http\client.py", line 975, in send
    self.connect()
  File "C:\Users\feels\AppData\Local\Programs\Python\Python310\lib\http\client.py", line 941, in connect
    self.sock = self._create_connection(
  File "C:\Users\feels\AppData\Local\Programs\Python\Python310\lib\socket.py", line 832, in create_connection
    sock.bind(source_address)
TypeError: bind(): AF_INET address must be tuple, not int

解决方案


暂无回答



所属网站分类: 技术文章 > 问答

作者:黑洞官方问答小能手

链接:https://www.pythonheidong.com/blog/article/1759306/6371600be934c0f74ef9/

来源:python黑洞网

任何形式的转载都请注明出处,如有侵权 一经发现 必将追究其法律责任

18 0
收藏该文
已收藏

评论内容:(最多支持255个字符)