openSVM/zindexer
solana indexer for clickhouse in zig
A blazingly fast, memory-efficient Solana validator monitoring system written in Zig. Designed for high-throughput, low-latency block ingestion and real-time analytics.
Metric | Performance |
---|---|
Block Ingestion Rate | 25,000+ blocks/sec |
Memory Usage | < 50MB base, ~2MB/million slots |
CPU Usage | < 2% on single core |
Latency | < 0.5ms p99 |
WebSocket Reconnection | < 10ms |
Concurrent Connections | 10,000+ |
git clone https://github.com/yourusername/opensvm.git
cd opensvm
zig build -Drelease-fast
# Set environment variables
export SOLANA_RPC_WS="wss://your-rpc-endpoint"
export CLICKHOUSE_URL="http://localhost:8123"
# Run the indexer
./zig-out/bin/solana-indexer
Environment Variable | Description | Default |
---|---|---|
SOLANA_RPC_WS | WebSocket RPC endpoint | - |
CLICKHOUSE_URL | ClickHouse connection URL | http://localhost:8123 |
CLICKHOUSE_USER | ClickHouse username | default |
CLICKHOUSE_PASS | ClickHouse password | - |
CLICKHOUSE_DB | ClickHouse database | default |
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ
β WebSocket β --> β Parser β --> β ClickHouse β
β Client β β Engine β β Storage β
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ
β β β
β β β
βββ Zero Copy ββββββββ΄ββ Zero Alloc ββββββ
The system uses Zig's comptime features to generate zero-copy parsers, allowing direct processing of network buffers without intermediate allocations.
Built-in metrics available at /metrics
:
Validator Monitoring
Network Analysis
Performance Testing
Contributions are welcome! Please read our Contributing Guide for details on our code of conduct and the process for submitting pull requests.
This project is licensed under strict territorial restrictions - see the LICENSE file for details.