×
Community Blog Avax (NAAS) Node as a Service on Alibaba Cloud

Avax (NAAS) Node as a Service on Alibaba Cloud

In this step-by-step tutorial, we will help you deploy Avax on Alibaba Cloud.

In this step-by-step tutorial, we will help you deploy Avax on Alibaba Cloud.

Step 1: Start an Ubuntu Instance on Alibaba cloud

https://www.alibabacloud.com/help/en/elastic-compute-service/latest/create-and-manage-an-ecs-instance-by-using-the-ecs-console

1.  Go to the Custom Launch tab of the instance buy page.

Note: If you have not created an Alibaba Cloud account, create one first. For more information, see sign up with Alibaba Cloud.

2.  In the Basic Configurations step, configure parameters and click Next.

1

The following table describes the parameters of which you must take note. For other parameters that are not described in this table, you can use the default values.

2

3.  In the Networking step, configure the public IP address and bandwidth settings, as shown in the following figure. Then, click Next.

3

In the Public IP Address section, select Assign Public IPv4 Address and specify a public bandwidth value. For the Network Type and Security Group parameters, you can use the default settings.

4

In the System Configurations (Optional) step, set the logon password of the instance and click Preview.

5

  1. In the Preview step, read and select the ECS Terms of Service and Product Terms of Service. Then, click Create Order.
  2. Confirm and pay for the order.

Step 2: Install the Avax

Step 2.1: Login to the Machine:

6

Step 2.2: Install Pre-requisites and Binary:

apt update && apt install golang -y 
apt install git -y

7

Set $GOPATH environment variable properly for Go to look for Go Workspaces.

Please read this for details. You can verify by running echo $GOPATH.

Binary​

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

Under Assets, select the appropriate file.

For Ubuntu on Alibaba cloud :

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

8

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

9

Unzip: tar -xvf avalanchego-linux-amd64-v1.9.1.tar.gz

10

The resulting folder, avalanchego-v1.9.1-linux, contains the binaries.

Step 2.3: 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 for connecting to Fuji Testnet.

Make sure your 9651 port is open to public

Reference:https://www.alibabacloud.com/blog/how-to-create-a-vpc-and-configure-a-security-group-to-protect-your-alibaba-cloud-instances_598732

11
12

When the node starts, it has to bootstrap (catch up with the rest of the network). You will see logs about bootstrapping. 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}

13

This will take time to initialize, make sure the eta time is getting smaller.

14

Step 3: Verify the Connection

To check if a given chain is done bootstrapping, in another terminal window call [info.isBootstrapped](https://docs.avax.network/apis/avalanchego/apis/info#infoisbootstrapped) by copying and pasting the following command:

curl -X POST --data '{
    "jsonrpc":"2.0",
    "id"     :1,
    "method" :"info.isBootstrapped",
    "params": {
        "chain":"X"
    }
}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/info

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

Your node is running and connected now. If you want to use your node as a validator on the main net, 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, when starting up the node include argument --http-host= (e.g. ./build/avalanchego --http-host=)

Connect to Fuji Testnet​

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

./avalanchego-v1.9.1/avalanchego --network-id=fuji
0 1 0
Share on

harold c

4 posts | 3 followers

You may also like

Comments

harold c

4 posts | 3 followers

Related Products