I am trying to program my own miner using a node.js server (this is for learning/exploration, not profitability).
I am subscribed to a monero pool socket and am receiving jobs like this:
{ jsonrpc: '2.0',
method: 'job',
params:
{ blocktemplate_blob: '07078286e9da05f1...',
difficulty: 51779148158,
height: 1625346,
reserved_offset: 128,
client_nonce_offset: 140,
client_pool_offset: 136,
target_diff: 5000,
job_id: 'gJrlffjmKa7b/thYkVFuioukLzf/',
id: '294f72b5-638f-4915-90ae-67db09dd4212' } }
I am trying to understand the next steps from here. My understanding is that I hash the blob + nonce (which is a random number?), see if the hash is below difficulty
, and repeat with different nonces.
I have a few questions about this.
- Is there a programmatic example of this being done? I found a function called
processShare
here where they verify if a resultHash is correct. But with all their classes, buffers, threads, etc its hard to actually understand what's happening. - Is documentation on the returned variables anywhere? What is
hieght
? I think I understanddifficulty
, buttarget_diff
? - Is there perhaps an example blob, nonce, and difficulty for a successful share that I can test with?
Realize I'm asking for a lot of info here. If you can help me out, feel free to PM me and I'd be happy to donate to your wallet.