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

Create websocket subscription for active_difficulty changes #2080

Closed
zhyatt opened this issue Jun 13, 2019 · 4 comments
Closed

Create websocket subscription for active_difficulty changes #2080

zhyatt opened this issue Jun 13, 2019 · 4 comments

Comments

@zhyatt
Copy link
Collaborator

zhyatt commented Jun 13, 2019

Currently the active_difficulty RPC must be polled to monitor changes in work difficulty seen on the network. To assist integrations managing work generation efforts external to the node, add a new websocket subscription for active_difficulty.

This requires creation of a new observer set that would monitor and fire notifications with each cycle of difficulty changes (16-36sec depending on network conditions). These notifications should include the same details as found in the active_difficulty RPC - network_minimum, network_current and multiplier.

A single subscription without additional options for this should work.

@zhyatt
Copy link
Collaborator Author

zhyatt commented Jun 13, 2019

@guilhermelawless

@zhyatt
Copy link
Collaborator Author

zhyatt commented Jun 14, 2019

Thanks for offering help on this @chrislinegar.

@chrislinegar
Copy link
Contributor

Hi @guilhermelawless, I've submitted a PR with a first pass at this: #2091

I couldn't add a reviewer on the PR though, is this something you'd be able to have a look at?

Thanks in advance!

@zhyatt zhyatt modified the milestones: V20.0, V19.0 Jun 28, 2019
@zhyatt
Copy link
Collaborator Author

zhyatt commented Jun 28, 2019

Solved with #2091 and #2109

@zhyatt zhyatt closed this as completed Jun 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants