Infrastructure
A production deployment needs three pieces of shared infrastructure:
Multiple chains share the same infrastructure: all Kafka topics, S3 keys, and etcd keys start with the
chainID.
Setup 1: single-machine validation
No Kafka or S3 needed. The write node exposes thetrace namespace and leafage-evm polls it in HTTP mode. Suitable for local development and for validation when adapting a new chain.
Setup 2: single-chain production
Resource planning (ETH mainnet)
leafage-evm’s QPS scales roughly linearly with the number of CPU cores. To increase query throughput, scale only this one service’s CPU and memory.
Disks need at least 3000 IOPS; SSD is recommended, and reserve 20–30% capacity headroom.
On AWS, gp3’s default 3000 IOPS / 125 MB/s is enough for steady-state operation (one block every 12 seconds), but two phases of the first startup put higher pressure on the disk:
- Snapshot extraction is limited by sequential write throughput.
- Catch-up after snapshot restore is limited by random read/write IOPS.
Enabling
--ancient.prune on the write node reduces disk usage significantly: historical block bodies and receipts are pruned once they leave the most recent 90000-block window. Downstream consumers read from S3 and do not depend on the write node keeping historical block bodies. Requires --syncmode full.Setup 3: multi-chain cluster
Common operations
Add a query node
Add a query node
- Download the RocksDB snapshot from S3 and extract it to
--db-path - Start leafage-evm; it automatically catches up to the chain head from the Kafka offset or S3
- It registers itself in etcd on startup; once consistency-checker confirms it has caught up, the checker sets
stateTypeto1 - nodex-proxy picks up the change through its watch and, once the health check passes, adds the node to the load balancing pool
Take a query node offline
Take a query node offline
Just stop the process. leafage-evm deletes its own etcd key on exit; even if it exits abnormally, consistency-checker marks it offline and deletes it after its polling fails.
Switch the write node Leader
Switch the write node Leader
Through nodex-proxy’s admin API:You can also modify
{chainID}/writers/leader in etcd directly. After the switch, the new Leader waits for grace_period before it starts publishing.Version switching
Version switching
In version mode, modify
{chainID}/version in etcd:- After consistency-checker detects the version change, it releases or acquires the singleton topic’s publish lock and aligns the topic to the new version’s progress
- nodex-proxy rewrites requests for the base chain ID to the
{chainId}-{version}node pool
Rewind and resync
Rewind and resync
If leafage-evm’s state becomes abnormal, you can rewind the chain head to an earlier block and resync from S3:
Troubleshooting
References
- leafage-evm deployment guide — includes one-click scripts, snapshot download, and directory layout
- nodex-proxy deployment guide (Chinese) — Docker Compose, Kubernetes, systemd, and production tuning
- consistency-checker deployment notes