WyvernTKC / cpuminer-gr-avx2

Optimised Version of GR miner for RTM
GNU General Public License v2.0
371 stars 193 forks source link

API is poor. Based on http 0.9 #84

Open maxkrukov opened 3 years ago

maxkrukov commented 3 years ago

API is bad and without documentation. Could you please improve it? Json will be great.

root@mining-rig01:~/cpuminer# cat <(curl --silent --http0.9  192.168.5.4:5555/summary) | tr ';' '\n'; echo
NAME=cpuminer-opt-gr
VER=1.2.4.1
API=1.0
ALGO=gr
CPUS=24
URL=/eu.flockpool.com:5555
HS=3089.89
KHS=3.09
ACC=21
REJ=0
SOL=0
ACCMN=3.600
DIFF=3.758077
TEMP=75.5
FAN=0
FREQ=4200124
UPTIME=350
TS=1636920060|
root@mining-rig01:~/cpuminer#
GBDownUnder commented 3 years ago

There is an API? How do I enable it? I just want to use it to monitor if a rig stops mining!

maxkrukov commented 3 years ago
{
  "_comment1": "Any long-format command line argument ",
  "_comment2": "may be used in this JSON configuration file",

  "url": "stratum+tcps://eu.flockpool.com:5555",

  "_comment3": "Backup/failover stratum used in case of connection problems",
  "url-backup": "stratum+tcps://us-west.flockpool.com:5555",

  "user": "RTNFGdSByi8gdAqeao7QFGj7z8EpHYMd5W.desktop",
  "pass": "x",

  "algo": "gr",
  "threads": 0,

  "_comment4": "tune-full takes longer but should provide better hashrate",
  "tune-full": true,

  "_comment5": "You can specify different name/location for your tune config",
  "tune-config": "tune_config",

  "_comment6": "You can force miner to not tune. It tunes by default",
  "_comment7": "Or force it even if tune-config file already exists",
  "no-tune": false,
  "force-tune": false,

  "_comment8": "\"log\": \"filename\" can be used to create logfile of output",
  "benchmark": false,
  "stress-test": false,
  "quiet": false,
  "api-bind": "0.0.0.0:5555",
  "api-remote": true
}

I`ve done prometheus exporter with grafana for it. But only some metrics work correctly. image

GBDownUnder commented 3 years ago

Cool, so I can see the API port is open on the rig now, but I can't get an api response in a browser. What's a URL that should work. I tried http://rigIP:port/summary based on your first post but still get nothing (I used the actual IP and port number of course

GBDownUnder commented 3 years ago

ok, from your issue of http version I tried IE, and yep I see a response. I can't see one in Chome of Firefox. I worked out how to monitor just for the port being open which is enough :) Thanks PS: Yeah I agree the API implementation is super sucky

maxkrukov commented 3 years ago

If somebody needs prometheus-exporter for current cpuminer version: https://github.com/maxkrukov/raptoreum-exporter.git

adekkpl commented 3 years ago

Works great on Win10 and Win11, but in both situation does not work in any browser ... typing cmd in wsl works great :)

NAME=cpuminer-opt-gr VER=1.2.4.1 API=1.0 ALGO=gr CPUS=6 URL=/eu.flockpool.com:5555 HS=268.79 KHS=0.27 ACC=0 REJ=0 SOL=0 ACCMN=0.000 DIFF=6.522863 TEMP=0.0 FAN=0 FREQ=0 UPTIME=42 TS=1638127970|

but have no cpu info on both miners Win10 and Win11... it depends on OS or how does it get this data? On Win11 I have installed HWINFO and HWMONITOR because thought it uses API from programs like this monitors?

maxkrukov commented 3 years ago

It depends on your OS drivers and motherboard. I use linux in all cases. And I have correct temp only for asus motherboard. msi shows me +20 to real temp. Gigabyte shows uncorrect data at all and it`s bios is very bad for overclocking.