lucasjones / cpuminer-multi

Multi-algo CPUMiner & Reference Cryptonote Miner (JSON-RPC 2.0)
Other
638 stars 1.5k forks source link

Parameters -D and --protocol-dump #42

Open xavier4040 opened 7 years ago

xavier4040 commented 7 years ago

Hi

First of all thanks for your tremendous work and for offering it to the community. Not everyone has the ability to invest thousands of dollars in mining equipment, but with cpuminer-multi everyone who has a computer is able to try and have the thrill of discovering crypto mining.

There are 2 options that I like to use with cpuminer-multi: -D --protocol-dump

It helps me understand the underlying protocol and what happens between my miner and the mining pool servers.

When I use these options with "skein" algorithm for example (when trying to mine DigiByte), I get this lines when I find a valid share:

[2017-06-04 19:17:34] DEBUG: hash <= target
Hash:   0000002d8b9db4b00486c9dd216e04550ff5468bdf6f82bc63266c46813cf52f
Target: 00000063ff9c0000000000000000000000000000000000000000000000000000
[2017-06-04 19:17:34] share diff 0.02196 (2.2x)
[2017-06-04 19:17:34] > {"method": "mining.submit", "params": ["D8En7o9BEE2PNCev837t2Df8hLFcrsYxB3", "b83c", "00000000", "59344094", "5b826200"], "id":4}
[2017-06-04 19:17:35] < {"id":4,"result":true,"error":null}
[2017-06-04 19:17:35] accepted: 61/63 (diff 0.022), 882.32 kH/s yes!

When I use the same parameters with "cryptonight" algorithm, I don't have the first lines of output telling me which share I submit to the pool.

Should I use another parameter to be able to see it? Or if it isn't implemented, would it be hard to implement?

Thanks Xavier

lucasjones commented 7 years ago

Hi Xavier,

I have updated the cryptonight_debug branch to show the Hash and Target info for cryptonight.

Example output

[2017-06-11 13:26:12] Stratum detected new block
[2017-06-11 13:26:12] thread 2: 4 hashes, 11.50 H/s
[2017-06-11 13:26:12] thread 0: 3 hashes, 10.58 H/s
[2017-06-11 13:26:12] thread 1: 3 hashes, 10.44 H/s
[2017-06-11 13:26:39] DEBUG: hash <= target
Hash:   0014d38dd1e1d3b26a9161c5f682a926248c392496691ce4c42fc468a533b867
Target: 001a36e2ffffffffffffffffffffffffffffffffffffffffffffffffffffffff
[2017-06-11 13:26:39] thread 2: 275 hashes, 10.37 H/s
[2017-06-11 13:26:39] > {"method": "submit", "params": {"id": "238924658438190", "job_id": "212500551529228", "nonce": "bcabaaaa", "result": "67b833a568c42fc4e41c699624398c2426
a982f6c561916ab2d3e1d18dd31400"}, "id":1}

[2017-06-11 13:26:39] < {"id":1,"jsonrpc":"2.0","error":null,"result":{"status":"OK"}}
[2017-06-11 13:26:39] accepted: 1/1 (100.00%), 31.38 H/s at diff 2500 (yay!!!)
xavier4040 commented 7 years ago

Hi Lucas

Thanks a lot

Xavier