Advertisement
CryptoLifestyler

Untitled

Jan 27th, 2020
267
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.21 KB | None | 0 0
  1. Starting the Explorer
  2.  
  3. Transcript
  4.  
  5. 00:00 In this final part of the tutorial, we will be starting the explorer and loading the blockchain. We will also be setting up the Forever program.
  6.  
  7. 00:11 Let's continue. With our explorer ready. We need to start the daemon for our coin. Navigate back with ''cd''. Then go to the Linux file and start the daemon.
  8.  
  9. 00:31 Use the CLI command to ''getinfo''. We have to make sure we are synced to the current block height.
  10.  
  11. 00:41 We can now see we are at the current block height. Copy the command ''npm start'' and return to the terminal.
  12.  
  13. 00:55 Navigate to the explorer folder. Paste the command. This will start the explorer
  14.  
  15. 01:07 If at this point your explorer does not start. And you have errors saying ''Can not find modules'', Hold control and C to stop the explorer. Then you need to install the webpack to help this. Type ''cd'' to return to the home directory. Then type ''npm install webpack@4.8.2'' and hit enter.
  16.  
  17. 01:32 You will get further errors. So after this follow the instructions with ''npm audit fix''. Then type ''npm install''. Let that install, and the problem will be resolved by rolling back some versions.
  18.  
  19. 02:09 Then return to the explorer folder. And type ''npm start''. This does not always happen on installations. It happens when there is a conflict in the dependency versions.
  20.  
  21. 02:22 Okay, now our explorer has started. All is looking as it should be. We are now going to look at our explorer in all its glory. Go back to your virtual server page and copy the IP address. Paste it into the toolbar.
  22.  
  23. 02:39 After the IP address. You want to add a colon and the numbers ''3001''. This is our port. Hit enter. You will now see our block explorer. We can see it has the heading ''Vision X Block Explorer''. Along the top we can see the network hash. The difficulty. The number of masternodes online. And the BTC price.
  24.  
  25. 03:05 At the bottom right corner. We can see the current block height. And that we have 2 connections to the network. As you can see though. It is not displaying any transactions. We will fix this now.
  26.  
  27. 03:25 Open a new terminal. And ssh into the explorer server again. Do not close the other terminal. You can minimize it though. Now we have a second terminal open on the explorer server. We can leave the first one running the explorer while we work. We need to re-index the blockchain. So enter the explorer folder, and copy and paste the command. ''node scripts/sync.js index re-index''. And hit enter.
  28.  
  29. 04:05 This will load all of the blocks from the blockchain. All the way up to the current height. We can check out current height in our QT. We don't have long to wait.
  30.  
  31. 04:35 Now that is done. Click the up arrow and replace the word ''reindex'' for ''update''. Return to your explorer page and refresh. You will now see we have all the transactions since the genesis block.
  32.  
  33. 05:02 If we look at the top 100 tab. We can see the amounts in each wallet. Obviously it is only one wallet now for this tutorial. So its 100% owned by myself. But when you launch your coin, this will be different as the coin will be circulating.
  34.  
  35. 05:23 Clicking on the movement tab show high amounts that have moved. Currently this only shows our pre-mine movement.
  36.  
  37. 05:31 The network tab will allow you to paste any address. Then see all the transactions from that account.
  38.  
  39. 05:38 Back on the overview page. We can see the coin supply. This is the amount of coins in existence so far. It will increase as blocks are mined.
  40.  
  41. 05:48 Okay. Let's head back to the terminal and complete the setup. We need to create a cron job. Copy the command 'crontab -e'' and head back to the terminal. But before we paste it. We need to ''cd'' back into the home directory.
  42.  
  43. 06:06 A cron job is a script that runs at a certain time. We will be needing this to refresh the explorer ever so often. Otherwise the user will have to manually refresh the page, to update blocks. After you paste, hit enter. You will be given a choice of how you want to edit. Type the number 2. And hit enter. Now scroll down to the end of the comments. Return to your paste bin and copy both lines. These are going to be pasted in the bottom of this file. These commands are telling it to refresh the sync every minute. And refresh the peers every 5 minutes. Once pasted. You can exit the file.
  44.  
  45. 06:55 Now that is done. We can move onto our final stage. Setting up forever. This program will ensure the explorer runs after we close the server terminals. We need to go back to our other terminal. In this terminal we need to stop the explorer. Just hold control and C.
  46.  
  47. 07:15 Once the explorer has stopped, go back to your pastebin and copy the last command. ''forever start -c npm start ./'' Paste and enter. Now we can see that forever has worked. We are confident to close both our explorer terminals. Our explorer will always run.
  48.  
  49. 07:48 Now when we go back to our explorer. We can see that is still running. And it will automatically refresh its data. Now your explorer is running. You should bind it to a sub-domain. Such as explorer.visionXcore.com.
  50.  
  51. 08:05 That is the end of this tutorial. You now know how to make an explorer for your coin.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement