Node Upgrade
In this section, we will learn how to upgrade the AvalancheGo version on many nodes simultaneously with a single command.
For this tutorial, we will use the local
inventory provided by the Ansible Avalanche Getting Started repository. See Create a Local Test Network for details.
Always make sure you have the latest version of the collection installed. See Installation and upgrade.
Check the current AvalancheGo version
- Using the Ash CLI
- Using cURL
Let's start by checking the current version of my node(s) with the Ash CLI:
multipass exec validator01 -- ash avalanche node info
Node '127.0.0.1:9650':
ID: NodeID-7Xhw2mDxuDS44j42TCB6U5579esbSt3Lg
Network: local
Public IP: 10.117.207.160
Staking port: 9651
Versions:
AvalancheGo: avalanche/1.11.3
[...]
Let's start by checking the current version of my node(s) with an API call:
multipass exec validator01 -- curl -s -X POST --data '{
"jsonrpc":"2.0",
"id" :1,
"method" :"info.getNodeVersion"
}' -H 'content-type:application/json;' http://127.0.0.1:9650/ext/info |
jq -r '.result.version'
avalanche/1.11.3
As we can see above, our node is currently running AvalancheGo version 1.11.3
. This is what's expected because of the Ansible role variable avalanchego_version: 1.11.3
set at avalanche_nodes.yml in our inventory.
Upgrade the AvalancheGo version
Let's upgrade our nodes by changing the avalanchego_version
Ansible variable to 1.11.4
with the following command:
sed -i 's/avalanchego_version: 1.11.3/avalanchego_version: 1.11.4/' inventories/local/group_vars/avalanche_nodes.yml
We can then upgrade all the nodes defined in our Ansible inventory by running the provision_nodes
playbook again:
ansible-playbook ash.avalanche.provision_nodes -i inventories/local
Verify the new AvalancheGo version
- Using the Ash CLI
- Using cURL
By running the same command as previously:
multipass exec validator01 -- ash avalanche node info
We can confirm that our node is now running AvalancheGo 1.11.4
:
Node '127.0.0.1:9650':
ID: NodeID-7Xhw2mDxuDS44j42TCB6U5579esbSt3Lg
Network: local
Public IP: 10.117.207.160
Staking port: 9651
Versions:
AvalancheGo: avalanche/1.11.4
[...]
By running the same API call as previously:
multipass exec validator01 -- curl -s -X POST --data '{
"jsonrpc":"2.0",
"id" :1,
"method" :"info.getNodeVersion"
}' -H 'content-type:application/json;' http://127.0.0.1:9650/ext/info |
jq -r '.result.version'
We can confirm that our node is now running AvalancheGo 1.11.4
:
avalanche/1.11.4