bitshares / python-bitshares

Fully featured client-side library for the BitShares Blockchain - written entirely in python.
http://docs.pybitshares.com/
MIT License
163 stars 167 forks source link

Connects to bitshares.eu even if I pass a node to bitshares #302

Closed xloem closed 3 years ago

xloem commented 3 years ago

I'm using python-bitshares and python-graphenelib master checkouts.

It looks like graphenelib opens a websocket connection based on a shared configuration when BlockchainInstance is constructed, and Notify then opens its own websocket connection a little a later. The shared configuration contains the default node.bitshares.eu endpoint, which is presently down, so things are crashing for me on use.

What version combination is working these days?

bitshares = BitShares(node='wss://api.bts.mobi/ws', num_retries=-1)
notify = Notify(bitshares=bitshares, markets=list(), on_tx=on_tx)
Traceback (most recent call last):
  File "try.py", line 248, in <module>
    notify = Notify(bitshares=bitshares, markets=list(), on_tx=on_tx)
  File "/home/user/.local/lib/python3.8/site-packages/bitshares/notify.py", line 69, in __init__
    BlockchainInstance.__init__(self, **kwargs)
  File "/home/user/.local/lib/python3.8/site-packages/bitshares/instance.py", line 21, in __init__
    AbstractBlockchainInstanceProvider.__init__(self, *args, **kwargs)
  File "/home/user/.local/lib/python3.8/site-packages/graphenecommon/instance.py", line 27, in __init__
    self._blockchain = self.shared_blockchain_instance()
  File "/home/user/.local/lib/python3.8/site-packages/graphenecommon/instance.py", line 75, in shared_blockchain_instance
    self._sharedInstance.instance = klass(**self._sharedInstance.config)
  File "/home/user/.local/lib/python3.8/site-packages/graphenecommon/chain.py", line 56, in __init__
    self.connect(node=node, rpcuser=rpcuser, rpcpassword=rpcpassword, **kwargs)
  File "/home/user/.local/lib/python3.8/site-packages/graphenecommon/chain.py", line 86, in connect
    self.rpc = self.rpc_class(node, rpcuser, rpcpassword, **kwargs)
  File "/home/user/.local/lib/python3.8/site-packages/grapheneapi/api.py", line 46, in __init__
    self.connect()
  File "/home/user/.local/lib/python3.8/site-packages/grapheneapi/api.py", line 84, in connect
    raise(e)
  File "/home/user/.local/lib/python3.8/site-packages/grapheneapi/api.py", line 79, in connect
    self.connection.connect()
  File "/home/user/.local/lib/python3.8/site-packages/grapheneapi/websocket.py", line 28, in connect
    self.ws.connect(
  File "/home/user/.local/lib/python3.8/site-packages/websocket/_core.py", line 226, in connect
    self.handshake_response = handshake(self.sock, *addrs, **options)
  File "/home/user/.local/lib/python3.8/site-packages/websocket/_handshake.py", line 80, in handshake
    status, resp = _get_resp_headers(sock)
  File "/home/user/.local/lib/python3.8/site-packages/websocket/_handshake.py", line 166, in _get_resp_headers
    raise WebSocketBadStatusException("Handshake status %d %s", status, status_message, resp_headers)
websocket._exceptions.WebSocketBadStatusException: Handshake status 503 Service Unavailable
abitmore commented 3 years ago

See https://github.com/bitshares/python-bitshares/issues/298?

xloem commented 3 years ago

thanks !