Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for subscriptions #49

Closed
ethanfrey opened this issue Feb 5, 2020 · 7 comments
Closed

Add support for subscriptions #49

ethanfrey opened this issue Feb 5, 2020 · 7 comments

Comments

@ethanfrey
Copy link
Contributor

We should expose some sort of subscription listener to the RestClient and use it in the CosmWasmConnection. In particular, for full bcp-compatibility, we need to implement:

  • watchBlockHeaders
  • watchAccount

And postTx could be done nicer with a subscription that with a poll.

I believe these are needed for dropping in CosmWasmConnection into the iov-wallet

@ethanfrey
Copy link
Contributor Author

Apparently it is not possible to subscribe with the rest server, only via tendermint rpc. Got this response from a lunie wallet dev:

It is not possible to subscribe via the rest server. (frequently requested feature by me :D).

@ethanfrey ethanfrey added the on hold Good to do sometime, but don't worry about it now (revisit these every month) label Feb 5, 2020
@webmaster128 webmaster128 removed the on hold Good to do sometime, but don't worry about it now (revisit these every month) label Feb 5, 2020
@webmaster128
Copy link
Member

Let's just do polling like in the Lisk connector. That brought us quite far and is way more stable than websockets.

@ethanfrey
Copy link
Contributor Author

Okay

@webmaster128
Copy link
Member

What would also work is a hybrid, where you use a tendermint socker subscribtion to get notified about new data. When you receive a new transaction, you ignore the amino data and pull via REST.

@ethanfrey
Copy link
Contributor Author

Yes, I like this. I think we did some of this at iov. Just have a stream of "update happened" from the subscription service. And those events trigger a rest call to get the data.

I can look into proper tendermint subscription queries, but that would also require a second url and connection (maybe optional?)

@webmaster128
Copy link
Member

For wallet integration we need watchAccount and liveTx. The first one is easy. The second one can be implemented like Lisk. This is horribly inefficient without min/max height search filters, but those will be available soon.

@webmaster128
Copy link
Member

Closing since the BCP implementation is moving out of here and subscriptions will get their comeback in a couple of weeks when we successfully communicate with Tendermint.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants