getjob
Requests the current mining job for an open session of the daemon's legacy remote-mining protocol, which has been superseded by Stratum support.
Request
{
"jsonrpc": "2.0",
"id": 0,
"method": "getjob",
"params": {
"id": "7",
"hi": {
"height": 2114936,
"block_id": "e8f2b0c1d7a34965b1c0e2d3f4a5b6c7d8e9f0a1b2c3d4e5f60718293a4b5c6d"
}
}
}
Request parameters
- id - string; the session identifier returned by
login. The daemon stores the session's block template under this key. - hi - object; the top of the chain as the miner currently sees it, used by the daemon to decide whether the miner needs a fresh 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.
ㅤ
Job generation is currently disabled in the daemon's getjob handler, so a successful call returns an empty result rather than a new job. Obtain a job from the login response instead, or use Stratum.
Response
{
"id": 0,
"jsonrpc": "2.0",
"result": {
"blob": "0300000000000000e300c4a5d9a30600020100b8560416ab8369d10446e568bb09e692f8",
"difficulty": "184467440737",
"job_id": "SOME_JOB_ID",
"prev_hi": {
"height": 2114936,
"block_id": "e8f2b0c1d7a34965b1c0e2d3f4a5b6c7d8e9f0a1b2c3d4e5f60718293a4b5c6d"
},
"addms": [],
"status": "OK"
}
}
Response information
The job's fields are inlined directly into the result object rather than nested under a separate key.
- 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
heightandblock_idfields as the request'shi. - 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) andaddm(hex-encoded addendum blob). Normally empty. - status - "BUSY" if the daemon is still synchronizing with the network (see Daemon RPC API). Because job generation is disabled, a call made on a synchronized node currently returns an empty
statusalongside empty job fields.