There is limited space for accepting new validators. New validators can only join the active set when an already active validator unbonds.
Prerequisites
- Two machines - one sentry and one validator.
-
build-essentialinstalled on both the sentry and the validator machines. To install: - Go 1.24+ installed on both the sentry and the validator machines.
-
RabbitMQ installed on the validator machine.
Here are the commands to install RabbitMQ:
Overview
To set up a running validator node, follow these steps in the exact sequence:- Prepare two machines, one for the sentry node and one for the validator node.
- Install the Heimdall and Bor binaries on the sentry and validator machines.
- Set up the Heimdall and Bor service files on the sentry and validator machines.
- Configure the sentry node.
- Start the sentry node.
- Configure the validator node.
- Set the owner and signer keys.
- Start the validator node.
Installing the binaries
Install both Heimdall and Bor in the correct order on both the sentry and validator machines.Install Heimdall
Install the latest version of Heimdall and related services. Make sure you checkout to the correct release version. To install Heimdall, run the following command:heimdall_version: valid v0.2+ release tag from https://github.com/0xPolygon/heimdall-v2/releasesnetwork_type:mainnetandamoynode_type:sentry
heimdalld binary.
Then, edit the configuration files under /var/lib/heimdall/configThe templates for each supported network are available here
Download the
genesis.json file and place it under /var/lib/heimdall/config/
Use the following commands based on your target network:
BUCKET_URL is
- https://storage.googleapis.com/amoy-heimdallv2-genesis/migrated_dump-genesis.json for amoy
- https://storage.googleapis.com/mainnet-heimdallv2-genesis/migrated_dump-genesis.json for mainnet
Before proceeding, ensure that Heimdall is installed on both the sentry and validator machines.
Install Bor
Install the latest version of Bor. Make sure you checkout to the correct release version.bor_version: valid v2.0+ release tag from https://github.com/0xPolygon/bor/releasesnetwork_type:mainnetandamoynode_type:sentry
bor binary. Verify the installation by checking the Bor version on your machine:
Before proceeding, make sure that Bor is installed on both the sentry and validator machines.
Configure Bor
Open the Bor configuration file for editing using:config.toml, add the boot node addresses consisting of a node ID, an IP address, and a port
by adding them under bootnodes in [p2p.discovery] section, shared in the next section.
Now, add the following in the config.toml file:
- Log in to the validator machine
- Run
bor attach /var/lib/bor/bor.ipc - Run
admin.nodeInfo.enode
PC console is only accessible when Bor is running. To get the enode of the validator node, setup the validator node and then run the above commands.
config.toml.
Seeds and Bootnodes
The latest bor and heimdall seeds can be found here. Adding them will ensure your node connects to the peers.Configuring a firewall
The sentry machine must have the following ports open to the world0.0.0.0/0:
26656- Your Heimdall service will connect your node to other nodes Heimdall service.30303- Your Bor service will connect your node to other nodes Bor service.
Starting the sentry node
First, start the Heimdall service. Then, once the Heimdall service syncs, start the Bor service.The Heimdall service can take several days to sync from scratch fully.Alternatively, you can use a maintained snapshot, which will reduce the sync time to a few hours.
For detailed instructions, see Snapshot Instructions for Heimdall and Bor.
Starting the Heimdall service
Start the Heimdall service:In the logs, you may see the following errors:
Stopping peer for errorMConnection flush faileduse of closed network connection
catching_up signifies the following:
true: The Heimdall service is syncing.false: The Heimdall service is fully synced.
Starting the Bor service
Once the Heimdall service is fully synced, start the Bor service. Start the Bor service:Configuring the validator node
In order to proceed, you’ll need to have access to an RPC endpoint of a fully synced Ethereum mainnet node ready.
Configuring the Bor service
Open config file for editing using:vi /var/lib/bor/config.toml
Change the value of static-nodes parameter as follows:
- Log in to the sentry machine.
- Run
bor attach /var/lib/bor/bor.ipc. - Run
admin.nodeInfo.enode.
Setting the Owner and Signer Key
On Polygon PoS, it is recommended that you keep the owner and signer keys different.- Signer: The address that signs the checkpoint transactions. It is advisable to keep at least 1 ETH on the signer address.
- Owner: The address that is used to perform the staking transactions. It is advisable to keep the POL tokens on the owner address.
Generating a Heimdall private key
You must generate a Heimdall private key only on the validator machine. Do not generate a Heimdall private key on the sentry machine. To generate the private key, run:ETHEREUM_PRIVATE_KEY is your Ethereum wallet’s private key.
This will generate priv_validator_key.json. Move the generated JSON file to the Heimdall configuration directory using the following command:
Generating a Bor keystore file
You must generate a Bor keystore file only on the validator machine. Do not generate a Bor keystore file on the sentry machine. To generate the private key, run:ETHEREUM_PRIVATE_KEY is your Ethereum wallet’s private key.
When prompted, set up a password to the keystore file.
This will generate a UTC-<time>-<address> keystore file.
Move the generated keystore file to the Bor configuration directory using the following command:
Add password.txt
Make sure to create a password.txt file, then add the Bor keystore file password in the
/var/lib/bor/password.txt file.
Add your Ethereum address
Openconfig.toml for editing: vi /var/lib/bor/config.toml.
Please ensure that and similarly, for the
priv_validator_key.json & UTC-<time>-<address> files have relevant permissions.To set the permissions for priv_validator_key.json, run:UTC-<time>-<address> file, run:Starting the Heimdall service
You will now start the Heimdall service on the validator machine. Once the Heimdall service syncs, you will start the Bor service on the validator machine. Start the Heimdall service using the following command:The rest service and the bridge starts along with heimdall.
catching_up signifies the following:
true: The Heimdall service is syncing.false: The Heimdall service is synced.