Creation of Avalanche Network Node, Backup, Update, Health and Staking By Validating

Avalanche Portugues
18 min readJan 9, 2021

--

This tutorial aims, in a practical and objective way, to create your Avalanche network node to make it an Avalanche network validator, to make the Backup of your node, as well as to keep your node updated with each upgrade of the Avalanche mainnet, to check the health of the Avalanche your node and staking by validating the Avalanche network node.

Updated January 15, 2021.

AVALANCHE NETWORK CREATION

The minimum requirements for running an Avalanche node were obtained in:

Below is the list of minimum requirements:

# Operational system

  • Ubuntu 18.04 or 20.04
  • MacOS equal or higher Catalina

# Hardware

  • CPU > 2 GHz
  • RAM > 4 GB
  • Free space storage > 10GB

# Software

  • Go equal or higher 1.15.6

# Apricot Phase 0 — Patch 3

  • v1.1.3

# Avalanche Wallet

  • You must have at least 2,000.002 AVAX to become an Avalanche network validator, with 2,000 AVAX being the minimum to become the Avalanche network validator plus the 0.002 AVAX fee for the transfer transaction of your AVAX tokens from your X-CHAIN ​​address to your P-CHAIN ​​address.

In this wet orial will use the Cloudjiffy, cloud service provider in order to implement the programming language to create and run a network node Avalanche.

CLOUDJIFFY

Register on Cloudjiffy by clicking on the image below:

After completing your registration, you will have to configure your payment information and pre-load your balance with cash. Make a deposit of at least $ 10 to use the Cloudjiffy service. I recommend depositing $ 10 to $ 50 and enabling automatic top-up.

After completing your deposit, create your virtual machine. Follow the steps below:

1- Click on “NEW ENVIRONMENT”, as shown in the image below.

2- Now we will configure your virtual machine, which has the initial screen below.

3- Click on VPS, as shown in the image below.

4- Choose Ubuntu 20.04, as shown in the image below.

5- Double click on GO, as shown in the image below.

After you double click on “GO” the image will look like this.

6- Click on “OFF”, as shown in the image below.

After clicking “OFF” the image will look like this.

7- Click on “GO”, as shown in the image below.

After clicking “GO” the image will look like this.

8- Click on “Ubuntu”, as shown in the image below.

After clicking on “Ubuntu” the image will look like this.

9- Insert 30 cloudlets, as shown in the image below.

10- Click “OFF”, as shown in the image below.

After clicking “OFF” the image will look like this.

11- After completing the configuration above, click on “Create”, as shown in the image below.

After a few minutes your virtual machine will be successfully created!

Port 9651

To ensure that your connectivity to the Avalanche network is optimized and uninterrupted, you will want to update port 9651. Follow the steps below:

1- Click on “Settings” of your virtual machine env-1563667 , as shown in the image below.

After clicking on “Settings” the image will look like this.

2- Click on “Firewall”, as shown in the image below.

After clicking on “Firewall” the image will look like this.

3- Click on “Inbound Rules”, as shown in the image below.

After clicking on “Inbound Rules” the image will look like this.

4- Click on ‘Add’, as shown in the image below.

5- Fill in the fields, as shown in the image below and click on “Add”.

After clicking “Add” the image will look like this.

Note that port 9156 has been configured, as shown in the image below.

Finally, click on the “x” to close “Settings”, as shown in the image below.

INSERTING COMMAND LINES TO CREATE THE AVALANCHE NETWORK NODE

Click on your virtual machine, as shown in the image below.

Then, click on the Elastic VPS Web SSH icon (black window), as shown in the image below.

Next, we observe the session in which we will introduce the command lines for the creation of your Avalanche network node, as shown in the image below.

We must periodically check if there has been an update to the version of the Avalanche mainnet node . In case of updating, we must replace the two command lines that contain the old version of the node to suit the latest version of the Avalanche mainnet node . To check the latest version of the Avalanche mainnet node click on the image below:

We should periodically check if there has been an update in the version of GO for the Linux operating system . In case of update, we must replace the two GO command lines in the code below to adapt the latest version of GO to the Linux operating system . To check the latest version of GO click on the image below:

From this moment on we will introduce — copy and paste — each line of code and “enter”, successively, line by line, until the last command line, in the SSH Web session (black window) of Elastic VPS, in the following following order:

sudo apt-get updatesudo apt-get install curl build-essential libssl-dev libuv1-dev cmake makesudo wget https://golang.org/dl/go1.15.7.linux-amd64.tar.gzsudo tar -C /usr/local -xzf go1.15.7.linux-amd64.tar.gzexport PATH=$PATH:/usr/local/go/binsource ~/.profileexport GOROOT=/usr/local/goexport GOPATH=~/goexport PATH=$PATH:$GOROOT/bin:$GOPATH/bingo versionecho $GOPATHapt install tmuxtmux new -s avalancheexport PATH=$PATH:/usr/local/go/binapt install gitwget https://github.com/ava-labs/avalanchego/releases/download/v1.1.3/avalanchego-linux-amd64-v1.1.3.tar.gzsudo tar -C /usr/local -xzf avalanchego-linux-amd64-v1.1.3.tar.gzgo get -v -d github.com/ava-labs/avalanchego/...cd go/src/github.com/ava-labs/avalanchego/git pull && bash./scripts/build.sh./build/avalanchego

Observation-1 : Apricot Phase 0 — Patch 3

This update is optional but encouraged. The patch includes minor bug fixes relating to APIs.

  • Fixed hanging call when attempting to filter C-chain logs.
  • Fixed C-chain client to call the proper multi-coin API.
  • Added getAtomicUTXOs to avm and platformvm API clients.

Note-2 : On the command lines apt install git and sudo apt-get install curl build-essential libssl-dev libuv1-dev cmake make you will be asked Y (yes) or N (no), so for both, type Y and give enter.

You should now click on Duplicate Session

After duplicating the session, insert — copy and paste — each line of code into the Elastic VPS SSH web session (black window) and press “enter” and, successively, line by line, up to the last command line, in order follow:

tmux new -s avalancheexport PATH=$PATH:/usr/local/go/bin

Note-3 : If you have logged out , to retrieve the information entered up to that point, open a new SSH Web session , enter — copy and paste — the line of code below into the Elastic VPS SSH web session (black window) and give enter:

tmux attach -t avalanche

Then, duplicate the session and enter — copy and paste — each line of code in the Elastic VPS SSH web session (black window) and press “enter”, and so on, line by line, until the last command line, in the following order:

tmux new -s avalancheexport PATH=$PATH:/usr/local/go/bin

Now we have to make sure that the node has initialized. When the node is started, it needs to follow the rest of the network. Below we see that the bootstrap was completed successfully, as shown in the image below.

To check if the node was initialized in the Avalanche network, enter — copy and paste — the command line block in the SSH Web session (black window) of Elastic VPS and press “enter”:

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

If this command block returns “ true ”, the chain is initialized.

If that command block returns “API call rejected because chain is not done bootstrapping”, the chain has not been initialized.

After the node is following the rest of the Avalanche network, obtain your nodeID. Insert — copy and paste — the command line block into the Elastic VPS Web SSH session (black window) and press “enter”:

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

Make a note of your nodeID.

ACCOUNT CREATION AND X-CHAIN ​​ADDRESS

At this point, create your username and password.

After creating your username and password, enter your username in YOUR USERNAME and your password in YOUR PASSWORD.

Insert — copy and paste — the command line block and press “enter”:

curl -X POST --data '{
"jsonrpc": "2.0",
"id": 1,
"method": "keystore.createUser",
"params": {
"username": "YOUR USERNAME",
"password": "YOUR PASSWORD"
}
}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/keystore

Write down your username and password.

Now that you have your account (username and password), create your ADDRESS IN X-CHAIN ​​that will receive the AVAX tokens.

Now create your X-Chain address.

Enter your username in YOUR USERNAME and your password in YOUR PASSWORD and enter — copy and paste — the command line block and hit “enter”:

curl -X POST --data '{
"jsonrpc":"2.0",
"id" :1,
"method" :"avm.createAddress",
"params" :{
"username": "YOUR USERNAME",
"password": "YOUR PASSWORD"
}
}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/X

Write down your X-Chain address.

BACKUP YOUR AVALANCHE NETWORK NODE

Before updating your Avalanche network node it is recommended to back up your staker files, which are used to identify your node on the network. In the standard installation, you can copy them by entering — copy and paste — each line of code and hit “enter”, successively, line by line, until the last command line, in the following order:

cdcp ~/.avalanchego/staking/staker.crt .cp ~/.avalanchego/staking/staker.key .

After downloading the files staker.crtand staker.keycheck if the files have been downloaded by entering - copy and paste - the line of code and hit "enter":

ls -ltra

Keep the files staker.crtand staker.keyin a safe and private place. If something happens to your node, these files can be used to fully recreate your node from the Avalanche network.

AVALANCHE NETWORK NODE UPDATE

Before updating your Avalanche network node, check the current version of your node by entering — copy and paste — the command line block and press “enter”:

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

If you need to update your Avalanche network node version, duplicate the session and enter — copy and paste — each line of code into the Elastic VPS SSH web session (black window) and press “enter”, and so on, line by line, to the last command line, in the following order:

tmux new -s avalancheexport PATH=$PATH:/usr/local/go/bin

Next, you need to “kill” your Avalanche network node. To do this, enter — copy and paste — the line of code and hit “enter”:

ps aux | avalanchego grep

Now you need to find the ID, a code located to the right of “root”, in the line it contains ./build/avalanchego.

Then, insert — copy and paste — the line of code and hit enter:

kill <insert the ID, a code to the right of “root”>

Wait a few minutes until your knot is dead. After “killing” your Avalanche network node, enter — copy and paste — each line of code into the Web SSH session and hit “enter”, and so on, line by line, up to the last command line, in the following order:

wget https://github.com/ava-labs/avalanchego/releases/download/v1.1.3/avalanchego-linux-amd64-v1.1.3.tar.gzsudo tar -C /usr/local -xzf avalanchego-linux-amd64-v1.1.3.tar.gzcd avalanchegogit pull && bashgit rev-parse HEAD./scripts/build.sh./build/avalanchego --version./build/avalanchego

After entering the last command above, your Avalanche network node is initializing, as shown in the image below.

We noticed that the node started synchronizing with the Avalanche network, as shown in the image below.

When the node is started, it must accompany the rest of the Avalanche network. Below we see that the bootstrap was completed successfully, as shown in the image below.

Now we should check if you have successfully upgraded your Avalanche node to the latest version of Mainet . To do this, duplicate the session and enter — copy and paste — each line of code in the Elastic VPS SSH web session (black window) and press “enter”, and so on, line by line, until the last command line, in the following order:

tmux new -s avalancheexport PATH=$PATH:/usr/local/go/bin

Then check the current version of your node by entering — copy and paste — the block of command lines and hit “enter”:

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

Remembering that the latest version of the Avalanche Mainet can be checked by clicking on the image below:

If the update has been successfully completed, the latest version of the Mainet of your Avalanche network node will be displayed.

AVALANCHE NETWORK NODE HEALTH

To check the health of the node , enter — copy and paste — the command line block in the Elastic VPS Web SSH session (black window) and press “enter”:

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

If the node is “healthy” , the answer should be as follows:

{
"jsonrpc":"2.0",
"result":{
"checks":{
"network.validators.heartbeat":{
"message":{
"heartbeat":1591041377
},
"timestamp":"2020-06-01T15:56:18.554202-04:00",
"duration":23201,
"contiguousFailures":0,
"timeOfFirstFailure":null
}
},
"healthy":true
},
"id":1
}

INTRODUCTION TO AVAX TOKENS STAKING

Staking is a natural mechanism for participating in an open network and offers a direct economic argument: the likelihood of an attack’s success is directly proportional to a well-defined monetary cost function. Staking nodes are economically motivated to act virtuously and avoid behavior that could damage their stake’s value.

A node that wants to enter the network can do so freely, first placing and blocking a stake that cannot be moved for a defined period of time determined by the token holder. Once accepted, a stake cannot be reversed or unlocked to ensure that nodes share the same stable view of the network. Even better, for both the token holder and the network, this stake does not incur additional maintenance costs.

Unlike other systems that also offer a proof-of-stake (PoS) mechanism, AVAX does not use a cut and therefore the entire stake is returned when the stake period ends.

With Avalanche, staking tokens are never at risk of a network failure.

STAKING FOR VALIDATION OF AVAX TOKENS THROUGH YOUR AVALANCHE WALLET

The AVAX token holder can participate in the staking of the primary network as a validator using the Avalanche Wallet.

AVALANCHE NETWORK NODE VALIDATOR

A validator is an AVAX token holder that operates a node and wishes to participate in the staking and validation of the primary network by issuing a special “addValidator” transaction for the platform chain (P-Chain) whose transaction specifies the following:

  • Staking amount (amount of AVAX tokens in staking).
  • NodeID (own node).
  • Start & End Time (date and time of start and end of staking).
  • Delegation Fee (delegation fee charged by the validator to the delegator).
  • Reward Address (address of your Avalanche wallet where staking rewards for validation and delegation will be sent).

Once the mentioned transaction is accepted, the funds will be blocked until the end of the AVAX token staking period.

VALIDATION STAKING PARAMETERS

  • The minimum amount to become a validator is 2,000 AVAX.
  • The minimum amount of time someone can stake AVAX tokens is 2 weeks.
  • The maximum amount of time someone can stake AVAX tokens is 1 year.
  • The validator receives a delegation fee ( Delegation Fee ) of at least 2% on the amount generated by STAKING BY DELEGATION to be received by the delegator. For example, if the delegator is entitled to 100 AVAX tokens at the end of the STAKING PER DELEGATION period, the VALIDATOR will receive 2 AVAX tokens (2%) and the DELEGATOR will receive 98 AVAX tokens (98%).
  • The validator can receive numerous delegations up to the limit of 4 times the amount of AVAX tokens in staking by validation.
  • The validator is responsible for creating and maintaining the online node above, at least, 60% of the time corresponding to the validation staking period.

Check out the parameters related to AVAX token staking below:

  • ID node: A Node unique ID derived from staker certificate of each individual node.
  • Start time: The date and time when a staking validator is started.
  • End time: The date and time when the validator’s staking is finished.
  • Delegation fee: The delegation fee is specified by each validator as it joins the Avalanche network. The delegator pays a delegation fee to the validator to which he has delegated his AVAX tokens.
  • Reward address: destination address for the staking rewards accumulated over the staking period.

IT’S TIME TO MAKE STAKING BY VALIDATION!

In view of the above, you need to have, at least, 2,000,002 AVAX tokens in your Avalanche wallet for staking by validation, as there is a fee of 0.002 AVAX for the transfer transaction from your X-CHAIN ​​address to your P-CHAIN ​​address .

If you do not have to purchase the desired quantity of AVAX tokens on the exchange of your choice. Check the list of exchanges below:

HAVE YOU CREATED YOUR AVALANCHE WALLET?

No, then create your Avalanche wallet by clicking on the image below:

With your Avalanche wallet, access it by clicking on the image below:

There are four options for accessing your Avalanche wallet. Choose one of the four options above.

In this example, we chose the MNEMONIC KEY PHASE option.

Insert your MNEMONIC KEY PHASE in the appropriate field.

Access your Avalanche wallet.

Now click on “Earn”.

After clicking on “Earn” you will be informed that you can earn more AVAX tokens by staking your AVAX tokens from your Avalanche wallet.

To do this, you must transfer your AVAX tokens from your X-CHAIN ​​address to your P-CHAIN ​​address to stake the AVAX tokens in your Avalanche wallet. Bearing in mind that you need to have at least 2,000,002 AVAX tokens in your Avalanche wallet for staking by validation, as there is a fee of 0.002 AVAX for the transfer transaction from your X-CHAIN ​​address to your P-CHAIN ​​address.

To make this transfer, in “Cross Chain Transfer”, click on the “TRANSFER” button.

Then, click again on the “TRANSFER” button.

Next, the confirmation screen that the transfer between the chains was successful (from X-CHAIN ​​to P-CHAIN) will appear.

Now click on the “BACK TO EARN” button.

To validate your AVAX tokens choose the option — Validate

Click on “ADD VALIDATOR” and fill in all the fields.

Node ID

Enter your Node ID.

Staking Period

Period of time when your AVAX tokens will be blocked for validation staking.

Start Date & Time

Staking start date and time.

End Date & Time

End date and time.

Stake Amount

Choose from at least 2,000 AVAX tokens to perform validation staking.

MAX
enter at least 2,000
AVAX

Reward Address

Address of your Avalanche wallet where the staking rewards for validation and delegation will be sent, if any.

The start date of the staking should be in the future (that is, choose the day after the day you are creating your staking) and the end date must be after the start date.

Finally, click on “SUBMIT”.

If the information “You are now validating” appears , then you have successfully become an Avalanche network validator!

To confirm that you have become an Avalanche network validator, enter — copy and paste — the command line block into the Elastic VPS Web SSH session (black window) and press “enter”:

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

If this command block returns your NodeID in the list of active validators , then you have successfully become an Avalanche network validator.

When you become a validator for the Avalanche network, your AVAX tokens are blocked for validation staking.

You will receive your blocked AVAX tokens plus AVAX token rewards as soon as your validation staking period ends.

Now if you want to see your AVAX token reward estimate, after clicking on “Earn”, click on “VIEW REWARDS”.

GET REAL-TIME ALERTS FROM THE AVALANCHE NETWORK

Keep a minute-by-minute monitoring of the operational status of your Avalanche node by clicking on the image below:

About Ava Labs:

Ava Labs Company simplifies the launch of financial applications using blockchain technology — with highly scalable and efficient networks, customizable public and private blockchains, the ability to create any digital asset and more. We are empowering people to build an open, simple and democratic Internet of finance.

Website | Whitepapers | Twitter | Discord | GitHub | Documentation | Explorer | Avalanche-X | Telegram | Facebook | LinkedIn | Reddit | YouTube

Aviso Legal

“Esse artigo é meramente informativo e não é uma recomendação de investimento, o mercado de criptomoedas é bastante volátil e você deve pesquisar e decidir por si mesmo em que investir, especialmente em mercados de alto risco”.

--

--

Avalanche Portugues
Avalanche Portugues

Written by Avalanche Portugues

Aviso Legal: Todos os artigos são meramente informativos e não são recomendações de investimento. Você deve pesquisar e decidir por si mesmo em que investir.

No responses yet