Advertisement
CryptoLifestyler

Untitled

Jan 27th, 2020
398
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.00 KB | None | 0 0
  1. Mining the Genesis
  2. Masternode Setup
  3.  
  4.  
  5. Transcript
  6.  
  7. 00:11 Congratulations for getting this far. We are now ready to mine our first blocks on our new blockchain. We will be mining from our QT. It is quite simple.
  8.  
  9. 00:23 Navigate to your console. In the console bar at the bottom, type ''setgenerate true''. This will use your CPU to mine. It may take a while depending on your computer specs. I have assigned 5 processors to the Ubuntu virtual machine. If you are working with less, just be patient. It will still mine the blocks. But it might take longer.
  10.  
  11. 00:51 To check to see if you are mining. Type ''getmininginfo'' and press Enter. This will bring up the network details. If the generate is ''true'', you are mining. You will also notice the difficulty, it is extremely low, so we should catch our first block soon.
  12.  
  13. 01:15 We will see our first block arrive here, under ''Recent transactions''. Our first block will be 800,000 VisionX. This is what we coded to be our pre-mine. Blocks after will be 1 VisionX. This will be the case until block 200. After block 200, our block reward will be 20 VisionX, split between miners and masternodes.
  14.  
  15. 01:43 Here you can see our first block has been mined. It is for the amount 800,000 VisionX. We can see the time and date it was mined. We can also see that we have an immature balance of 800,000 VisionX. This means we can not spend it yet. We need to wait for 51 confirmations, before it goes to our available balance. That means we need to get to block 52 before that happens.
  16.  
  17. 02:15 Once our blockchain has reached block 52, we will start working on the masternode. We must do this as soon as possible. Leaving it too late often causes the chain to crash. In previous tests, a chain would crash if a masternode was not enabled before block 100. Also, without the masternode online, the wallet would not have a full sync, and therefore we would not be able to release the QT to miners or mining pools.
  18.  
  19. 02:48 When we have a masternode online, it will be visible in the masternodes tab. You will also be able to see a list of all other nodes online. If you can't see your masternode tab in your QT, go to SETTINGS, OPTIONS, and go to the WALLET tab. Then check ''Show Masternodes tab''. You will also need to ''Enable coin control features''. This will help us check our masternode collateral is locked in place.
  20.  
  21. 03:20 If you have to show your masternodes tab, the QT will require a restart before you see that tab appear. When you restart the QT, you must remember to go to the console again and type ''setgenerate true'' again. Mining stops, every time the QT closes. It is safe to stop mining for a while. Just type ''setgenerate false'' to stop mining. As long as you have a strong peer, it is safe to stop mining for up to 12 hours. And still be able to continue mining after that. However, the longer you leave it, the less likely it will be stable.
  22.  
  23. 04:03 I will cut this video until we reach block 58. Now we have reached block 58, we can see that our pre-mine has matured enough and it is now available to spend. We will be using 10,000 VisionX from this to start our support masternode. This will help sync the network. The first thing we want to do is deploy a new server for our masternode.
  24.  
  25. 04:31 Head back to your server provider and click ''Deploy New Server''. We are going to choose exactly the same options as our peer server. Choose ''Cloud compute'', choose any location, choose ''Ubuntu 16.04'' and then choose the $5 option. Finally, choose ''Deploy Now''.
  26.  
  27. 05:00 When installed, click in the cloud instance. We are going to name this server ''Support masternode''. Then we are going to open a new terminal and SSH into the server. Just like before. A masternode is built the same as the peer. But it's config file is different. To be able to host our wallet on this server, we need to install the dependencies again. As before, I will use the Reden unix docs to do this. I will speed up the video for this as we have done this many times before.
  28.  
  29. 06:06 Now our dependencies have been installed, we need to send the masternode collateral to a new address. This will be our first transaction on the network. Although we will be sending to our own wallet and not to someone else.
  30.  
  31. 06:22 To do this, got to FILE and choose ''Receiving addresses...''. Then choose ''New''. Name the label ''mn1''. This will be short for 'masternode 1'. And click ''Okay''. Copy the address for our masternode and close the box.
  32.  
  33. 06:40 Open the tab named SEND. In the box named ''Pay To:'', we will paste our masternode address. You can see in the label below, it instantly recognizes or wallet name ''mn1''. In the amount box, put 10000. Do not click the box named ''Subtract fee from amount''. If you do this, you will not have exactly 10,000 VisionX in this wallet address. And you will fail to start a node. When ready, click on ''Send''. Double check that the final amount will equal 10,000 VisionX. Then click ''Yes''.
  34.  
  35. 07:23 If we look in our transactions tab, we can see the payment of 10,000. This will be labelled ''Payment to yourself''. This is because the address we generated is in our own QT. To be able to use this for our masternode, we must wait a minimum of 15 confirmations. Trying to start the masternode before this, will not work.
  36.  
  37. 07:50 Whilst we wait for the 15 confirmations, we should put our wallet on our masternode server. Just as before with the seed node setup, we are going to copy the path of our QT binaries from our release.
  38.  
  39. 08:09 In our server terminal, type ''wget'' then paste the path. Adding the additional path info ''/download/v1.0/Linux.tar.gz''. With that done, we can check that it is there by typing ''ls'' into the console. To extract the file and start the daemon, we follow the same process as in our last video.
  40.  
  41. 08:50 We will launch the daemon, then stop it with the CLI command. Then we will navigate to the VisionX conf file and use sudo nano to edit the file. I will speed this part up as we covered this in the last video.
  42.  
  43. 09:08 Now we are inside our config file. We need to add some things to make our masternode function. Type ''rpcuser='' and choose any username. I will choose visionxuser as an example. You can have anything you want. ''rpcpassword = visionxpasswordoranything''. Again, you can choose anything. rpcallowip = 127.0.0.1, onlynet = ipv4, listen = 1, server = 1, daemon = 1, staking = 0, maxconnections = 64.
  44.  
  45. 10:10 ''externalip=''. Paste you masternode server IP address here. ''masternode=1'' ''masternodeprivkey=''. We need to return to our QT to get our masternode private keys. We generate one from the debug console.
  46.  
  47. 10:46 Before we do that, we need to get the masternode output. Type in the console ''masternode outputs''. You will see a line of letters and numbers in brackets. With a single number at the end. Usually a zero or one.
  48.  
  49. 11:03 Highlight and copy this line without the brackets. We are going to put this somewhere safe. We need to keep a note of this for later on. We also need to have the last number on the end. In our case, it is a zero. So at the end, put a space and then zero.
  50.  
  51. 11:23 Returning to the console, we are going to type ''masternode genkey''. This will provide us with a unique private key for our masternode. Keep it safe, as anyone who holds this, can take all the coins mined from your masternode. We are going to paste this in front of our output, making sure there is a space between them.
  52.  
  53. 12:00 In front of the genkey, we are going to type our masternode alias. Which is ''mn1''. This is the name of the label given to the address that holds the collateral. Then after the alias, we are going to copy and paste our server IP address. Followed by a colon and then our default port address. Which is 7369.
  54.  
  55. 12:33 This line of information will go into our masternode configuration file when we have reached 15 confirmations. For now, just keep it safe.
  56.  
  57. 12:44 Now copy the genesis private key again, this time we are going to paste it into our server config file. With that done, we are ready to exit and save the file. Press ''Control + X'' , then ''y'' for yes, then Enter.
  58.  
  59. 13:06 Now we are going to navigate back and restart our daemon. Then use the CLI command to get info. You can see our wallet is showing the correct number of blocks. And we have one connection to the network. This shows we are on the right track. We still need to start our masternode.
  60.  
  61. 13:34 So let's head back to our Ubuntu QT and finish setting it up. We are going to check whether we have reached more than 15 confirmations on our transaction. In the transactions tab, scroll down until you find our 10000 VisionX transaction to our-self. Then double click on it.
  62.  
  63. 13:56 Here we can see that it has 17 confirmations. This is perfect. We can now add the line into our masternode config file. To access the masternode config file, navigate to TOOLS. And scroll down to ''Open masternode config file''. The file will open in your editor.
  64.  
  65. 14:18 We are going to copy and paste all the line into our config file. Before we do, delete everything that is inside. Now, let's take a look at what is in the line. First we have our alias. This is the name we assigned to our wallet address. Then we have our server IP address. This is the server our masternode is running on. Then we have our port number. Here is the genesis private key. This links our QT to the wallet on the server. This tell the server wallet to make masternode payments here. Next is the output. This shows the collateral has been accepted at the address in this wallet. Finally, we have the txid, which is zero. This shows we have one masternode. If we set up additional nodes, the next will have a txid of 1.
  66.  
  67. 15:32 It is important to get this right as one mistake would see us unable to start the node. We have to configure this wallet correctly to be able to receive rewards here. Now, let's save this file and delete our untitled document.
  68.  
  69. 15:55 For the masternode configuration to take effect, we need to restart our QT. But before we do, notice how there is nothing inside the masternodes tab. When we restart, we will see details of our masternode in here.
  70.  
  71. 16:11 When we restart the QT, go directly to the DUBUG CONSOLE and start mining again. ''setgenerate true''. Remember, closing the wallet stops mining. We need the wallet to be mining so we can sync our masternode.
  72.  
  73. 16:28 With that done, head back to the masternode tab. Now we can see our masternode details are visible. See it says the status is MISSING. That is because we have not yet started the masternode. When we start the node, It's status will changed to PRE-ENABLED. Then after some time, it will change to ENABLED. Once ENABLED it will start earning rewards.
  74.  
  75. 16:56 Now we need to check on the sync progress of our masternode. To do that, head back to the server with the masternode. First check that we still have our 1 connection. We can see we do as connections equals one.
  76.  
  77. 17:11 Then we are going to type a CLI command. Type ''mnsync status''. It currently shows an Asset ID of 2. We want an Asset ID of 4 to start the node. We need to wait and keep issuing the command until we see Asset ID 4.
  78.  
  79. 17:34 Double check you are mining with the QT. If you are not, you will not sync the chain. Every time a new block is mined, the chain syncs. We need to mine some blocks before we get a full sync. With every new block that is mined, return to your terminal and check your sync status.
  80.  
  81. 18:01 This time we see that we have reached Asset ID 4. This means that we can start our masternode from our Ubuntu QT. However, before we do, let's run a command to see our current masternode status. Type a CLI command for ''masternode status''. See how it says ''Not capable masternode: Masternode not in list''. This is because it is not yet started.
  82.  
  83. 18:34 For future reference, If you ever get this message after starting your masternode, then it means you started beofre the sync was completed. In which case, just wait longer and start the alias again once sync is complete.
  84.  
  85. 18:50 We are now going to start our masternode. Head back to the masternode tab in the QT. Click on the masternode you want to start. Then navigate to the bottom left and click on ''Start alias''. A box will appear. Click on ''Yes'' to confirm. Here it will display another box saying ''Alias:mn1 Successfully started masternode''. Click ''OK''.
  86.  
  87. 19:19 Notice the status of our node is now PRE-ENABLED. Now we need to head back to our server and check our masternode status.
  88.  
  89. 19:32 Running the same command, shows that we have successfully started our masternode. It shows our IP address, and our wallet address for payments. We can now close this server. Our wallet will be running 24/4. We can close our QT on our Ubuntu machine anytime and we will still receive rewards. Now all we have to do is wait for the first rewards to come.
  90.  
  91. 20:00 Congratulations, you have successfully created your own cryptocurrency on it's own blockchain. And you have created a masternode along with it. The process was not simple, but if practice it enough from start to finish, you will be able to get quicker and be able to make a new cryptocurrency in your sleep. The way we have done it, can be transferred over to any source code. The source code may contain different file names, but the contents are the same. For example, some do not contain the file named ''chainparams.cpp'' and all the info is inside the ''main.cpp'' file. As long as you know what you are looking for, you can always find it with a GREP search in the terminal, and track down the file.
  92.  
  93. 20:53 It is at this point you would push all the source code to GitHub, allowing mining pools to get the binaries. They will take about 15 minutes to put your coin on their pool. Then release the wallets to miners immediately after this. I will explain this process in more detail in later videos.
  94.  
  95. 21:13 In our next video, we will be looking at the masternode being ENABLED. And receiving our first masternode rewards.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement