Attention: For Live support and discussion, please visit our Discord! https://discord.me/curecoin
Problem with testnet 2.0a3
I've tried running the testnet packages and something definitely starts to happen. But everything seems to hang after the first block has finished. This is all I get from the miner
Current hash rate: 61 KH/s of 12 x SHA256
Mined 0 blocks.
SHA256(4JTR7glkIeyq1255475211, 12) = 0000007A4BA23C335882AF97CF4F69509B5E91A53B7
Submitting 4JTR7glkIeyq1255475211 to work server....
and this if the last few lines from the core? (not sure what you call it)
Validating block 917
Attempting to add block 917 with hash 4F965E4ECDDA95545D30F98DBE06E9286CFDF82D16
Validating block 917
Don't need to regen address file...
Got connection from /22.214.171.124.
PUTTING INTO WRITE BUFFER: REQUEST_NET_STATE
Caught up with network.
Sending REQUEST_NET_STATE to /126.96.36.199
They both just sit like that with no cpu activity at all.
Seems to be running ok again now. 🙂
Quick question - what does "certificate failed with target score .........." mean?
Wow, sorry about the late response!
Basically, a target score is a "maximum" value that a certificate can get when hashed. So say we SHA256 hash something (like, the meat of a 2.0 block), and get
This is, of course, in HEX, but it can be converted to a decimal:
Big number, but it makes sense. The hard part is getting a SHA256 hash which is a "small" decimal number. The target is the decimal value that a SHA256 hash of the certificate plus nonce must fall under. At higher difficulties, this target is smaller. At maximum difficulty, this target would be 1, meaning the hash would have to be entirely zeros to solve a block.
Now, due to the reasonable range of mining difficulties, we can simplify the above by only using 1/4 of the actual hash, or the first 8 bytes. The actual code to get the target is:
byte hash = md.digest(certificateWithNonce.getBytes("UTF-8"));
long score = 0L;
for (int j = 0; j < 8; j++)
score = (hash[j] & 0xff) + (score << 8); //This takes the first 8 bytes of the hash, and turns it into a long. Works out nicely, as a Long is 64 bits.
This gives us 05a16c1f28e81aae from the above example, which is 405724322526141102 in decimal. As a result, the difficulty would have to be about 45.466 (rounded for convenience), as 9223372036854775807 (the maximum value of a signed 64-bit number) divided by half of 45.466 is just above the above block hash.
At a difficulty of 45.466, the target would be 405726126637697435, which our above-found score (405724322526141102) is lower than.