Skip to content
This repository has been archived by the owner on Oct 20, 2023. It is now read-only.
Oliver Weichhold edited this page Dec 31, 2017 · 15 revisions

MiningCore exposes a simple REST API at http://localhost:4000. The primary purpose of the API is to power custom web-frontends for the pool.

Table of Contents

/api/pools

Returns configuration data and current stats for all configured pools.

Example Response:

{
  "pools": [{
      "id": "xmr1",
      "coin": {
        "type": "XMR"
      },
      "ports": {
        "4032": {
          "difficulty": 1600.0,
          "varDiff": {
            "minDiff": 1600.0,
            "maxDiff": 160000.0,
            "targetTime": 15.0,
            "retargetTime": 90.0,
            "variancePercent": 30.0
          }
        },
        "4256": {
          "difficulty": 5000.0
        }
      },
      "paymentProcessing": {
        "enabled": true,
        "minimumPayment": 0.01,
        "payoutScheme": "PPLNS",
        "payoutSchemeConfig": {
          "factor": 2.0
        },
        "minimumPaymentToPaymentId": 5.0
      },
      "banning": {
        "enabled": true,
        "checkThreshold": 50,
        "invalidPercent": 50.0,
        "time": 600
      },
      "clientConnectionTimeout": 600,
      "jobRebroadcastTimeout": 55,
      "blockRefreshInterval": 1000,
      "poolFeePercent": 0.0,
      "address": "9wviCeWe2D8XS82k2ovp5EUYLzBt9pYNW2LXUFsZiv8S3Mt21FZ5qQaAroko1enzw3eGr9qC7X1D7Geoo2RrAotYPwq9Gm8",
      "addressInfoLink": "https://explorer.zcha.in/accounts/9wviCeWe2D8XS82k2ovp5EUYLzBt9pYNW2LXUFsZiv8S3Mt21FZ5qQaAroko1enzw3eGr9qC7X1D7Geoo2RrAotYPwq9Gm8",      
      "poolStats": {
        "connectedMiners": 0,
        "poolHashRate": 0.0
      },
      "networkStats": {
        "networkType": "Test",
        "networkHashRate": 39.05,
        "networkDifficulty": 2343.0,
        "lastNetworkBlockTime": "2017-09-17T10:35:55.0394813Z",
        "blockHeight": 157,
        "connectedPeers": 2,
        "rewardType": "POW"
      }
    }]
}

/api/pool/<poolid>/stats/hourly

Returns pool stats for the last 24 hours (stats array contains 24 entries)

Example Response:

{
  "stats": [
    {
      "poolHashRate": 20.0,
      "connectedMiners": 12,
      "created": "2017-09-16T10:00:00"
    },
    {
      "poolHashRate": 25.0,
      "connectedMiners": 15,
      "created": "2017-09-16T11:00:00"
    },

    ...

    {
      "poolHashRate": 23.0,
      "connectedMiners": 13,
      "created": "2017-09-17T10:00:00"
    }
  ]
}

/api/pool/<poolid>/miner/<miner-wallet-address>/stats

Provides current stats about a miner on a specific pool

Example Response:

{
  "result": {
    "pendingShares": 19620248,
    "pendingBalance": 0,
    "totalPaid": 10.063098616616,
    "lastPayment": "2017-12-31T04:30:18.466801",
    "lastPaymentLink": "https://chainz.cryptoid.info/dash/tx.dws?5687227bc00a50e3cf057f2e943d8d50d719f1066dc0a156d8833a948cefbce8.htm",
    "performanceStats": [
      {
        "worker": "wd2070",
        "hashrate": 20419772562,
        "sharesPerSecond": 0.06916666666666667,
        "created": "2017-12-31T11:35:02.529165"
      },
      {
        "worker": "wd2069",
        "hashrate": 19711331567,
        "sharesPerSecond": 0.06833333333333333,
        "created": "2017-12-31T11:35:02.529165"
      },
      ...
      {
        "worker": "wd2001",
        "hashrate": 18632074607,
        "sharesPerSecond": 0.07833333333333334,
        "created": "2017-12-31T11:35:02.529165"
      }
    ]
  },
  "success": true,
  "responseMessageType": 0,
  "responseMessageId": null,
  "responseMessageArgs": null
}

/api/pool/<poolid>/blocks

Returns information about blocks mined by the pool. Results can be paged by using the page and pageSize query parameters

http://localhost:4000/api/pool/xmr1/blocks?page=2&pageSize=3

Example Response:

[
  {
    "blockHeight": 197,
    "status": "pending",
    "effort": 1.4,
    "confirmationProgress": 0.3,
    "transactionConfirmationData": "6e7f68c7891e0f2fdbfd0086d88be3b0d57f1d8f4e1cb78ddc509506e312d94d",
    "reward": 17.558881241740,
    "infoLink": "https://xmrchain.net/block/6e7f68c7891e0f2fdbfd0086d88be3b0d57f1d8f4e1cb78ddc509506e312d94d",
    "created": "2017-09-16T07:41:50.242856"
  },
  {
    "blockHeight": 196,
    "status": "confirmed",
    "effort": 0.85,
    "confirmationProgress": 1,
    "transactionConfirmationData": "bb0b42b4936cfa210da7308938ad6d2d34c5339d45b61c750c1e0be2475ec039",
    "reward": 17.558898015821,
    "infoLink": "https://xmrchain.net/block/bb0b42b4936cfa210da7308938ad6d2d34c5339d45b61c750c1e0be2475ec039",
    "created": "2017-09-16T07:41:39.664172"
  },
  {
    "blockHeight": 195,
    "status": "orphaned",
    "effort": 2.24,
    "confirmationProgress": 0,
    "transactionConfirmationData": "b9b5943b2646ebfd19311da8031c66b164ace54a7f74ff82556213d9b54daaeb",
    "reward": 17.558914789917,
    "infoLink": "https://xmrchain.net/block/b9b5943b2646ebfd19311da8031c66b164ace54a7f74ff82556213d9b54daaeb",
    "created": "2017-09-16T07:41:14.457664"
  }
]

/api/pool/<poolid>/payments

Returns information about payments issued by the pool. Results can be paged by using the page and pageSize query parameters. Note: transactionConfirmationData is usually the blockchain transaction id.

http://localhost:4000/api/pool/xmr1/payments?page=2&pageSize=3

Example Response:

[
  {
    "coin": "XMR",
    "address": "9wviCeWe2D8XS82k2ovp5EUYLzBt9pYNW2LXUFsZiv8S3Mt21FZ5qQaAroko1enzw3eGr9qC7X1D7Geoo2RrAotYPwq9Gm8",
    "addressInfoLink": "https://xmrchain.net/addr/9wviCeWe2D8XS82k2ovp5EUYLzBt9pYNW2LXUFsZiv8S3Mt21FZ5qQaAroko1enzw3eGr9qC7X1D7Geoo2RrAotYPwq9Gm8",
    "amount": 7.5354,
    "transactionConfirmationData": "9e7f68c7891e0f2fdbfd0086d88be3b0d57f1d8f4e1cb78ddc509506e312d94d",
    "transactionInfoLink": "https://xmrchain.net/tx/9e7f68c7891e0f2fdbfd0086d88be3b0d57f1d8f4e1cb78ddc509506e312d94d",
    "created": "2017-09-16T07:41:50.242856"
  }
]
Clone this wiki locally