tencent cloud

Tutorial of Setting Avalanche Node with Network-as-a-Service (NAAS) on Tencent Cloud

In this step-by-step tutorial, we will help you deploy Avalanche node on Tencent Cloud(https://www.tencentcloud.com/).

Step ONE: Start an Ubuntu Instance on Tencent Cloud

Go to the Console page, Select the Cloud Virtual Machine as shown below.

Note: If you have not created a Tencent Cloud account, create one first. For more information, see details on Tencent Cloud.

Step TWO: Buy VM Instance

1. Select a proper region of the cloud.

2. Click the Buy Now button.

3. On the Basic configurations, configure parameters and click Next.

4. Select an Ubuntu 20.04 64bit Icon for OS

5. As the official hardware requirement, you are recommended to use the CPU with 8core, RAM 16GB, and 1TB Disk storage.

Step THREE: Configure the firewall.

In the Networking step, configure the public IP address and bandwidth settings, as shown in the following diagram. And the port number ‘9651’ needs to be open in firewall for setting the Avalanche node.

1. Click create & security group

2. Add ‘9651’ port rule for Avalanche node

3. Click OK Button and then click Add rule button

4. Add an inbound rule for 9651 port as below TCP:9651

5. Remove other port numbers except 22, 80, 443, and 9651 port.

6. Back to the creation page, select the Existing security group and select the group we created right now

Step FOUR: Create a login key pair for VM login to ensure a high security level.

There are two options for this step. The first option is to login using a username and password, which is less secure but simpler. The second option is to login using an SSH key pair, which is more secure but requires some technical expertise.

Option 1: Login using a username and password.

Click on the "Set password" option to set up a username and password for logging into the virtual machine. Once completed, proceed to the next step.

Option 2: Log in using an SSH key pair.

1. Click create a new one

2. Click New in the pop up window.

3. Input a custom name for pair key, and click OK to download the .pem file to localhost

4. After create key pair, go back to the instance creation page and select it

Step FIVE: Preview the configurations

In the Preview page, read and select the ‘I have read and agree to Tencent Cloud Terms of Service’. Then, click Enable.

Step SIX: Install the Avalanche Node

Login to the Machine with the pem file.

1. Get the public IP address of instance.

2. Use the following commands to login in your cloud server.

3. Download the Binary

If you want to download a pre-built binary instead of building it yourself, go to the releases page, and select the one from the ‘release’ that you want (probably the latest one.)

https://github.com/ava-labs/avalanchego/releases

Under Assets, select the appropriate file.

For ‘Ubuntu’ on Tencent cloud :

Download: avalanchego-linux-amd64-<VERSION>.tar.gz

You can right click the item and copy the URL for download it to your server.

Use the following commands to download and unzip it.

wget https://github.com/ava-labs/avalanchego/releases/download/v1.9.5/avalanchego-linux-amd64-v1.9.5.tar.gz

tar -xzf ./avalanchego-linux-amd64-v1.9.5.tar.gz

After the operations, the folder ‘avalanchego-v1.9.1’ contains the binaries.

Step SEVEN: Start a Node, and Connect to Avalanche

If you are using the pre-built binaries on Linux:

./avalanchego-v1.9.1/avalanchego

By default (without specifying any parameters), this node will connect to the Mainnet which may take much longer time to finish bootstrapping. See ‘this (https://docs.avax.network/nodes/build/run-avalanche-node-manually?spm=a2c65.11461447.0.0.3e0b6551Op2Gi5#connect-to-fuji-testnet)’ for connecting to Avalanche’s Fuji Testnet.

Make sure your 9651 port is open to public.

When the node starts, it has to bootstrap (in order to synchronize with the rest of the network). You can check the logs about bootstrapping process. When a given chain is done bootstrapping, it prints logs like this:

[09-09|17:01:45.295] INFO <C Chain> snowman/transitive.go:392 consensus starting {"lastAcceptedBlock": "2qaFwDJtmCCbMKP4jRpJwH8EFws82Q2yC1HhWgAiy3tGrpGFeb"}
[09-09|17:01:46.199] INFO <P Chain> snowman/transitive.go:392 consensus starting {"lastAcceptedBlock": "2ofmPJuWZbdroCPEMv6aHGvZ45oa8SBp2reEm9gNxvFjnfSGFP"}
[09-09|17:01:51.628] INFO <X Chain> avalanche/transitive.go:334 consensus starting {"lenFrontier": 1}

This will take some time to initialize, and make sure the ETA time is getting smaller as shown below.

Step EIGHT: Verify the Connection

To check whether a given chain is done bootstrapping or not, call in another terminal window ‘info.isBootstrapped’ by copying and pasting the following commands:

If it returns true, then the chain finished bootstrapping; otherwise, it returns false. If you make other API calls to a chain that is not done bootstrapping, it will return message API call rejected because chain is not done bootstrapping. If you are still experiencing issues, please contact us on Discord for further assistances.

Your node is running and connecting successfully now! If you want to configure your node as a validator on the mainnet, please check out this tutorial to find out how to add your node as a validator using the web wallet.

You can use Ctrl + C to kill the node.

To be able to make API calls to your node from other machines, You can start up the node include argument --http-host= (e.g ./build/avalanchego --http-host=)

Change connection between mainnet and testnet

To connect to the Fuji Testnet instead of the Mainnet, use argument --network-id=fuji. You can get testnet tokens on the Testnet from the faucet.

/avalanchego-v1.9.1/avalanchego --network-id=fuji

Run node in the background

If you want to run your Avalanche node in the background, do not shut it off when you close the terminal program. Run the following methods if you want keep it running in the background.

  1. run node with nohup command;
  2. run node with pm2;
  3. run node in a screen tools;

nohup and screen are equipped with ubuntu, however pm2 needs to be installed by yourself.

When a node is setup, relevant parameters can be viewed on the Monitoring page as shown below.

Contact Us
Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 available.

7x24 Phone Support
Hong Kong, China
+852 800 906 020 (Toll Free)
United States
+1 844 606 0804 (Toll Free)
United Kingdom
+44 808 196 4551 (Toll Free)
Canada
+1 888 605 7930 (Toll Free)
Australia
+61 1300 986 386 (Toll Free)
EdgeOne hotline
+852 300 80699
More local hotlines coming soon