Primary Network Node Setup with Docker
Set up Instance
Set up a linux server with any cloud provider, like AWS, GCP, Azure, or Digital Ocean. For Primary Network nodes, we recommend:
- Minimum specs: 8 vCPUs, 16GB RAM, 1TB storage
- Recommended specs: 16 vCPUs, 32GB RAM, 2TB NVMe SSD
If you do not have access to a server, you can also run a node for educational purposes locally. Simply select the "Public RPC Node" option in the next step.
Docker Installation
Make sure you have Docker installed on your system. You can use the following commands to install it:
# Install Docker using convenience scriptcurl -fsSL https://get.docker.com -o get-docker.shsudo sh get-docker.shsudo usermod -aG docker $USERnewgrp docker# Test installationdocker run -it --rm hello-world# Install Dockersudo yum update -ysudo yum install -y dockersudo systemctl start dockersudo systemctl enable dockersudo usermod -aG docker $USERnewgrp docker# Test installationdocker run -it --rm hello-world# Install Docker using convenience scriptcurl -fsSL https://get.docker.com -o get-docker.shsudo sh get-docker.shsudo usermod -aG docker $USERnewgrp docker# Test installationdocker run -it --rm hello-world# Install Docker Desktop for Mac# Download from: https://www.docker.com/products/docker-desktop/echo "Please download and install Docker Desktop for Mac from the official Docker website."# After installation, you can test it by running:docker run -it --rm hello-worldIf you do not want to use Docker, you can follow the instructions here.
Configure Node Settings
Controls the verbosity of node logs
The minimum delay between blocks (in milliseconds). Maximum: 2000ms. Default: 1200ms.
Recommended for validators. Reduces disk usage by removing old state data.
Configuration Preview
Create Configuration File
Run this command on your server to create the C-Chain configuration file:
# Error generating config file commandThis creates the configuration file at ~/.avalanchego/configs/chains/C/config.json
Read the documentation for more information on the configuration options. AvalancheGo configuration and C-Chain configuration
Run Docker Command
Start the node using Docker:
docker run -it -d \ --name avago \ -p 127.0.0.1:9650:9650 -p 9651:9651 \ -v ~/.avalanchego:/root/.avalanchego \ -e AVAGO_PUBLIC_IP_RESOLUTION_SERVICE=opendns \ -e AVAGO_HTTP_HOST=0.0.0.0 \ -e AVAGO_CHAIN_CONFIG_DIR=/root/.avalanchego/configs/chains \ -e AVAGO_NETWORK_ID=fuji \ avaplatform/avalanchego:v1.14.0-fujiThe container will read the config from ~/.avalanchego/configs/chains/C/config.json via the mounted volume.
Wait for the Node to Bootstrap
Your node will now bootstrap and sync the Primary Network (P-Chain, X-Chain, and C-Chain). This process can take several hours to days depending on your hardware and network connection.
You can follow the process by checking the logs with the following command:
docker logs -f avagoDuring the bootstrapping process, the following command will return a 404 page not found error:
curl -X POST --data '{ "jsonrpc":"2.0", "method":"eth_chainId", "params":[], "id":1 }' -H 'content-type:application/json;' \http://127.0.0.1:9650/ext/bc/C/rpcOnce bootstrapping is complete, it will return a response like {"jsonrpc":"2.0","id":1,"result":"..."}.