Nano-node: Create websocket subscription for active_difficulty changes

Created on 13 Jun 2019  路  4Comments  路  Source: nanocurrency/nano-node

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.

external collaborator helping

Most helpful comment

Thanks for offering help on this @chrislinegar.

All 4 comments

@guilhermelawless

Thanks for offering help on this @chrislinegar.

Hi @guilhermelawless, I've submitted a PR with a first pass at this: https://github.com/nanocurrency/nano-node/pull/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!

Solved with #2091 and #2109

Was this page helpful?
0 / 5 - 0 ratings

Related issues

liuhailin picture liuhailin  路  5Comments

starrynightglider picture starrynightglider  路  5Comments

sacreman picture sacreman  路  6Comments

BitDesert picture BitDesert  路  6Comments

cryptocode picture cryptocode  路  4Comments