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

[Meta] Add asynchronous APIs #5455

Open
hackaugusto opened this issue Dec 6, 2019 · 1 comment
Open

[Meta] Add asynchronous APIs #5455

hackaugusto opened this issue Dec 6, 2019 · 1 comment
Labels
Component / API Issues that relate the the APIs Raiden provides.

Comments

@hackaugusto
Copy link
Contributor

Abstract

Currently we provide a very simple model, the HTTP request blocks until the operation is known to be safely finished, or error.

This means that REST requests that result in chain transactions will block until the transaction is mined and confirmed, which can take a little while.

Motivation

The above approach is fine for some use cases, however it lacks visibility on what is happening in Raiden node. To improve the visibility of the system the API has to move away from blocking for the complete operation, and return data more often to the API user.

For transactions that means that once a transaction is sent the tx_hash can be returned to the client, and once the transaction is mined the result of the operation can be returned.

There are two models we can use, one that pushes notifications through a socket, e.g. a websocket. Another model is to use long polling. Infrastructure wise both model should be very similar.

@lullis
Copy link
Contributor

lullis commented Feb 24, 2022

An interim solution would be to keep the existing API, but provide an extra endpoint that could provide server-side events, or any other form of asynchronous server -> client communication.

This would allow the developers to make the changes piecemeal, or only for the points of interested for other consumers of the API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component / API Issues that relate the the APIs Raiden provides.
Projects
None yet
Development

No branches or pull requests

3 participants