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

feat: support tracking consensus updates in helios-ts #302

Open
rdvorkin opened this issue Nov 20, 2023 · 4 comments
Open

feat: support tracking consensus updates in helios-ts #302

rdvorkin opened this issue Nov 20, 2023 · 4 comments

Comments

@rdvorkin
Copy link

Support in some way tracking and getting notified when a new update is applied. The usecase I want to implement is setting a hook on new optimistic update, to do some action (For example, re-check a list of balances) when the update is applied.

Implementing something like https://nodejs.org/api/events.html#emitteroneventname-listener would be ideal, however even a function returning the current status (latest update applied, current block etc) would be great.

@ncitron
Copy link
Collaborator

ncitron commented Nov 22, 2023

Would something that mimics the websocket block subscription api make sense here potentially?

@rdvorkin
Copy link
Author

@ncitron Yeah I suppose so, could you link an example of how that would look like?

@ncitron
Copy link
Collaborator

ncitron commented Nov 22, 2023

The eth_subscribe rpc method with the newHeads subscription type I think would make sense. We don't support these right now, but would something sort of inspired by this where you get new head blocks as they come work?

https://docs.alchemy.com/reference/newheads

@rdvorkin
Copy link
Author

@ncitron Yes this seems perfect!

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