2

I'm trying to get a handle on how the protocol works between Monero miners and pools. Although I've looked at Stratum, the rules seem slightly different with Monero mining. For example, I'm using a CryptoNoter tool (derived from Coinhive) and when it subits a share to the pool the request looks like the below

{"type":"submit", "params":{"job_id":"966964311173375", "nonce":"9be9fff4", "result":"40ff373cd53535952c5b195f5fafeaeb632ed5742fc6ad426d083f4bd7290200"}

I got the following response from the pool with reference to what I sent ...

{"type":"hash_accepted","params":{"hashes":1}

What exactly does the above mean? I see "hash_accepted" so I'm thinking it means teh pool accepted my submission? If so, what does "hashes" mean? If not, what does the above response mean?

1 Answer 1

1

The hash_accepted field is the response from the proxy server for when a hash is acknowledged by the server the hashes field is the number of hashes the worker has submitted in the past.

When the server gets a new connection it sets it up like so:

var conn = {
    uid: null,
    pid: crypto.randomBytes(12).toString("hex"),
    workerId: null,
    found: 0,
    accepted: 0,
    ws: ws,
    pl: new net.Socket(),
}

This creates a variable called accepted and set to 0. now when a valid share is called this snippet of code is called which increments the accepted hashes and responds to the client:

conn.accepted++;
buf = {
    "type": "hash_accepted",
    "params": {
        "hashes": conn.accepted
     }
}

These code snippets are pulled from the server.js file on the CryptoNoter Github page, found here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.