decred / gominer

Go (golang) based GPU miner for Decred.
GNU General Public License v3.0
160 stars 80 forks source link

Implementing Remote Status API #165

Closed gabrielboliveira closed 6 years ago

gabrielboliveira commented 7 years ago

Closes #163.

Tested on macOS 10.12.6, golang 1.8.3, building with OpenCL @ MacBook Pro.

Example of JSON output:

{
    "validShares": 0,
    "staleShares": 0,
    "invalidShares": 0,
    "totalShares": 0,
    "sharesPerMinute": 0,
    "started": 1502252670,
    "uptime": 3,
    "devices": [
        {
            "index": 0,
            "deviceName": "Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz",
            "deviceType": "CPU",
            "hashRate": 0,
            "hashRateFormatted": "0H/s",
            "fanPercent": 0,
            "temperature": 0,
            "started": 1502252664
        },
        {
            "index": 1,
            "deviceName": "Iris Pro",
            "deviceType": "GPU",
            "hashRate": 0,
            "hashRateFormatted": "0H/s",
            "fanPercent": 0,
            "temperature": 0,
            "started": 1502252666
        },
        {
            "index": 2,
            "deviceName": "GeForce GT 750M",
            "deviceType": "GPU",
            "hashRate": 0,
            "hashRateFormatted": "0H/s",
            "fanPercent": 0,
            "temperature": 0,
            "started": 1502252668
        }
    ],
    "pool": {
        "started": 1502252670,
        "uptime": 3
    }
}
jcvernaleo commented 7 years ago

@jolan I made a few comments on this but overall it looks pretty good if you want to take a look at it in the near future too.

gabrielboliveira commented 7 years ago

@jcvernaleo Thanks! I'll sure add a section about this on README.

jolan commented 7 years ago

Unfortunately, I've been busy with higher priority projects and haven't had time to give it more than a quick look.

gabrielboliveira commented 7 years ago

@jolan @jcvernaleo

I've updated with the multi-address implementation.

I've also updated the README to add the status API example, and also I improved a little bit the Building section, just a few topics fixes.

gabrielboliveira commented 6 years ago

@jolan I agree with the warning message, but I'm not sure if it would be good to auto change the default port.

What you think on disabling auto-start? Monitor disabled by default.

jolan commented 6 years ago

That sounds good to me.

dajohi commented 6 years ago

@gabrielboliveira status?

gabrielboliveira commented 6 years ago

@dajohi Not able to fix it during these weeks, working hard. Probably this weekend I'll be able to fix :)

gabrielboliveira commented 6 years ago

@jolan @dajohi Fixed. Now it will warn if the monitor doesn't start up, and it will not autostart

jolan commented 6 years ago

Thank you for your contribution.