API ADDRESS

http://api.diskcoin.io

HTTP API

Submit miner report data interface

Submit up to 1000 blocks of data at a time, and save only the latest 1000 blocks of data for submitted data. This operation takes about 0~60s depending on the amount of data submitted. - method POST - path cheater/miner/info/submit/ - the body of the post request is a json format string with the following structure and must be strictly followed, otherwise the request will be rejected.

{
   "apikey": "ECBC74EC6C191B3F415559EC6241116E",  # pool's apikey
   "data": {
      # data is the key-value pair type data, the key is the block height, and the 
      value is a list, including all data reported by the miner equal to the height.
      "1": [
         {
            "pid": "id1",     # plotter id,string type
            "deadline": 1111  # deadline,number type
         },
         {
            "pid": "id2",
            "deadline": 1111
         },
         ...
      ],
      "2": [
         {
            "pid": "id3",
            "deadline": 2222
         },
         {
            "pid": "id4",
            "deadline": 2222
         },
         ...
      ]
   }
}
- Returns: code: success is 0, otherwise -1 message:return success if success, return the reason for failure if it fails result:if the submitted data is not the latest 1000 height, or a height data is repeatedly submitted, it will be discarded, here is the height array of discarded data. - example
// requests
http://api.diskcoin.io/cheater/miner/info/submit/
body:
   {
   "apikey": "ECBC74EC6C191B3F415559EC6241116E",
   "data": {
      "1": [
            {
               "pid": "622226",
               "deadline": 66666
            },
            {
               "pid": "622227",
               "deadline": 77777
            }
         ],
      "2": [
            {
               "pid": "622226",
               "deadline": 1111
            },
            {
               "pid": "622227",
               "deadline": 2222
            }
         ]
   }
}
// return
{
   "code": 0,
   "message": "success",
   "result": [
      1,
      2     # the data representing the heights 1 and 2 has been discarded.
   ]
}

Get cheating PID based on height

  • method get
  • path cheater/pid/get/
  • paremeter apikey:pool's apikey height:block height
  • return code:success is 0, otherwise -1 message:return success if success, return the reason for failure if it fails result:the list of cheating PIDs, structured as follows:

    [
       {
          "pid": "id1",      # plotter id
          "type": 1,         # Cheating type, default is 1
          "pool": [          # List of mine pool names that the pid joined
             "poolx",
             "pooly"
          ]
       },
       ...
    ]
    

  • example

    // request
    http://api.diskcoin.io/cheater/pid/get/?apikey=ECBC74EC6C191B3F415559EC6241116E&height=100
    // return
    {
       "code": 0,
       "message": "success",
       "result": [
          {
                "pid": "655557",
                "type": 1,
                "pool": [
                   "poolx",
                   "pooly"
                ]
          },
          {
                "pid": "655558",
                "type": 1,
                "pool": [
                   "poolx",
                   "pooly"
                ]
          }
       ]
    }