This guide was created using Ubuntu 24.0.4 LTS as the base operating system. While any *nix-based system should work, these instructions are tailored for Ubuntu.
- A wallet with 5 $POL ($MATIC) & (250,010 $CHAIN) on Polygon mainnet.
- This wallet will be referred to as the Primary Wallet.
- A dedicated Polygon RPC node from a provider like Ankr or Alchemy. You can sign up for a free account.
| Component | Minimum Requirement | Recommended |
|---|---|---|
| Processor | 4-core CPU | 8-core CPU |
| Memory | 8 GB RAM | 16 GB RAM |
| Storage | 160 GB SSD | 1 TB SSD |
| Network | High-speed internet connection | Dedicated server with gigabit connection |
| OS | Ubuntu LTS | Ubuntu LTS |
When setting up the Supernet Validator Node, you need the following dependencies:
sudo apt update
sudo apt install -y curl vim netcat-traditional jq screen psmiscsudo apt install -y nodejs npmcurl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bashexport NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"nvm install 18nvm use 18wget https://dl.google.com/go/go1.20.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.20.linux-amd64.tar.gzAppend the following lines at the end of the file:
export GOPATH=$HOME/go
export GOROOT=/usr/local/go
export PATH=$PATH:/usr/local/go/binsource ~/.profile
go version⚠ Warning: The
genesis.jsonfile is crucial for running the node correctly. Do not modify it except for RPC changes.
git clone https://github.com/Chain-Games/supernet-validator-node.git
cd supernet-validator-node
npm installReplace the jsonRPCEndpoint value with your Polygon Mainnet RPC URL from Ankr or Alchemy (or another provider).
"jsonRPCEndpoint": "your-rpc-here"Modify the following files to include your Polygon Mainnet RPC URL and Primary Wallet Private Key:
./.env./scripts/.env
sudo ./scripts/addValidator-
You have 2 options for starting the validator node.
- Option 1 is to run it locally using the local binary. (Preferred)
- Option 2 is to run it from a Docker container.
-
Only choose one option and follow those instructions. Don't perform both options.
sudo screen ./scripts/startCheck if the process is running:
ps ax | grep polygonExample output:
./polygon-edge server --data-dir ./test-chain-5 --chain ./genesis.json --grpc-address :10000 --libp2p 0.0.0.0:30301 --jsonrpc :10002 --relayer --num-block-confirmations 2 --seal --log-level INFOIf screen terminates, run:
sudo ./scripts/startsudo apt-get update
sudo apt-get install -y ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.ascecho "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get updatesudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-pluginsudo docker run hello-worldsudo docker build -t validator5 .
sudo docker run -d --name validator5 -it -p 10000:10000 -p 30301:30301 -p 10002:10002 validator5:latest /bin/fish
sudo docker exec -it validator5 /bin/fishsudo screen ./scripts/startsudo docker exec -it validator5 /bin/fishps ax | grep polygonExample output:
./polygon-edge server --data-dir ./test-chain-5 --chain ./genesis.json --grpc-address :10000 --libp2p 0.0.0.0:30301 --jsonrpc :10002 --relayer --num-block-confirmations 2 --seal --log-level INFOsudo killall polygon-edge⚠ Warning: When you run the validator node script, it creates a new wallet address and private key. This is a different wallet address and key than what you started with. The validator.key file is your node's private key. DON'T LOSE IT or you will lose access to your stake. Back this key up. You can also add it to your MetaMask or any other EVM wallet as well to have another instance of it.
sudo cat ./test-chain-5/consensus/validator.key- Note: Navigate to this updateValidatorInfo repository, and follow the instructions there.
https://github.com/Chain-Games/updateValidatorInfo
Example:
node setValidatorInfo.js validatorPrivateKey CG-Validator " " /root/chaingames.pngnode updateCommissionRate.js <pk> <amount-in-percentage>Example (2% commission):
node updateCommissionRate.js validatorPrivateKey 2🎉 Congratulations! Your Supernet Validator Node is now set up!