iov-one / iov-core

Client library for secure key management and multi-blockchain communication
https://iov-one.github.io/iov-core-docs/
Apache License 2.0
198 stars 18 forks source link

Use reconnectedHandler in Tendermint #1200

Open webmaster128 opened 5 years ago

webmaster128 commented 5 years ago

Looks like we closed https://github.com/iov-one/iov-core/issues/229 a bit too early. We now have ReconnectingSocket, which accepts a reconnectedHandler. However, this handler is never used.

What we need for https://github.com/iov-one/ponferrada/issues/14 is clients that keep track of subsciptions they have. As soon as the socket reconnects, those subscriptions need to be recreated. This affects WebsocketClient from the Tendermint package and WsEthereumRpcClient.

This is needed for the browser extension to track transaction state after postTx. For Ethereum we use polling in this case, so this is lower priority. But in case of BNS, we use both transaction and block subscriptions in postTx, so this is needed for https://github.com/iov-one/ponferrada/issues/14.

  1. Use reconnectedHandler in Tendermint (this ticket)
  2. Use reconnectedHandler in Ethereum (https://github.com/iov-one/iov-core/issues/1204)
webmaster128 commented 5 years ago

Extracted https://github.com/iov-one/iov-core/issues/1204 out of this one