logoDocumentation

Subnet Nodes

Learn how to run an Avalanche node that tracks a Subnet.

This article describes how to run a node that tracks a Subnet. It requires building AvalancheGo, adding Virtual Machine binaries as plugins to your local data directory, and running AvalancheGo to track these binaries.

This tutorial specifically covers tracking a Subnet built with Avalanche's Subnet-EVM, the default Virtual Machine run by Subnets on Avalanche.

Build AvalancheGo

It is recommended that you first complete this comprehensive guide which demonstrates how to build and run a basic Avalanche node. Below are the high level details.

Manage the Subnet Binaries

After building AvalancheGo successfully,

1. Clone Subnet-EVM

cd $GOPATH/src/github.com/ava-labs
git clone https://github.com/ava-labs/subnet-evm.git

2. Build the Binary and Save as a Plugin

In the Subnet-EVM directory, run the build script, and save it in the “plugins” folder of your .avalanchego data directory. Name the plugin after the VMID of the Subnet you wish to track. The VMID of the WAGMI Subnet is the value beginning with “srEX...”.

cd $GOPATH/src/github.com/ava-labs/subnet-evm
./scripts/build.sh ~/.avalanchego/plugins/srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy

3. Specify the Plugin with a Config.JSON

Create a file named config.json and add a track-subnets field that is populated with the SubnetID you wish to track. The SubnetID of the WAGMI Subnet is the value beginning with “28nr...”.

cd ~/.avalanchego
echo '{"track-subnets": "28nrH5T2BMvNrWecFcV3mfccjs6axM1TVyqe79MCv2Mhs8kxiY"}' > config.json

Run the Node

Run AvalancheGo with the —config-file flag to start your node and ensure it tracks the Subnets included in the configuration file.

cd $GOPATH/src/github.com/ava-labs/avalanchego
./build/avalanchego --config-file ~/.avalanchego/config.json --network-id=fuji

Note: The above command includes the --network-id=fuji command because the WAGMI Subnet is deployed on Fuji Testnet.

You should now see terminal filled with logs and information to suggest the node is properly running and has began bootstrapping to the network.

Bootstrapping and RPC Details

It may take a few hours for the node to fully bootstrap to the Avalanche Primary Network and tracked Subnets.

When finished bootstrapping, the endpoint will be:

localhost:9650/ext/bc/<BlockchainID>/rpc

if run locally, or:

XXX.XX.XX.XXX:9650/ext/bc/<BlockchainID>/rpc

if run on a cloud provider. The “X”s should be replaced with the public IP of your EC2 instance.

For more information on the requests available at these endpoints, please see the Subnet-EVM API Reference documentation.

Because each node is also tracking the Primary Network, those RPC endpoints are available as well.

Last updated on

On this page

Edit on Github