26th Mar 2021

Steps to Setup Masternode using AWS on XinFin MainNet.

Blockchain

Written By, Mahesh Rajput

Overview

In this article, we are going to create one AWS instance with configurations that XinFin MasterNode needs. After that we setup XinFin Masternode in that instance in two ways one by one.

The first way to setup Masternode is using the bootstrap shell script command and the second-way using docker. Step by step we will see both methods.

You can also refer the video tutorials for the same:
1) Video for creating AWS instance and setup XinFin masternode on Mainnet using BootStrap you can find here.

2) Video for setup XinFin masternode on Mainnet using Docker you can find here.

Setup Aws EC2 Instance

For launching an EC2 instance first, we need to know what configuration required for the setup masternode of XinFin.
xinfin
As shown above image configuration, we are going to select ubuntu 18.04 LTS OS.
So, For creating an instance we need to click on launch instances button in Instances section AWS.
After that, it shows the prompt step-1 for selecting OS as shown below image.
xinfin-step-1
After that in step-2, we need to select Instance Type and in our case, we selected t3a.2xlarge with 8 core CPU and 32 GB memory.
xinfin-step-2
Then in step3 click on Next: Add Storage button.
Then in step4, we need to add storage as per configuration 300 GB SSD.
xinfin-step-4
You can skip step5 and step6 to add tags and add security groups by clicking next button. After that click on Review and Launch button, which shows all details of the instance for review, and in the last shows Launch button that prompts for generating a new keypair to interact with the instance ssh client. so, you have to generate that key pair and download it in a safe place because you can not recover it after losing it.
xinfin-step-7
After Downloading it, click on Launch Instance button to launch an instance and wait for your instance initialization.
xinfin-status-check
And when your status check field becomes green that means you are now ready to interact with your ec2 instance. To interact with ssh client through the terminal, you need to paste commands that are mentioned in connect section of aws from the place where your newly generated Keystore is stored.

Setup Masternode on MainNet using Bootstrap

Before starting this step, you need to make sure that you are connected with the instance ssh client via terminal. After connecting with an instance ssh client your terminal looks like the below image.
xinfin-terminal
Before starting, you can also found commands for setup XinFin masternode here.

Step1: To set up masternode using the bootstrap command, you only have to run one command that does all things for you. Command is :

This bootstrap shell script runs and installs all required dependencies like docker, docker-compose, git repo clone, and up the docker container. You can see the output of this command below images.
xinfin-bootstrap
After running the command, it asks for the Master node name and you can enter the name that you like in our case it is Trial_NodeServer.
xinfin-bootstrap-masternode
The below output shows that it cloning repo “XinFin-Node” and Installed Docker.
xinfin-bootstrap-masternode-output
The output of installing docker-compose and image pulling.
xinfin-bootstrap-masternode-image-pulling
After Completion of Command successfully it shows below output.
xinfin-bootstrap-masternode-image-pulling-output
You can check that your docker container is up and running well by running sudo docker ps command.
xinfin-bootstrap-masternode-docker-command
You can see your node in XinFin Network masternodes list at xinfin.network.
xinfin-masternodes
Congratulations! Your masternode is up on XinFin MainNet.

Setup Masternode on MainNet using Docker

Before starting that make sure you are logged in at instance ssh client.

Step1: To setup masternode using docker you need to first clone the “XinFin-Node” git repo using the below command:

Then enter the XinFin-Node directory:

Step2: Install Docker and Docker Compose

Step3: Update .env file with details.
Create .env file from taking reference of env.example file.
Enter the name of your company or product in INSTANCE_NAME field.
Enter your email address in CONTACT_DETAILS field.

xinfin-masternode-step-1

xinfin-masternode-step-1.1

Step4: Start Your Node

For pulling Image and start node run:

xinfin-masternode-step-4
You should be able to see your node listed on this page: https://xinfin.network
To stop the node or if you encounter any issues use:

Sudo docker-compose -f docker-services.yml down
Congratulations!! Your masternode is setup successfully on XinFin MainNet.

Written By,

Blockchain Developer at Yudiz Solutions Pvt. Ltd