Get 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.
ctrl + x and y to save 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.
You should now have /var/lib/heimdall/config and /var/lib/heimdall/data directories on the host.
Download genesis.json to /var/lib/heimdall/config
Modify seeds and cors_allowed_origins
Create docker-compose.yml
Paste the following into the docker-compose.yml
ctrl + x and y to save file
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
EMAIL={YOUR_EMAIL} #Your email to receive SSL renewal emails
DOMAIN={YOUR_DOMAIN} #Domain of your reth node you set earlier, polygon.indexerdao.com
WHITELIST={YOUR_REMOTE_MACHINE_IP} # Remote IP's allowed to connect to RPC
mkdir /var/lib/heimdall
mkdir /var/lib/erigon
docker run -it -v /var/lib/heimdall:/root/.heimdalld 0xpolygon/heimdall:latest init --home /root/.heimdalld