Advertisement
CryptoLifestyler

Untitled

Jan 27th, 2020
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.68 KB | None | 0 0
  1. Hashing the Genesis (Part 1)
  2.  
  3.  
  4. Transcript
  5.  
  6. 00:11 In this video, I am going to show you how to hash the genesis for your blockchain.
  7.  
  8. 00:17 This is the final stage of the process. Once this is done. We will have successfully created our own blockchain. And we will be able to start mining our new cryptocurrency.
  9.  
  10. Let's get started.
  11.  
  12. 00:32 Delete the make install command. Type the word ''clear'' into your console. And push enter. Now we are starting on a clear terminal. Type ''cd src'', ''cd qt'', ''./visionX-qt''.
  13.  
  14. 00:49 Now, what happens here is the genesis script will run. It will calculate the genesis hash, the merkle hash and the nonce. This is because the script is in the mainnet params. Depending on your computer specs, this could take seconds or minutes. Just be patient.
  15.  
  16. 01:11 Now we can see the output. It shows the new nonce that has been created. And the time is our epoch time that we put into the code earlier. The hash is our new genesis hash. And below it is our new merkle hash. First thing to do is to check the epoch time matches ours in the code. We need to return to chainparams.cpp, and look at the epoch time in the mainnet. It should be the same as what we have just generated.
  17.  
  18. 01:51 As you can see, these numbers match. So we are sure it is our mainnet genesis that has been calculated. Let's begin by copying the genesis from the terminal. And adding it into our checkpoint data on line 196. Then click save.
  19.  
  20. 02:17 Then we will move up to line 165 and paste the genesis into there too. Click save. We are going to return back to the terminal and copy the merkle. Then paste it into line 166. Then save again.
  21.  
  22. 02:45 The last thing we need to do is to add the new nonce to the source code. This is on line 122. Head back to the terminal and copy the nonce. Replace the zero for our new nonce. Now we have added the new genesis, merkle and nonce to the code. We need to generate the same for the testnet.
  23.  
  24. 03:14 The script that we used to create the genesis needs to be moved into the testnet params to create the testnet genesis. Highlight all of the script. This is from line 125 to line 163. Cut all of that out. Then scroll down to line 221.
  25.  
  26. 03:45 You will see a line a line of code that says ''consensus.hashGenesisBlock = genesis.GetHash();''. Paste the script under this line. Now we have the script in the testnet params, after we compile again, we will be able to generate the new genesis for the testnet.
  27.  
  28. 04:15 Click save and copy your command to compile again. Then return to the terminal. Navigate back using ''cd ..''. Once you are in the master folder, paste in your compile commands and wait for it to finish compiling.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement