Avalanche Node Deployment: Using AWS for Faster and Easier Setup (Part 3)

Post Category :

Avalanche Node is a node that runs on the Avalanche network, allowing users and applications to communicate directly with the Avalanche blockchain. Avalanche is an extremely lightweight protocol, so nodes can run on commodity hardware. As network usage increases, hardware requirements may change. So, to interact with the Avalanche network, one needs to connect to an Avalanche node. Below is a step-by-step guide on creating an Avalanche Node using AWS:

  1. Log in to your AWS account. 
  2. Once the account is set up, create a new EC2 instance, which is a virtual machine instance in AWS’s cloud. Navigate to the EC2 dashboard in the AWS Management Console. 
  3. To log into the EC2 instance, you will need a key on your local machine that grants access to the instance. First, create that key so that it can be assigned to the EC2 instance later on. On the left side of the bar, under Network & Security, select Key Pairs. 
  4. Select the pem file for Ubuntu. 
  5. Launch your instance. 
  6. Move the pem file you downloaded to the home directory of Ubuntu. Open your console and type the following command:
  • mv avalanche.pem ~/.ssh 
  • ssh-add ~/.ssh/avalanche.pem; chmod 400 ~/.ssh/avalanche.pem
  • Add ssh into the instance – ssh ubuntu@publicIp

If you’ve completed the aforementioned steps and the permissions still aren’t set correctly, you’ll receive an error message. To set the correct permissions, follow these steps:

  1. Use this method to update permissions and insert your SSH public key into the authorized_keys file.
  2. This will ensure that your files and folders have the right permissions, so you can continue working without any issues.

Note: This method requires the installation of the SSM Agent. For more information on Session Manager and a complete list of prerequisites, see Setting Up Session Manager. 

1. Open the AWS Systems Manager Console. 

2. Start a session. 

3. Use the ls-ld command to ensure that the files permissions under the home directory are correct. Following is a list of correct permissions: 

  • Linux home directory, /home, for example, should be (0755/drwxr-xr-x). 
  • User’s home directory, /home/ec2-user/, for example, should be (0700/drwx——). 
  • .ssh directory permission, /home/ec2-user/.ssh, for example, should be (0700/drwx——). 
  • authorized_keys file permission, /home/ec2-user/.ssh/authorized_keys, for example, should be (0600/-rw——-). 

Below is an example of the ls-ld command and output. In the required example, ec2-user is the username. You can change the same according to your specific AMI. 

$ ls -ld /home/ec2-user/ 

drwx—— 3 ec2-user ec2-user 4096 Apr  1 08:31 /home/ec2-user/ 

4. Verify the SSH public key on your local computer. 

5. If the signature of the SSH public key isn’t present in the output, update the authorized_keys file to allow your SSH key. In the following example, replace the example key with your SSH public key. 

$ echo ‘ssh-rsa (kEY)’ >> /home/ec2-user/.ssh/authorized_keys 

6. To correct permissions, run the following commands on your EC2 instance. 

$ sudo chown root:root /home 

$ sudo chmod 755 /home 

$ sudo chown ec2-user:ec2-user /home/ec2-user -R 

$ sudo chmod 700 /home/ec2-user /home/ec2-user/.ssh 

$ sudo chmod 600 /home/ec2-user/.ssh/authorized_keys 

7. End the session. 

8. Connect to the instance using SSH.

9. Run the command again and you will be logged in into the EC2 instance.

Your AvalancheGo node should now be running wherein the process of bootstrapping can take a few hours. To check if it’s done, you can issue an API call using Curl. 

  • If you’re making the request from the EC2 instance, the request should be: 
Avalanche

● Once the node is finished bootstrapping, the response will be:

Avalanche
  • You can continue on the same, even if AvalancheGo hasn’t completed bootstrapping. To make your node a validator, you’ll need its node ID. In order o get the same, run the following command:
avalanche
  • Now, your Avalanche Node is successfully set up and you can exit by typing-in EXIT in CLI.

In the Final Analysis,

Deploying Avalanche nodes is a crucial step in building a reliable and secure blockchain network. However, it can be a complex and time-consuming process that requires specialized knowledge and expertise. That’s where VE3 can help,
we are a perfect partner for any business looking to take advantage of the benefits that Avalanche has to offer. With our extensive experience in the industry, we have the knowledge and expertise necessary to help you implement Avalanche in your business and maximize its potential. We can assist you with everything from network design and deployment to ongoing maintenance and support, ensuring that your Avalanche network is always operating at peak performance. Our team of skilled professionals will work closely with you to understand your specific needs and tailor our solutions to meet them. With VE3 on your side, you can rest assured that you’re getting the very best in Avalanche technology and support. So, if you’re looking to build a powerful and secure blockchain network, don’t hesitate to reach out to us.
You can set the Avalanche node in no time.

EVER EVOLVING | GAME CHANGING | DRIVING GROWTH

VE3