Skip to main content
One chain is one independent deployment unit. This page describes three topologies: single-machine validation, single-chain production, and a multi-chain cluster.

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 the trace 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

nodex-proxy is usually deployed separately and covers all chains:

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

You can deploy two write nodes: both upload to S3, and only the Leader publishes to Kafka. The standby takes over when the primary fails, avoiding a data path outage.

Common operations

  1. Download the RocksDB snapshot from S3 and extract it to --db-path
  2. Start leafage-evm; it automatically catches up to the chain head from the Kafka offset or S3
  3. It registers itself in etcd on startup; once consistency-checker confirms it has caught up, the checker sets stateType to 1
  4. nodex-proxy picks up the change through its watch and, once the health check passes, adds the node to the load balancing pool
The whole process usually completes within minutes, with no manual intervention on the proxy.
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.
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.
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
Clients need no changes.
If leafage-evm’s state becomes abnormal, you can rewind the chain head to an earlier block and resync from S3:

Troubleshooting

References