I will try to explain it briefly. I'm using Promise API to connect to few different RPCs (ws). Also I'm listening to an event connected on each websocket provider. When all providers are connected I call res to resolve my new promise that returns in my connectRpcs
function. Then in other function I call:
await ApiPromise.create({ provider })
and wait until ApiPromise.create
resolves for each provider. When all providers and APIs are set up I'm trying to call api.query.system.account
for some rpc from the list and the rpc throws the error:
RPC-CORE: queryStorageAt(keys: Vec<StorageKey>, at?: BlockHash): Vec<StorageChangeSet>:: cannot call send() while not connected
I logged provider.isConnected
for each provider and it returns true
. Why provider says that I'm not connected to the rpc? any guesses? I can share code in hastebin
to clarify some points.