Closed biobdeveloper closed 4 years ago
await bitshres_instance.connect()
which I fixed.Why this is a wrong way:
await bitshares_instance.connect()
instantiates an RPC instance (Websocket or Http). bitshares_instance.rpc.url = ...
await bitshares_instance.connect()
with initial url, e.g. step 2 is just lost.Correct way should be
bitshares_instance = BitShares(node="wss://node_1")
await bitshares_instance.connect()
bitshares_instance.rpc.url = "wss://node_2"
await bitshares_instance.rpc.connect()
But I wonder why you're not using multiple nodes and next()
call?
nodes = ['wss://node_1', 'wss://node_2']
bitshares_instance = BitShares(node=nodes)
await bitshares_instance.connect()
await bitshares_instance.rpc.next() # switch node
But if I need to switch determined node, what I need to do? Seems like .rpc.next() just iterate over list, without choosing node by user
Then use "correct way" solution.
I try to change node in connected aio.bitshares instance, but receive an error: