selaux / miner-dashboard

Node.js based app to show the current status of your miner in a browser.
35 stars 15 forks source link

Stratum proxy aggregator #59

Open smurfy opened 9 years ago

smurfy commented 9 years ago

Hi,

i really like the dashboard, but as a hobby miner i'm running some LTC miners which supports no remote api to query their status.

So my idea was why not use a stratum proxy module, where the miner connects and then the module connects to the actual pool server. All stratum messages would be simply relayed.

Of course this will not provide all the information you would get from the cgminer api for example the HW errors, but still be able to show the hashrate and notify you if a miner goes down.

Also i think the proxy module should listen only on one port but still be able to support multiple miners. (and display the separately in the frontend)

So the user could create multiple proxy module instances either to support multiple currencies or for multiple pools.

I guess even a pool fallback or round robin could be possible later-on.

What do you think?

smurfy commented 9 years ago

Commited a first prototype in my fork.

selaux commented 9 years ago

The concept is really interesting. I like the idea of proxying the traffic and exposing details about it. One thing I dislike though is that when the monitoring solution crashes, the miners will be disconnected from the pool (if you dont have a fallback).

Have you thought about creating a separate project? This would be a stratum proxy with some kind of api (e.g. websockets) to get information about the connected devices. The part you then could contribute to miner-dashboard would be a binding to this API.

This does not mean I wouldn't accept you PR, if that is the direction you prefer. The prototype looks promising and I will test it out (but first I have to find my mining hardware).

smurfy commented 9 years ago

I started with a standalone proxy to test if it actually would work. Then i integrated it to miner-dashboard.

I thought about creating something standalone and for example support a cgminer compatible api. But this won't work, i would need a separate api for that to return all needed fields. (they differ from cgminer) So i went with integrating it. Maybe i will pick the standalone idea up again.

Also if the proxy crashes it's the same as if the monitor goes down. But i get that the monitor should only monitor, not the cause of something goes down, just because monitoring fails.

I will create a PR, with some documentation, as soon i think it's read. (i'm currently still working on it) Most work is done, error handling is still missing and i'm working on optimizing the output.

smurfy commented 9 years ago

Sample screenshot:

Sample screensho