Now that we’ve seen a simple example of Proof-of-Work, let’s integrate it into our blockchain! Complete the
proof_of_work() method inside the Blockchain class.
.proof_of_work() method, create a local variable
proof and assign it the block’s
Finish the rest of the method by creating a loop that increments the
nonce value until the hash with the required difficulty has been generated.
After finding the correct hash, set the value of the
block.nonce back to
0 and return the correct hash outside of the loop.