One more thing that we would have to add to our blockchain data structure is the genesis block. But what is a genesis block? Well, a genesis block is simply the first block in any blockchain.
To create our genesis block, we are going to use the createNewBlock method inside of the Blockchain() constructor function. Go to the dev/blockchain.js file, and inside of the blockchain constructor function type in the following highlighted lines of code:
function Blockchain () {
this.chain = [];
this.pendingTransactions =[];
this.createNewBlock();
}
As we observed in the previous section, the createNewBlock method takes in the value of a nonce, a previousBlockHash, and a hash as parameters. Since we're using the createNewBlock method over here to create the genesis block, we are not going to have any of those mentioned parameters. Instead...