Polygon (ex Matic) Fullnode dockerfiles
Download and extract blockchain snapshots to make things faster
Check for newer snapshots at Polygon Forum
curl -LOJ --retry 10 https://matic-blockchain-snapshots.s3.amazonaws.com/matic-mainnet/heimdall-fullnode-snapshot-2021-06-09.tar.gz
curl -LOJ --retry 10 https://matic-blockchain-snapshots.s3.amazonaws.com/matic-mainnet/bor-fullnode-snapshot-2021-06-09.tar.gz
mkdir -p /data/polygon/bor/bor/chaindata/
mkdir -p /data/polygon/heimdall/data/
tar -xzvf bor-fullnode-snapshot-2021-06-09.tar.gz -C /data/polygon/bor/bor/chaindata/
tar -xzvf heimdall-fullnode-snapshot-2021-06-09.tar.gz -C /data/polygon/heimdall/data/
docker-compose -f heimdail.yml up -d
Wait for it to sync
Check sync status:
curl -s http://localhost:26657/status | jq .result.sync_info.catching_up
true
means still syncing, false
- synced
Do not start bor
until heimdall
full sync.
docker-compose -f bor.yml up -d
Check for bor
sync status.
docker exec bor bor attach --exec eth.syncing
false
means synced
- HTTP JSONRPC at port 8145
- WebSocket at 8146
- IPC (unix socket) at /data/polygon/bor/geth.ipc
Test it using geth binary:
geth attach http://localhost:8145
geth attach ws://localhost:8146
sudo geth attach /data/polygon/bor/geth.ipc
Great article How to run a Polygon (Matic) Mainnet Node with Docker by Chase Wright