Using binaries
This deployment guide walks you through starting and running a full node through various methods. For the system requirements, see the minimum technical require
This deployment guide walks you through starting and running a full node through various methods. For the system requirements, see the minimum technical requirements guide.
Snapshots
Steps in these guide involve waiting for the Heimdall and Bor services to fully sync. This process takes several days to complete.
Please use snapshots for faster syncing without having to sync over the network. For detailed instructions, see Sync node using snapshots.
Overview
It is essential to follow the outlined sequence of actions precisely, as any deviation may lead to potential issues.
- Prepare the machine.
- Install Heimdall and Bor binaries on the full node machine.
- Set up Heimdall and Bor services on the full node machine.
- Configure the full node machine.
- Start the full node machine.
- Check node health with the community.
Install build-essential
This is required for your full node. In order to install, run the below command:
sudo apt-get update
sudo apt-get install build-essentialInstall binaries
Polygon node consists of 2 layers: Heimdall and Bor. Heimdall is a Cosmos-SDK/CometBFT fork that monitors contracts in parallel with the Ethereum network. Bor is basically a Geth fork that generates blocks shuffled by Heimdall nodes.
Both binaries must be installed and run in the correct order to function properly.
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 commands:
curl -L https://raw.githubusercontent.com/0xPolygon/install/heimdall-v2/heimdall-v2.sh | bash -s -- <heimdall_version> <network> <node_type>You can run the above command with the following options:
heimdall_version: Valid v0.2+ release tag from https://github.com/0xPolygon/heimdall-v2/releasesnetwork_type:mainnetandamoynode_type:sentry
This will install the heimdalld binary.
Then, edit the configuration files under /var/lib/heimdall/config
The 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:
cd /var/lib/heimdall/config
curl -fsSL <BUCKET_URL> -o genesis.jsonWhere 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
Verify the installation by checking the Heimdall version on your machine:
heimdalld versionIt should return the version of Heimdall you installed.
Bor
Install the latest version of Bor, based on valid v2.0+ released version.
curl -L https://raw.githubusercontent.com/0xPolygon/install/main/bor.sh | bash -s -- <bor_version> <network_type> <node_type>You can run the above command with following options:
bor_version: valid v2.0+ release tag from https://github.com/0xPolygon/bor/releasesnetwork_type:mainnetandamoynode_type:sentry
That will install the bor binary. Verify the installation by checking the Bor version on your machine:
bor versionConfigure Heimdall and Bor seeds
The latest bor and heimdall seeds can be found here. To configure them, update the following lines:
- If not done previously, set the
seedsandpersistent_peersvalues in/var/lib/heimdall/config/config.toml - Set the
bootnodesin/var/lib/bor/config.toml
This will ensure your node connects to the peers.
(Optional) Start Heimdall from snapshot
In case you want to start Heimdall from a snapshot,
you can download it, and extract in the data folder.
Examples of snapshots can be found here https://all4nodes.io/Polygon, and they are managed by the community.
e.g.:
lz4 -dc polygon-heimdall-24404501-25758577.tar.lz4 | tar -xUpdate service config user permission
sed -i 's/User=heimdall/User=root/g' /lib/systemd/system/heimdalld.service
sed -i 's/User=bor/User=root/g' /lib/systemd/system/bor.serviceStart services
Run the full Heimdall node with these commands on your Sentry Node:
sudo service heimdalld startWait for Heimdall to complete syncing
Ensure that Heimdall is fully synced before starting Bor. Initiating Bor without complete synchronization of Heimdall may lead to frequent issues.
To check if Heimdall is synced:
- On the remote machine/VM, run
curl localhost:26657/status. - In the output,
catching_upvalue should befalse.
Once Heimdall is synced, run the following command:
sudo service bor startLogs
Logs can be managed by the journalctl linux tool. Here is a tutorial for advanced usage: How To Use Journalctl to View and Manipulate Systemd Logs.
Check Heimdall node logs
journalctl -u heimdalld.service -fCheck Bor node logs
journalctl -u bor.service -fLast updated on
Sync node using snapshots
When setting up a new sentry, validator, or full node server, it is recommended that you use snapshots for faster syncing without having to sync over the networ
Using Docker
The Polygon team distributes official Docker images which can be used to run nodes on the Polygon PoS mainnet. These instructions are for running a full Node, b