3

I'm still trying to get a handle on how all this pool mining stuff works so I decided to use this guy's project -- https://github.com/cryptonoter/CryptoNoter/ to give it a whirl. In particular I notice when I send a message (I believe this is when I'm authenticating into the pool) ...

{"type":"auth","params":{"site_key":{"IF_EXCLUSIVE_TAB":"ifExclusiveTab","FORCE_EXCLUSIVE_TAB":"forceExclusiveTab","FORCE_MULTI_TAB":"forceMultiTab","CONFIG":{"LIB_URL":"https://mylocal.devbox.com/lib/","WEBSOCKET_SHARDS":[["wss://mylocal.devbox.com/proxy"]]},"CRYPTONIGHT_WORKER_BLOB":"blob:https://mylocal.devbox.com/1fa1d80d-4650-4b78-a22d-c2a31933d956"},"type":"anonymous","user":null,"goal":0}}

I get a response that looks like

{"type":"authed","params":{"token":"","hashes":0}}

What does this mean? In particular, what is the "hashes" field?

Dave
  • 277
  • 2
  • 9

1 Answers1

0

It's the number of valid shares that the miner has sent to the pool.

Relevant excerpt from the CryptoNoter source:

// (whenever the upstream pool accepts a share)

// increment the number of accepted shares
conn.accepted++;

// notify the miner via websockets
buf = {
    "type": "hash_accepted",
    "params": {
        "hashes": conn.accepted
    }
}
buf = JSON.stringify(buf);
conn.ws.send(buf);
Matthew Smith
  • 451
  • 3
  • 9
  • Is this documented anywhere other than in teh source code? That is, is this the number of valid shares that the miner has submitted since it started participating in the pool or since it last connected to the pool? – Dave Apr 01 '18 at 18:10
  • It's just the number of shares submitted in this connection. It's there because whoever wrote the CoinHive code put it there, and CryptoNoter is just a copy of it. – Matthew Smith Apr 01 '18 at 20:07
  • Last follow up, it seems that all the pools I plug in all use this same protocol, e.g. they all send back things that looks like '{"type":"authed","params":{"token":"","hashes":0}}'. It seems like some kind of agreed upon convention taht everyone uses. Is taht true? If so, is taht documented anywhere? Reading your comment, it seems that the Coinhive authors made up the convention themselves, but they would still have to get the pools to go along with it to have meaning, unless I'm thinking about this wrong. – Dave Apr 02 '18 at 02:42
  • There's two different protocols going on here. One for the WebSocket connection (the one with "hashes": 0) and one for the TCP connection. Unfortunately, for Monero, neither one is standard. – Matthew Smith Apr 02 '18 at 08:41