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 websocket listener for receipts added to the ethconnect receipt store #111

Open
peterbroadhurst opened this issue Apr 27, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@peterbroadhurst
Copy link
Contributor

peterbroadhurst commented Apr 27, 2021

Currently callers have to poll for /replies that contain the asynchronous responses to kld-sync=false requests.

We now have a WebSocket interface on ethconnect, which can be used (as an alternative to Webhooks) to listen for events emitted from smart contracts.

It would be great to be able to use this same interface to listen for the TransactionSuccess/TranscationFailure events as they arrive in the receipt store, to more immediately trigger downstream processing.

There's a little complexity here, that we would need a way to "subscribe" a WebSocket topic to receive the events.
One option would be a new type of subscription that is connected to the replies, rather than the blockchain:
https://github.com/kaleido-io/ethconnect/blob/3cbf3daa386eee0eaeae56f03a3923f1b89bc923/internal/kldevents/subscription.go#L44-L54

However, that would be quite a big lift in the model.

Another option would be something much lighter weight such as a new REST operation like POST /replies/listen , that took a new payload with topic inside it, and just kept pumping replies down there until the ethconnect process restarted.
This would mean it would be necessary for the app to re-listen every time, which might lead to missed events while the app is disconnected.

@peterbroadhurst peterbroadhurst added the enhancement New feature or request label Apr 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants