Run Validator Nodes

Learn how to run validators nodes by starting AvalancheGo in a Docker container.

Now that the P-Chain records are set up, you can start the nodes tracking the Subnet.

Generate the Docker Command

There are many flags for the docker image. The tool below will help you navigate the configuration options and generates the docker command for you based on the subnetID. Copy the docker command and run in the terminal of your node.

Logo

Node Setup with Docker

This will start a Docker container running an RPC or validator node that tracks your subnet.

Docker Installation Command:

We will retrieve the binary images of AvalancheGo from the Docker Hub. Make sure you have Docker installed on your system.

1sudo apt-get update && \
2    sudo apt-get install -y docker.io && \
3    sudo usermod -aG docker $USER && \
4    newgrp docker
5
6# Test docker installation
7docker run -it --rm hello-world
8

If you do not want to use Docker, you can follow the instructions here.

Node Setup Command:

Follow Node Logs

To check the logs of AvalancheGo, you can use the following command:

docker logs -f avago

After the node has been started it will take a few minutes to sync the P-Chain.

Stop Node

To stop the node, you can use the following command:

docker stop avago

The node credentials and the blockchain state is persisted in the ~/.avalanchego directory. When you restart the node it will pick up where it left off.

Remove Node

docker rm avago

This will not remove the state and credentials of the node. To remove these you need to delete the ~/.avalanchego directory.

Is this guide helpful?

On this page