Skip to main content

login

Opens a session on the daemon's legacy remote-mining protocol and optionally returns a first mining job — this is a miner-facing method superseded by Stratum support, not a wallet or user authentication call.

Request

{
"jsonrpc": "2.0",
"id": 0,
"method": "login",
"params": {
"login": "miner1",
"pass": "x",
"agent": "nirmata-miner/1.0.0",
"hi": {
"height": 2114936,
"block_id": "e8f2b0c1d7a34965b1c0e2d3f4a5b6c7d8e9f0a1b2c3d4e5f60718293a4b5c6d"
}
}
}

Request parameters

  • login - string; miner login name. The daemon currently accepts any value, since credential checking is not implemented in this legacy protocol.
  • pass - string; miner password. Also unchecked by the daemon.
  • agent - string; free-form identifier of the mining software, e.g. its name and version.
  • hi - object; the top of the chain as the miner currently sees it. When hi.height is non-zero the daemon builds a job and returns it in the response; when hi.height is zero it only opens the session and returns an empty job.
    • height - unsigned integer; height of the block the miner considers to be the chain tip.
    • block_id - string; hex-encoded hash of that block.

Response

{
"id": 0,
"jsonrpc": "2.0",
"result": {
"id": "7",
"job": {
"blob": "0300000000000000e300c4a5d9a30600020100b8560416ab8369d10446e568bb09e692f8",
"difficulty": "184467440737",
"job_id": "SOME_JOB_ID",
"prev_hi": {
"height": 2114936,
"block_id": "e8f2b0c1d7a34965b1c0e2d3f4a5b6c7d8e9f0a1b2c3d4e5f60718293a4b5c6d"
},
"addms": []
},
"status": "OK"
}
}

Response information

  • id - string; the session identifier assigned to this miner. It must be passed as id to subsequent getjob and submit calls, since the daemon keeps the block template for the session under this key.
  • job - object; the first mining job, present only when hi.height in the request was non-zero. Otherwise all of its fields are empty.
    • blob - string; hex-encoded block hashing blob to be hashed by the miner.
    • difficulty - string; the job's difficulty as a decimal string. It is a string rather than a number because the value can exceed the range of a 64-bit integer.
    • job_id - string; identifier of the job, to be echoed back in submit.
    • prev_hi - object; the chain tip the job was built on, with the same height and block_id fields as the request's hi.
    • addms - array of objects; chain addenda describing blocks the miner may be missing. Each entry has hi (a height/block_id pair), prev_id (hex-encoded hash of the preceding block) and addm (hex-encoded addendum blob). Normally empty.
  • status - "OK" on success; "BUSY" if the daemon is still synchronizing with the network (see Daemon RPC API). If the job could not be built, status carries the error message describing why instead.