nimiq / mining-pool

Nimiq Mining-Pool Server
Apache License 2.0
39 stars 34 forks source link

Add DeviceData and eventHandlers.js #14

Open ryan-rowland opened 6 years ago

ryan-rowland commented 6 years ago

@mar-v-in Based on our conversation around https://github.com/nimiq-network/developer-reference/pull/24

This PR does a few things: 1) Adds knowledge of deviceData to PoolAgent 2) Adds public read-only properties to PoolAgent, since we will now be exposing it to pool owners. Properties are: deviceId, deviceLabel, mode, isRegistered 3) Added eventHandlers.sample.js and support for eventHandlers.js which allows pool owners to easily add handlers for events. I started with onRegister and beforeRegister but this can be expanded on.

ryan-rowland commented 6 years ago

@mar-v-in Addressed your concerns.

ryan-rowland commented 6 years ago

Thanks @mar-v-in, addressed second round of comments.

Zolmeister commented 6 years ago

This feels like it should be middleware.js (instead of having events trigger side-effects)