How to Run a Validator ?
Hardware/Software Requirements
CPU: Equivalent of 8 AWS vCPU
RAM: 16 GiB
Storage: 1 TiB
OS: Ubuntu 20.04 or MacOS >= 12
AWS Specifications
Instance type: c52x.large
volume: 1 TB
Public IP
Ports: 9650 & 9651
Running the script
To download and run the script, enter the following in the terminal:
The output should be look like this
And then the script will prompt you for information about the network environment:
enter 1
if you have dynamic IP, and 2
if you have a static IP. If you are on a static IP, it will try to auto-detect the IP and ask for confirmation.
Confirm with y
, or n
if the detected IP is wrong (or empty), and then enter the correct IP at the next prompt.
Next, you have to set up RPC port access for your node. Those are used to query the node for its internal state, to send commands to the node, or to interact with the platform and its chains (sending transactions, for example). You will be prompted:
If you're ok with sending RPC requests only from the node machine itself, enter local
at the prompt. If you want to be able to send RPC requests to your node from a remote machine, enter any
. Please note that if you choose to allow RPC requests on any network interface you will need to set up a firewall to only let through RPC requests from known IP addresses, otherwise your node will be accessible to anyone and might be overwhelmed by RPC calls from malicious actors! If you do not plan to use your node to send RPC calls, enter local
for increased node security.
The script will then continue with system service creation and finish with starting the service:
The script is finished, and you should see the system prompt again.
Post Installation
AvalancheGo should be running in the background as a service. You can check that it's running with:
This will print the node's latest logs, which should look like this:
Note the active (running)
which indicates the service is running ok. You may need to press q
to return to the command prompt.
To find out your NodeID, which is used to identify your node to the network, run the following command:
It will produce output like:
Prepend NodeID-
to the value to get, for example, NodeID-6seStrauyCnVV7NEVwRbfaT9B6EnXEzfY
. Store that; it will be needed for staking or looking up your node.
Your node should be in the process of bootstrapping now. You can monitor the progress by issuing the following command:
Press ctrl+C
when you wish to stop reading node output.
Stopping the Node
To stop AvalancheGo, run:
To start it again, run:
Node Upgrade
AvalancheGo is an ongoing project and there are regular version upgrades. Most upgrades are recommended but not required. Advance notice will be given for upgrades that are not backwards compatible. When a new version of the node is released, you will notice log lines like:
It is recommended to always upgrade to the latest version, because new versions bring bug fixes, new features and upgrades.
To upgrade your node, just run the installer script again:
It will detect that you already have AvalancheGo installed:
It will then upgrade your node to the latest version, and after it's done, start the node back up, and print out the information about the latest version:
Advanced Node Configuration
Without any additional arguments, the script installs the node in a most common configuration. But the script also enables various advanced options to be configured, via the command line prompts. Following is a list of advanced options and their usage:
admin
- Admin API will be enabledarchival
- disables database pruning and preserves the complete transaction historystate-sync
- ifon
state-sync for the C-Chain is used, ifoff
it will use regular transaction replay to bootstrap; state-sync is much faster, but has no historical datadb-dir
- use to provide the full path to the location where the database will be storedfuji
- node will connect to Fuji testnet instead of the mainnetindex
- Index API will be enabledip
- usedynamic
,static
arguments, of enter a desired IP directly to be used as the public IP node will advertise to the networkrpc
- useany
orlocal
argument to select any or local network interface to be used to listen for RPC callsversion
- install a specific node version, instead of the latest. See here for usage.
Please note that configuring index
and archival
options on an existing node will require a fresh bootstrap to recreate the database.
Complete script usage can be displayed by entering:
Unattended Installation
If you want to use the script in an automated environment where you cannot enter the data at the prompts you must provide at least the rpc
and ip
options. For example:
Usage Examples
To run a Fuji node with indexing enabled and autodetected static IP:
To run an archival mainnet node with dynamic IP and database located at /home/node/db
:
To use C-Chain state-sync to quickly bootstrap a mainnet node, with dynamic IP and local RPC only:
To reinstall the node using node version 1.7.10 and use specific IP and local RPC only:
Node Configuration
File that configures node operation is ~/.avalanchego/configs/node.json
. You can edit it to add or change configuration options. The documentation of configuration options can be found here. Configuration may look like this:
Note that configuration file needs to be a properly formatted JSON
file, so switches are formatted differently than for command line, so don't enter options like --dynamic-public-ip=opendns
but as in the example above.
Script also creates an empty C-Chain config file, located at ~/.avalanchego/configs/chains/C/config.json
. By editing that file you can configure the C-Chain, as described in detail here.
Using a Previous Version
The installer script can also be used to install a version of AvalancheGo other than the latest version.
To see a list of available versions for installation, run:
It will print out a list, something like:
To install a specific version, run the script with --version
followed by the tag of the version. For example:
danger
Note that not all AvalancheGo versions are compatible. You should generally run the latest version. Running a version other than latest may lead to your node not working properly and, for validators, not receiving a staking reward.
Thanks to community member Jean Zundel for the inspiration and help implementing support for installing non-latest node versions.
Reinstall and Script Update
Installer script gets updated from time to time, with new features and capabilities added. To take advantage of new features or to recover from modifications that made the node fail, you may want to reinstall the node. To do that, fetch the latest version of the script from the web with:
After the script has updated, run it again with the --reinstall
config flag:
This will delete the existing service file, and run the installer from scratch, like it was started for the first time. Note that the database and NodeID will be left intact.
Last updated