Skip to content

Instantly share code, notes, and snippets.

@urza
Last active February 20, 2019 15:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save urza/7b6627f39f37600e3ca27a8bdd51fbe6 to your computer and use it in GitHub Desktop.
Save urza/7b6627f39f37600e3ca27a8bdd51fbe6 to your computer and use it in GitHub Desktop.

GrinPro.io miner local API documentation

When GrinPro.io miner starts mining it also starts listening on http://0.0.0.0:5777 The port can be changed by argument "api-port" at startup e.g. ./GrinProMiner api-port=6666 Four zeroes in the listening IP address means, that it can be accessed also from other computers on the network, not just localhost. So it may look something like http://192.168.1.113:5777 depending on your IP address.

The root URL returns simple HTML dasboard with basic info about the miner.

grinprodashboardsm

API itself is accesible on /api and returns JSON responses for following requests. Date+time is formatted as string according to local culture on the machine where miner is running.

Get basic status and mining information:

/api/status

sample response:

{
   "connectionAddress": "some.pool.com:4416",
   "connectionStatus": "Connected",
   "lastJob": "2019-02-20T16:18:48+01:00",
   "lastShare": "2019-02-20T16:18:48+01:00",
   "shares": {
	   "found": 244,
	   "submitted": 66,
	   "accepted": 65,
	   "tooLate": 1,
	   "failedToValidate": 0
	},
	"workers": [
      {
	      "id": 0,
	      "status": "ONLINE",
	      "graphsPerSecond": 3.19306469,
	      "fidelity": 1.0042,
	      "totalSols": 244,
	      "lastSolution": "2019-02-20T16:18:48+01:00"
      }
   ]
}

Get informations about Stratum Connections:

/api/connections

Will list primary and secondary pool/stratum connections.

Currently active connection where shares are send:

/api/connections/active
{
	"address": "eu.pool.com",
	"port": "4416",
	"status": "Connected",
	"login": "login@example.com",
	"password": "",
	"lastCommunication": "2019-02-20T16:18:48+01:00",
	"lastJob": "2019-02-20T16:18:48+01:00"
}

You can also change active connection to new one by calling

[POST]:/api/connections/active

with body like this:

{
	"ConnectionAddress" : "us.stratum.pool.com",
	"ConnectionPort" : 4416,
	"Ssl" : true,
	"Login" : "login@example.com",
	"Password" : ""
}

When connection changes succesfully you will get 200/OK response:

New connection is active. Check by calling /api/connection/active

Information about workers (GPUs)

/api/workers

response:

[
   {
      "gpuStatus": "ONLINE",
      "graphsPerSecond": 3.20439076,
      "fidelity": 0.9972,
      "totalSols": 271,
      "lastLog": null,
      "id": 0,
      "time": "2019-01-22T23:00:58.9248191+01:00",
      "gpuOption": {
         "gpuName": "GeForce GTX 1070",
         "gpuType": 20,
         "deviceID": 0,
         "platformID": 0,
         "enabled": true
         },
      "lastSolution": "2019-01-22T23:00:51.657878+01:00",
      "errors": 0
   }
]

Information about individual worker:

/api/workers/{id}

You can read information about current config that is loaded in memory:

/api/config
{
   "primaryConnection": {
      "connectionAddress": "mining.pool.com",
      "connectionPort": 4416,
      "ssl": true,
      "login": "login@example.com",
      "password": ""
   },
      "secondaryConnection": {
      "connectionAddress": "backup.pool.com",
      "connectionPort": 4416,
      "ssl": true,
      "login": "login@example.com",
      "password": ""
   },
   "logOptions": {
      "fileMinimumLogLevel": 2,
      "consoleMinimumLogLevel": 1,
      "keepDays": 0,
      "disableLogging": false
   },
   "cpuOffloadValue": 0,
   "gpuOptions": [
      {
         "gpuName": "GeForce GTX 1070",
         "gpuType": 20,
         "deviceID": 0,
         "platformID": 0,
         "enabled": true
      }
   ]
}

You can also send new config that overrides the one in disk by sending:

POST: /api/config

with body that has the same structure like the response from reading config.

Please note that this will not change active configuration currently in memory and will take effect only after miner reboot. (Automatic reboot not supported at this time)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment