'TypeError: bind(): AF_INET address must be tuple, not int

An error occurs when creating a transaction.

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:[email protected]: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


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source