You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey, I just wanted to test the blockchain but then I realized the genesis block's hash doesn't follow the difficulty. I tried solving it by adding this code to the createGenesisBlock() function in line 139 of blockchain.js file:
const genblock = new Block(Date.parse('2017-01-01'), [], '0');
genblock.mineBlock(this.difficulty);
return genblock;
but it didn't work. Can someone please help.
The text was updated successfully, but these errors were encountered:
Genesis block doesn't have to follow the difficulty, as it is the first block in the chain. Without it, a chain doesn't exist. The difficulty is to ensure that on average every 10 minutes a new block should get mined. Difficulty helps in achieving it.
Hey, I just wanted to test the blockchain but then I realized the genesis block's hash doesn't follow the difficulty. I tried solving it by adding this code to the createGenesisBlock() function in line 139 of blockchain.js file:
const genblock = new Block(Date.parse('2017-01-01'), [], '0');
genblock.mineBlock(this.difficulty);
return genblock;
but it didn't work. Can someone please help.
The text was updated successfully, but these errors were encountered: