arete-server
WebSocket server and projection handlers for Arete streaming pipelines.
Overview
This crate provides a builder API for creating Arete servers that:
- Process Solana blockchain data via Yellowstone gRPC
- Parse and transform data using generated IDL parsers and the Arete VM
- Stream entity updates over WebSockets to connected clients
- Serve stack-scoped HTTP reads for
/chain/*and/programs/* - Support multiple streaming modes (State, List, Append)
- Monitor stream health and connectivity status
Installation
[]
= "0.2"
Quick Start
use ;
async
Auth Plugins
arete-server supports pluggable auth for both WebSocket connections and HTTP
read endpoints. By default, all connections and HTTP reads are allowed.
When WebSocket auth is configured, HTTP reads inherit that plugin unless an
HTTP-specific plugin is configured.
use Arc;
use ;
builder
.spec
.websocket
.websocket_auth_plugin
.http_auth_plugin
.start
.await?;
The built-in StaticTokenAuthPlugin accepts either:
Authorization: Bearer <token>?token=<token>query param
For signed sessions, the same short-lived JWT can be used for both WebSocket and HTTP read requests. HTTP reads use bearer-only transport.
With Configuration
use ;
use Duration;
builder
.spec
.websocket_config
.health_config
.start
.await
Architecture
┌─────────────────────┐
│ Yellowstone gRPC │
└──────────┬──────────┘
│
▼
┌─────────────────────┐
│ Vixen Runtime │ ← Generated from IDL
└──────────┬──────────┘
│
▼
┌──────────────────────┐
│ Arete VM │ ← Processes bytecode
└──────────┬───────────┘
│
▼
┌──────────────────────┐
│ Projector │ ← Mutations → Frames
└──────────┬───────────┘
│
▼
┌──────────────────────┐
│ BusManager │ ← Pub/Sub routing
└──────────┬───────────┘
│
▼
┌──────────────────────┐
│ WebSocket Server │ ← Streams to clients
└──────────────────────┘
Feature Flags
| Feature | Default | Description |
|---|---|---|
otel |
No | OpenTelemetry integration for metrics and distributed tracing |
Health Monitoring
Built-in health monitoring tracks stream connectivity and detects issues:
- Connection Status Tracking - Monitors stream states (Connected, Disconnected, Reconnecting, Error)
- Event Staleness Detection - Warns when connected but not receiving events
- Error Counting - Tracks and logs error frequency for alerting
- Connection Duration - Records uptime for debugging stability issues
Module Structure
arete-server/
├── src/
│ ├── lib.rs # Server & ServerBuilder API
│ ├── bus.rs # Event bus manager
│ ├── config.rs # Configuration types
│ ├── runtime.rs # Runtime orchestrator
│ ├── projector.rs # Mutation → Frame transformation
│ ├── health.rs # Health monitoring
│ ├── view/ # View registry & specs
│ └── websocket/ # WebSocket infrastructure
├── Cargo.toml
└── README.md
Dependencies
tokio- Async runtimetokio-tungstenite- WebSocket supportyellowstone-vixen- Yellowstone gRPC integrationarete-interpreter- Arete VM and bytecode
License
Apache-2.0