Harmony's Pangaea Use Case and Node Setup in Windows

in #harmony5 years ago (edited)





Introduction

Pangaea is an experimental game initiated by Harmony and Binance with three primary purposes: To test Harmony's core protocol on a network of all external nodes, To have participants set-up a vast number of nodes ready to jump into the mainnet, and award participants who help secure the network. It must be noted that Pangaea have its own currency for playing and bookkeeping.

The game is a opportunity  to learn about running a node using resources that you  might already have or can easily acquired so long as you have internet connection. To entice players or node operators in this case anyone that successfully set up a Pangaea node will receive $10 USD worth of One Tokens. This should to cover cloud provider expenses. 

To keep participants running their node everyone that keep their nodes up and running from 15th Aug to August 23rd will receive additional $40 in One Tokens. Partial rewards will be given out to those node operators that have their nodes down during that time frame. You might want to get the assistance from Telegram and Discord groups when you encounter problems with your node.

Basically Pangaea is a gamification of node operations and has three phases to ease in newbies into the game of node operations. Beyond the one token rewards you will learn some important tools and skills that you can carry over into other projects.

Phase I (August 15- August 23, 2019)

  • Setup your node and connect to the network
  • Get the daily faucet, monitor balance and rewards received
  • Check  the stability of your node

Phase I (August 23 onwards)

  • Staking your earned rewards from the previous Phase
  • Completing missions or  simple task using the node
  • Competition on uptime, block rewards and latency

Phase III (Sept. 3 onwards)

  • Conduct attacks on the network
  • Identify security faults and report them to Harmony team

Setting up Harmony's Pangaea node

I assume that you have a windows operating system, internet connection and an Amazon web services (AWS) account. If you don't have AWS I suggest you create one as it is required for this tutorial. Please note that AWS account creation requires a debit card or credit card. Don't worry we will be making use of AWS free services, albeit there is one requirement for our setup that is not available for free tier services we have a simple work around for that.

If you have these accounts let us not begin your process to setup your Pangaea node!

I. Identification and Signing up

Those who wants to participate needs to undergo KYC procedures. Prospective participants who already have a VERIFIED Binance account need just enter their referral ID number. This  number can be found as part of your referral link or you can get in the Binance link here (make sure you are already logged in Binance).  Once you have your referral ID number proceed to the Pangaea sign-up form.


Note: What ever option you chose on your experience level on node operation should not affect your application.

For those who do not have or do not have access to Binance you can sign-up in Coinlist here. Create an account or if you have already have one just login and  complete the Pangaea form. Once you have reached the page below continue on the sign-up form as you do not have to wait for your Coinlist account to get verified.


Note: You do not need to wait for this to get verified just sign-up to the  Pangaea registration page using the same email you registered on Coinlist.

After registering all you have to do is wait for a confirmation e-mail from Harmony with your unique 'Pangaea Code.' This process could take up to 48 hours. Aside from the your Pangaea code there is also a link included in the e-mail that will point you where to download your node-keys. The node-key is a zip file that enables you to connect to the Pangaea game and constitutes a BLS key and wallet address ID.

Note: When you receive your Pangaea code all you have to do is to copy and paste the code into the link that is encircled in screenshot shown above. Click submit to start downloading the file.

Once you are done downloading you can open the zip file to extract it to a folder. Please remember the location of the folder as we will be needing this when we start to interact with our virtual server. 

Note: Once you input your Pangaea code in the node-key download page you should  be able to get a Zip file containing the above  files.

Now that we have our node-key we are done with this section and ready to setup a virtual machine on a cloud services provider. We will be using Amazon Web Services and I hope you have already created an account in AWS. Account creation is pretty straight forward and most of you should be able to do it without much trouble.  Once you have created  your account you will see that there is actually a 12 month free service bonus we will be using for Pangaea

II. Setting up Amazon Web Services cloud 

Now that we have the key to participate in Pangaea we now setup our cloud  service provider. In our case this is AWS. First time users will be offered free services for 12 months on free tier product services.  Some of the requirements we need do not fall under the free tier services but we have a work around for this as you will see later in this section. 

Now that you have already an account in AWS we start by creating our cloud machine. We start this by logging in to  Amazon web services website

Once you are in the website of AWS you will see a button labelled as  "Sign in the Console" on the top right, to sign in just click on it. The next page should ask you for your login credentials, first with your email then your password then sends  you to the page shown below. 


Note: The page above will look slightly different before you click the Services Menu.

When you click on on "EC2" it should bring you to the EC2 dashboard which you will find the resources you are using. For a new user that should be none. What we are interested here is to create a virtual service which is known in AWS as an Amazon EC2 instance or just plain Instance.  To do that you just need to look for the color blue button labelled as Launch Instance. This is shown in the screenshot shown below.



Once you have you clicked blue button you will be brought to the page shown below where you will be able to chose an Amazon Machine Image (AMI),  which is basically its operating system type. Choose the very first one the  "Amazon Linux 2 AMI (HVM), SSD Volume Type" with 64-bit (x86). Just chose the Radio button with  that supported processor type and click on the "Select Button."


Now that you have chosen what is your operating system and the of processor it will support it now time so select what type of virtual machine will you be using. As you can see the Free tier eligible is the t2.micro but what we require is the t3.small as minimum. Don't worry if it is not free we will deal with that later. As you can see I chose t3a.small which is a newer more powerful and efficient version of t3.small.


The next page is where we will be configuring our instance details.  We do not need to change anything with the current configuration. All we have to do is go to the next page were we add storage to the configuration.


Note: The default setting on this will suffice we just need to go on to the next page to state the storage we require.

The the next page is where we will set the storage we will be using in  our virtual server. We need around 30 GB for our project therefore please input 30 in the size field. Then click on the "Add Tags" button to move on to the next page.

The next page is where we configure tags. Please be reminded that tags are case-sensitive and is a key-value pair. To add this tag first click on the "Add tag" button, once clicked two fields will be shown. One is the Key field and the other is the Value field. Input "Name" on the Key field and "Pangaea-key" on the Value field. When this is done we move on to configure the security group by click on the button labelled "Next: Configure Security Group.


 


The security group is the page where you can control the flow of traffic for your virtual machine or instance as they call it in AWS.  Once you are inside this page you will see that there exist one existing rule the default SSH with port 22, just change the "Source" option to "Anywhere"  When you are done you can create the follow rules shown below. Create 4 port rules, make all these rules type "Custom TCP Rule" then input the port numbers 6000, 9000, 14555, and 9999 respectively. Lastly set them all to "Source option" to "Anywhere" Once done can proceed to Review and launch by pressing the blue button.



Once you click the button a page will show you a summary of the configuration of your virtual server.  Ignore warnings such as “your security group is open to the world” or “your instance configuration is not eligible for free tier." A pop-up window will appear where you will create a new key pair. Select “Create a new key pair” and then enter a name that you like, for example “Pangaea-key.” This will download a PEM file which will be use to connect your virtual server. You will not be able to download again this file therefore make sure you save it in a secure place where you can access.


 HOW TO INCREASE YOUR LIMIT:

Now that we are about to start you might encounter an error saying that your setup goes beyond the limit  free tier services. Unfortunately I was not able to capture the message of the warning.  Do not fret you can always request to increase your options and as I understand it they won't charge you  for this (perhaps this is case to case basis). Check out the request I did below. It took 4 days to process

.

Note: Approval might be case to case basis. I just told them that I am participating in a beta for a blockchain-based game.

Now, let continue on from where we left off on the tutorial some of you might have already have not encountered the limitation and would have already downloaded the AWS key which is a PEM file as shown below.


Once you are done downloading the AWS key and already have a running instance or virtual server on AWS, it is not time to move on to the next section where we prepare your windows computer to be able to communicate with your AWS cloud.

II. Setting up your Windows system 

If you can remember  the virtual server we have setup in AWS is running Linux  and the Pangaea node we are going to use  runs under this operating system. Hence we need a software that will allow us to communicate and connect to our virtual machine or our AWS EC2  instance. For this we need an application called Putty.  You can download the software here. (Note: If you don't know what your OS is you can check here.) 


Note: Please make sure that you are getting the correct version of  the windows installation. It does not matter if you have Win 7, 8 or 10 so long as you have the correct version 32-bit or 64-bit. Again you can check your windows version here.

When you are done downloading the file all you have to do is to double click on the file and  it should automatically install the package for you. 


Upon double clicking you will be brought to this screen. There isn't much to do here but to just click on the next button.


The next window will ask you to select where putty will be installed. I usually just keep the default setting. However please do keep in mind where you installed putty as we will be needing some of the programs that was installed with the program later. Just follow the instructions shown below.



By default the Putty installation does not add shortcut on the desktop. It might be a good idea to enable this 


When you click on the install button it immediately starts. The application is not that big, it should just take a couple of seconds for it to finish. You just need to close the next window to finish installation.


 


The installation of Putty not only installs the Terminal Emulator the main program that we will use to connect with our AWS instance/virtual server but two important programs namely pscp.exe and puttygen.exe both of which is location in the directory where we installed Putty. In our case it is here: "C:\Program Files\PuTTY"  

The first program pscp.exe which is means putty secure copy protocol which we will use later to send our Pangaea credentials (Pangaea-keys) into our AWS instance/Virtual server. The second program is puttygen.exe which is basically a conversion tool for our AWS key (The PEM file) to a Putty-compatible format needed to authenticate our connection to AWS instance.

What we need to do first is to convert the AWS key (PEM) file to a Putty compatible key. Go to the installation directory of Putty "C:\Program Files\PuTTY" open it and you should see the following files there. Double click on puttygen to open the program.



When you open the program you will be brought to the window below where you can start converting the AWS key PEM file to the compatible format which is PKK (Putty Private Key). To start conversion just follow the steps illustrated in the picture.


Once opened you will be greeted by a a message informing you that the program has successfully imported foreign key from PEM format. It then tells you to  click on the Save private key button to save  it as a private key that is compatible with Putty.  When you click this  you will be greeted by another message warning you that you are saving the key without a passphrase to protect it, ignore it and just click yes.



You will then be presented with a window asking you to input the desired name for the PKK file. I chose "Pangaea-key" for its name. When you click save it will be save in the current directory which in our case is where the PEM file is also located or download directory.



Now that we are done with creating our Putty compatible Private Key for our AWS instance we now setup our Putty SSH Terminal. You can find the icon to run Putty in your desktop.  Just click on the icon to start Putty SSH Terminal emulator.


Once putty is open you will be tasked to input the host name, port, connection type and connection Authentication. In the Host Name field input ec2-user<@public_dns_name> you can find the the public dns name in AWS  EC2 dashboard in instances, look for the Public DNS. Input 22 in Port and select SSH.  


Now we will set the location of Putty Private Key Authentication keys we made earlier. This will serve as our credentials to enter our instance. You can set it up by following the instructions below.

Once you have setup the AWS key now it is time to run the Terminal. But before you do that you might want to save the session configuration as shown below. When you are done saving you can now just load the session configuration each time you use Putty.


When the session starts the terminal connects automatically to your AWS instance which looks something like this. Now we have an easy way to connect our windows to our AWS. There is an easier way using the browser. However since we are using one of Putty's program to send our "Pangaea keys" the one that we got from Harmoney (not the one from AWS) I thought we might as well configure the Putty SSH Terminal emulator. 

Now that we have setup windows to communicate with our AWS instance we move on to the next section where we setup our Pangaea Node.

III. Setting up the Pangaea Node

Now that we have an active connection to our AWS instance we have to make sure that it is properly updated.  We can do this by typing in this command:

sudo yum update 

Now that your instance is properly updated we will now create a new directory  to store your Harmony Keys. You can make do this by inputting this in aws instances command line:

mkdir -p ~/.hmy/keystore

After creating the directory where we will be storing our Harmony keys we will now download the wallet software and set its accessibility options. First we download it by typing this command:

curl -LO https://harmony.one/wallet.sh 

Once it is downloaded we have to change the access permission of the wallet to allow it to run our instance, you can do this by keying in the following command:

chmod u+x wallet.sh

followed by:

./wallet.sh -d -t

Congratulations!  You are done making your wallet.

To be able to run the Pangaea node we need to send the Pangaea Keys that we unzipped at the beginning of this tutorial. In order to do this we have to use one of the programs that came with Putty, pscp.exe.  The pscp do not have a graphics users interface and is executed through a command line. Make sure that you have pscp.exe is at the same directory of the BLS key and the WalletID.

I save the unzipped BLS key and the WalletID in a folder named "key" in my desktop since we need the pscp.exe to be at the same directory, we copied the executable file to that directory which in my is C:\Users\elitebookG1\Desktop\key  (Note: this will obviously be different in your machine). If you have all the required files in one folder it should look like this:

Now that you have all the needed files in one directory we will use the console command line to go this directory and interact with the psco.exe program. Depending on your windows version you can easily access it by searching or inputting cmd in run or search on the lower left search field like shown below:


once you are in the command line cd into the directory where the files is located (remember we have them in C:\Users\elitebookG1\Desktop\key). You can do this by typing int this command:

cd C:\Users\elitebookG1\Desktop\key

when you are already in this directory you can now type dir to check the contents of the directory.

dir

If you were able to cd into the directory and execute the dir properly you should be able to  see a similar content below.

Since every thing is in order now we can now execute to transfer our walletID and BLS key into the AWS instance/Virtual server. Remember we are transferring your keys from your local machine to your virtual server/cloud computer (AWS instance)

NOTE: You will be needing the PPK file as well here, transfer it to the same directory. You should see for files in the directory after doing this.

First, we move the WalletID. You can do this by using the command:

pscp -i <PPK FILE> <WALLETID> ec2-user@<INSTANCEIPADDRESS>:/home/ec2-user/.hmy/keystore

<PPK FILE> the PPK file used to connect to AWS Instance

Example Pangaea-key.ppk

<WALLETID> the wallet file that is in your key folder in local machine

Example: UTC--2019-08-04T01-19-23.891...

<INSTANCEIPADDRESS> the instance ipv4 public IP. 

Example: ec2-18-219-........zonaws.com

Note: Remove <> when you enter in your information.

Note: I have  darkened some parts of the WalletID and BLS key for security reasons.

Second, we now transfer the BLS key in to the server.

pscp -i <PKK FILE> <BLSKEY> ec2-user@<INSTANCEIPADDRESS>: 

<PPK FILE> the PPK file used to connect to AWS Instance

Example Pangaea-key.ppk

<BLSKEY> the BLS key file that is in your key folder in local machine used to connect our Pangaea node.

Example: adbcdfd...key

<INSTANCEIPADDRESS> the instance ipv4 public IP. 

Example: ec2-18-219-........zonaws.com

Note: Remove <> when you enter in your information.

Now we will check if the BLS key and WalletID is in their proper directory.  BLS key should be in the root directory and WalletID should be in ./hmy/keystore.  We do not need to use the console command line anymore you can  just exit close the console by typing this:


exit


To check we need to connect to the AWS instance  using Putty Terminal. This should be a lot easier now since we have already saved of connection configuration in Putty. All you have to do is Load the configuration option and click on open.


Now that we are connected we can check the files that were transferred earlier. First  for the WalletID we need to go to this directory:

cd .hmy/keystore

once there you just need to type this next command to list its contents:

ls

Next we need to check BLS key that should be found in the root directory. You just need use this command to go back to the root directory:

cd

Then you can use this again to list the contents of the directory:

ls

Note: I have blacken out some parts of the BLS key.

Everything seems to be in order and we are now ready to run our node. Next section will discuss how to run the node.

IV. Running the Pangaea Node

We can now finally run our node. Since we need our node to run 24/7 to maximize our possible rewards we will install tmux which will enable us to disconnect from our AWS instance without shutting down our  node.

In your aws instance terminal we type the following commands to install tmux:

sudo yum install -y tmux 

After installation we now create a session in tmux, it will be a virtual terminal session within your instance which will enable us to cut your SSH from the instance but keep your tmux running where the node resides. To create the session we just need to key in this commands:

tmux new-session -s node 

Make sure that you are running the node under tmux, the terminal should have a GREEN bar at the bottom of your screen.  It should look something like this:

Note: This is just an sample image when you run tmux taken from this site. This is the virtual terminal session within the AWS instance. This does not close when you disconnect from your AWS Instance.

Now we get the node script. You can get the node script from Harmony's Github by inputting the following commands:

wget https://raw.githubusercontent.com/harmony-one/harmony/587a29696a9bf7d77226c4b5699f495e39feb032/scripts/node.sh

After downloading the script we change the script's access permissions by keying the following command:

chmod u+x node.sh

Now we finally run the Pangaea-node under tmux (the one with the GREEN bar). To run the node just type the following commands:

sudo ./node.sh -t 

Once you press enter the script will initiate  and will ask for the password for the BLS key. It has NONE just press enter.


That is it your node should initiate and start to sync to the latest block. Congrats! You finally have a running node! Syncing will take awhile if you have just joined the network.  A syncing node should look like this inside tmux (Sorry I was not able to include the green bar below).


Note:  Trie cache commit...Persisted trie from memory database is a valid output and typically signifies that you are syncing to blockchain. It will continue to be displayed as new blocks are added. 

Here are some basic commands that you need to learn in operating the node:

1. "ctrl+b " then press "d"  this is a hotkey to detach tmux and go back to aws regular session.

2.  To go back to tmux  from your regular terminal in AWS instance just type this command:

tmux attach

3. To check if you have reach consensus run this command if you get the bingo word then you have reach consensus

 grep -i "bingo" latest/zero*.log 

4. To check your wallet use this command:

./wallet.sh -t balances

5. To stop the node within tmux you just need to press the hotkey "ctrl+c"

6. To run or re-run the node you just need to input this commands below

sudo ./node.sh -t

7. To Check which shard you are in

tac latest/zero*.log | grep -m 1 -Eo "\"blockShard\":[0-3]"

8. To check current block

tac latest/zero*.log | grep -m 1 -Eo "\"myBlock\":[0-9]{5,}"
Note: To find specific information within logs, the command grep -i "search keyword" latest/"log file name"*.log | tail -n "number of lines" will print all lines within the specified log with exact matches to the keyword. 

Closing thoughts

Pangaea is an effective way to demonstrate what Harmony is trying to achieve in a gamified fashion. The game gives us a glimpse on the dynamics on how the 4 different shards with 400 participants would interact with each other as well as how good their systems design will be if implemented in their mainnet.  Involving all members of the community regardless technical know-how adds an additional dimension in to this initiative and demonstrates Harmony's intent of  making the best consensus protocol that is secure, fast and fair.

Security, Scalability and decentralization, the blockchain trilemma is the problem the team is aiming  to solve and perhaps the ultimate goal of every other projects out there. With Harmony's unique  and ingenious solution the they believe they have found and currently developing the perfect balanced solution. 

Many of the solutions  proposed by the Harmony team are truly revolutionary, bleeding edge to say the least. Some solutions are considered so new that there are further inventions that needed to be created to make this possible.  Through the Pangaea initiative Harmony developers can test new solutions and inventions  with the participation of hundreds or even thousands of node operators competing with each other, providing valuable feedback for the team to build on.

Indeed Harmony and its experiment Pangaea is an intriguing initiative that sets it as one of the most interesting and intriguing  blockchain project. Only time will tell if this project will succeed. However I am more leaning towards its success based on what I have seem so far. 


Let's Connect!!!

Sort:  

This is by far the best and most comprehensive Pangea node setup tutorial I have seen. Even better than the official guide given by Harmony! Keep up the excellent work!

Glad to see that you found it so informative I did put a lot of effort to arrange this one. I have a simpler way though using Powershell of Windows lets you can connect to aws instant using SSH and use the PEM file without having to convert. 😁

The program seems really promising and secured. Though I need to internalize the configurations on the DOS part and check its significance to the use-case it provides. Thank you for sharing. I will add this to my watch-list.

I really like doing this kind of blog-post. Honestly it was really challenging but I have learned a lot. Now I am inspired to learn more about running nodes and experimenting with Linux operating system. Got to meet awesome node operators too from around the world when I was asking help to set it up 😁

To view or trade BEER go to steem-engine.com.

Hey @ankarlie, here is your BEER token. Enjoy it!

Do you already know our [BEER Crowdfunding](https://steemit.com/cryptocurrency/@beerlover/let-s-grow-and-update-the-beer-token-huge-crowndfunding-as-crowdsale)

Thank you so much!

Very comprehensive! This will surely guide those who plans to set up like this one.

!BEER

Posted using Partiko Android

Thank you so much sister. You should try one yourself it is not hard to do really especially with the guide 😁

Nice article, lot of informations & clear details. Thanks for this good writings.

Thank you for stopping by. I hope you will try to do one for yourself as well. The AWS cloud service is free 😎 to a certain extent. I have a little hack work-around for the limits of the free services inside my tutorial

Thank you sister!

😱😱😱 Please check captcha if you're a Human. 😂

Nahehelo naq dto.

Posted using Partiko iOS

😂 Kaya mo din gawin yan kuya try mo lang!

@ankarlie, you are made of what? are you a bot!? lol...
this is actually brilliant!

!PLKN 0.1

Than you so much for your support @otom. I can see that I also get a PLKN! You are so awesome! 😊 🥂

I think the PLKN bot sleeps right now I'll send you a
!BEER instead.

Thank you so much Beer is awesome as well!

To view or trade BEER go to steem-engine.com.

Hey @ankarlie, here is your BEER token. Enjoy it!

Do you already know our [BEER Crowdfunding](https://steemit.com/cryptocurrency/@beerlover/let-s-grow-and-update-the-beer-token-huge-crowndfunding-as-crowdsale)

Thank you so much!

Hey Garlam - Head of Marketing at Harmony here - really love the article and was wondering if you'd be open to more work as one of our writers!

Message me on telegram - @garlamw (and yes it is the real me - check my twitter to verify my telegram id - https://twitter.com/GarlamWon)

Hi @garlamw I can see that you already reached out to me at Telegram.To verify this is my user name at Telegram: @Ankarlie