Chain Gateway
The Chain Gateway provides application-aware load balancing across blockchain nodes, supporting both public networks and private consortium deployments with intelligent routing, failover, and performance optimization.
Overview
The Chain Gateway manages all outbound blockchain connectivity. This component load balances across multiple RPC endpoints, handles failover automatically, and optimizes request routing based on operation characteristics.
Production blockchain deployments require more than single-node connectivity. Node maintenance, network partitions, and capacity limits demand resilient multi-node architectures. The Chain Gateway provides this resilience transparently to application code.
Architecture
Load balancing strategies
| Strategy | Selection criteria | Optimal for |
|---|---|---|
| Round robin | Sequential distribution | Homogeneous node pools |
| Latency-based | Lowest response time | Geographic distribution |
| Health-weighted | Healthy nodes preferred | Mixed reliability pools |
| Operation-aware | Write to primary, read to replicas | Read-heavy workloads |
Health monitoring
The gateway continuously monitors node health through:
Block height tracking: Nodes significantly behind chain head mark as degraded.
Response latency: Slow nodes receive reduced traffic allocation.
Error rate monitoring: High error rates trigger temporary removal from pool.
Connection testing: Periodic probes verify connectivity independent of traffic.
Network support
Public networks
Public network connectivity uses multiple RPC providers for redundancy. The gateway abstracts provider differences behind consistent interfaces.
| Network type | Configuration | Failover behavior |
|---|---|---|
| Ethereum mainnet | Multiple RPC providers | Automatic failover |
| Polygon | Provider plus self-hosted | Prefer self-hosted |
| Arbitrum | Provider plus sequencer | Sequencer for writes |
| Testnets | Provider endpoints | Best-effort routing |
Private networks
Private consortium networks connect through self-hosted or managed nodes. The gateway supports:
Besu networks: Enterprise Ethereum with permissioning and privacy features.
Custom chains: Application-specific chains with modified consensus.
Air-gapped deployments: Isolated networks without external connectivity.
Performance optimization
Connection pooling
Persistent connections to nodes eliminate connection establishment overhead. Pool sizes scale based on traffic patterns and node capacity.
Request batching
Multiple read requests targeting the same node batch into single RPC calls. Batching reduces network round trips and improves throughput.
Response caching
Immutable data caches locally. Block data, transaction receipts, and historical state cache with appropriate TTLs. Cache invalidation triggers on chain reorganizations.
Retry optimization
Failed requests retry on alternate nodes rather than immediate retry to the same node. This behavior accelerates recovery from node-specific failures.
Failover handling
Node failures trigger immediate failover:
- Health checker detects failure through error threshold or probe failure
- Load balancer removes node from active pool
- In-flight requests redirect to healthy nodes
- Recovery probes continue until node returns to health
- Recovered node gradually receives traffic
Failover completes in seconds without application awareness.
Metrics and observability
The gateway exposes operational metrics:
- Request counts by node and operation type
- Latency percentiles per node
- Error rates and types
- Node health status history
- Pool composition changes
Metrics integrate with the observability stack for dashboards and alerting.
See also
- Chain Indexer for event processing
- Transaction Signer for transaction submission
- Observability for monitoring
- EVM RPC Node for network access
Chain Indexer
The Chain Indexer transforms blockchain-optimized event logs and storage into domain model data structures optimized for application queries, providing millisecond-latency access to historical blockchain state.
EVM RPC Node
The EVM RPC Node provides the direct interface to blockchain networks, handling JSON-RPC requests for transaction submission, state queries, and event subscription across public and private EVM-compatible chains.