mirror of
https://github.com/peterlodri-sec/polygon-node-deploy.git
synced 2026-11-21 23:30:06 +01:00
Sovereign Polygon full node (Bor+Heimdall) deploy package for Hetzner dedicated
- Shell 58.1%
- Nix 41.9%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| hosts/polygon-node | ||
| modules | ||
| scripts | ||
| flake.nix | ||
| README.md | ||
polygon-node-deploy
Deploy a Polygon (Bor + Heimdall) mainnet full node — non-validator, read-only RPC — onto a Hetzner dedicated box. No secrets, no sops, no staking. The RPC (:8545) is tailnet-only by default and is meant to serve a "sovereign" verification endpoint for the VAKED token.
This package is self-contained: a minimal flake (nixpkgs + disko only, no private inputs) + the host config + provisioning/seed/status scripts. Everything below is copy-pasteable.
Requirements
- A Hetzner dedicated box with ≥32 GB RAM and ≥6 TB fast storage (ideal: 2× 3.84 TB NVMe = 7.68 TB — the chainstate is ~5.7 TB and grows ~1 TB/yr)
- A robot webservice user + password: robot.hetzner.com → user menu (top right) → Settings → "Web service and app settings"
- If you'll order an auction box, also enable Ordering in the same settings page
- A Linux/macOS machine with nix (flakes), git, ssh, curl and jq
- Your SSH public key (
~/.ssh/id_ed25519.pub, or setSSH_PUBKEY)
1 · Clone
git clone https://github.com/peterlodri-sec/polygon-node-deploy.git
cd polygon-node-deploy
2 · Provision an EXISTING box
export ROBOT_USER='<your-robot-webservice-user>'
export ROBOT_PASS='<your-robot-webservice-password>'
export SERVER_NUMBER='<server-number>' # robot.hetzner.com → Servers
export SERVER_IP='<ipv4>'
./scripts/provision-polygon-robot.sh --order
The script will:
- Register your SSH key with the robot API,
- Boot the box into the rescue system (one-shot, expires in 60 min),
- Show the disk layout + NICs and pause for confirmation (verify
nvme0n1+nvme1n1and anen*NIC before answeringy), - Install NixOS via
nixos-anywhere(kexec → disko mdadm RAID-0 → reboot).
2b · (alternative) Order a Server-Auction box
Requires Ordering enabled (see above). Prices are a Dutch auction — check --list, pick one:
./scripts/provision-polygon-robot.sh --list # 7TB+ NVMe boxes, price-sorted
PRODUCT_ID=<id> ./scripts/provision-polygon-robot.sh --order
3 · Join the tailnet + seed
ssh root@<SERVER_IP>
tailscale up # join your tailnet; the RPC :8545 is reachable there only
# copy the seed/status scripts onto the box, then run the seed
scp scripts/polygon-node-seed.sh scripts/polygon-node-status.sh root@<SERVER_IP>:/usr/local/bin/
ssh root@<SERVER_IP> polygon-node-seed.sh --snapshot # snapshot = ~1-2 days to synced
--snapshotdownloads + extracts the ~5.7 TB chainstate (setSNAPSHOT_BOR_URL/SNAPSHOT_HEIMDALL_URLfrom https://all4nodes.io/Polygon or https://publicnode.com/snapshots#polygon — they rotate).- Without
--snapshotit syncs from genesis (2–4 weeks).
4 · Watch sync, then start Bor
Heimdall must be fully synced before Bor starts:
curl -s localhost:26657/status | jq .result.sync_info.catching_up # wait for false
systemctl start podman-polygon-bor.service
curl -s -X POST localhost:8545 -H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' # false == synced
5 · Status / verify
polygon-node-status.sh # bor+heimdall sync, disk, VAKED totalSupply (expect 50 VAKED)
Notes
- IPv6 is optional: the host boots IPv4-DHCP + Tailscale out of the box. To also configure IPv6, fill the
Addressathosts/polygon-node/default.nix:44with the box's/64(robot APIGET /server/{id}→subnets) and redeploy. - Reboots: Bor is
autoStart = false(it must not start before Heimdall is caught up). Once the node is synced + stable, flip it totrueinmodules/polygon-node.nix(containers.polygon-bor.autoStart) so a reboot restarts it automatically. - Disk failure: the layout is mdadm RAID-0 (no redundancy — the chainstate is re-synced from a snapshot in 1–2 days). Recovery = re-provision via step 2 + seed.
- Versions: bor
2.10.0, heimdall-v20.10.0, heimdall rest-server1.0.3(current multi-arch tags; the docs still pin stale ones).
the constellation · 0 + 1 · fine touch from within · vaked.dev