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

[Feature]: Block streaming endpoint #341

Open
polydez opened this issue May 3, 2024 · 1 comment
Open

[Feature]: Block streaming endpoint #341

polydez opened this issue May 3, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@polydez
Copy link
Contributor

polydez commented May 3, 2024

To whom is this feature for?

App developer

Why is is this feature needed?

For block indexer/explorer developers It might be useful to be able to obtain new blocks not by using polling, but connecting to a streaming endpoint and receive every new block once it is ready. This also can speed up consumer synchronization from the first block to current, if the blockchain has been running for a long time.

How is this feature used?

Developer requests blocks starting from the given number, this establishes streaming connection using native gRPC streaming support.

Anything else?

No response

@polydez polydez added the enhancement New feature or request label May 3, 2024
@bobbinth
Copy link
Contributor

bobbinth commented May 3, 2024

I guess there are a couple of options here:

  1. The endpoint takes the block_num as input and streams all blocks starting at that number until the current block.
  2. The connection stays open and the user streams blocks as they are created.
  3. (we could also combine the two).

I'm not sure about the complexities (and implications) of the second option - so, don't have a good sense which option we should go with.

Also, regardless of the option, we probably should think about some kind of DoS prevention mechanism as this endpoint can result in returning lots of data. This would probably be related to #52.

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
Status: No status
Development

No branches or pull requests

2 participants