🐳Docker
Authors: [Vince | Nodeify]
System Requirements
16c CPU
Ubuntu 22.04
>= 32GB
>= 10TB SSD/NVME
Polygon ♾️
Official Docs https://wiki.polygon.technology/docs/pos/operate/node/archive-node/
Pre-requisites
Update, upgrade, and clean the system, and then firewall management (ufw), Docker, and the Git version control system.
sudo apt update -y && sudo apt upgrade -y && sudo apt auto-remove -y
sudo apt install docker.io docker-compose git ufw -ySet explicit default UFW rules
sudo ufw default deny incoming
sudo ufw default allow outgoingAllow SSH, HTTP and HTTPS
sudo ufw allow 22/tcp
sudo ufw allow 80
sudo ufw allow 443Get the IP address of the host machine, you can use the following command in a terminal or command prompt
Set an A record for a domain, you need to access the domain's DNS settings and create an A record that points to the IP address of the host machine. This configuration allows users to reach your domain by resolving the domain name to the specific IP address associated with your host machine.
Create Polygon directory
The first command, mkdir polygon, will create a new directory named polygon in the current location. The second command, cd polygon, will change your current working directory to the newly created polygon directory. Now you are inside the polygon directory and can start storing docker-compose and related files in it.
Create .env file
Paste the following into the file.
Create heimdall and erigon directories
Initialize Heimdall
Run a Docker container from the 0xpolygon/heimdall image. By using the -v flag, you're mapping the host directory /var/lib/heimdall to the container's /root/.heimdalld directory. The init --home /root/.heimdalld command initializes configurations and data on the host machine.
Download genesis.json to /var/lib/heimdall/config
/var/lib/heimdall/configModify seeds and cors_allowed_origins
Create docker-compose.yml
Paste the following into the docker-compose.yml
Run Polygon Node
Monitor Logs
Use docker logs to monitor your erigon and heimdall nodes. The -f flag ensures you are following the log output
Test Polygon RPC 🧪
Last updated
Was this helpful?