Skip to main content

Crate hyperstack_server

Crate hyperstack_server 

Source
Expand description

§hyperstack-server

WebSocket server and projection handlers for HyperStack streaming pipelines.

This crate provides a builder API for creating HyperStack servers that:

  • Process Solana blockchain data via Yellowstone gRPC
  • Transform data using the HyperStack VM
  • Stream entity updates over WebSockets to connected clients
  • Support multiple streaming modes (State, List, Append)

§Quick Start

use hyperstack_server::{Server, Spec};

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    Server::builder()
        .spec(my_spec())
        .websocket()
        .bind("[::]:8877".parse()?)
        .health_monitoring()
        .start()
        .await
}

§Feature Flags

  • otel - OpenTelemetry integration for metrics and distributed tracing

Re-exports§

pub use bus::BusManager;
pub use bus::BusMessage;
pub use cache::EntityCache;
pub use cache::EntityCacheConfig;
pub use config::HealthConfig;
pub use config::HttpHealthConfig;
pub use config::ReconnectionConfig;
pub use config::ServerConfig;
pub use config::WebSocketConfig;
pub use config::YellowstoneConfig;
pub use health::HealthMonitor;
pub use health::SlotTracker;
pub use health::StreamStatus;
pub use http_health::HttpHealthServer;
pub use materialized_view::MaterializedView;
pub use materialized_view::MaterializedViewRegistry;
pub use materialized_view::ViewEffect;
pub use mutation_batch::EventContext;
pub use mutation_batch::MutationBatch;
pub use mutation_batch::SlotContext;
pub use projector::Projector;
pub use runtime::Runtime;
pub use telemetry::init as init_telemetry;
pub use telemetry::TelemetryConfig;
pub use view::Delivery;
pub use view::Filters;
pub use view::Projection;
pub use view::ViewIndex;
pub use view::ViewSpec;
pub use websocket::AllowAllAuthPlugin;
pub use websocket::AuthDecision;
pub use websocket::AuthDeny;
pub use websocket::AuthErrorDetails;
pub use websocket::ChannelUsageEmitter;
pub use websocket::ClientInfo;
pub use websocket::ClientManager;
pub use websocket::ConnectionAuthRequest;
pub use websocket::ErrorResponse;
pub use websocket::Frame;
pub use websocket::HttpUsageEmitter;
pub use websocket::Mode;
pub use websocket::RateLimitConfig;
pub use websocket::RateLimitResult;
pub use websocket::RateLimiterConfig;
pub use websocket::RefreshAuthRequest;
pub use websocket::RefreshAuthResponse;
pub use websocket::SignedSessionAuthPlugin;
pub use websocket::SocketIssueMessage;
pub use websocket::StaticTokenAuthPlugin;
pub use websocket::Subscription;
pub use websocket::WebSocketAuthPlugin;
pub use websocket::WebSocketRateLimiter;
pub use websocket::WebSocketServer;
pub use websocket::WebSocketUsageBatch;
pub use websocket::WebSocketUsageEmitter;
pub use websocket::WebSocketUsageEnvelope;
pub use websocket::WebSocketUsageEvent;

Modules§

bus
cache
Entity cache for snapshot-on-subscribe functionality.
compression
Application-level compression for WebSocket payloads.
config
health
http_health
materialized_view
Materialized view evaluation for view pipelines.
mutation_batch
MutationBatch - Envelope type for propagating trace context across async boundaries.
projector
runtime
sorted_cache
Sorted view cache for maintaining ordered entity collections.
telemetry
Optional telemetry initialization helper.
view
websocket

Structs§

AsyncVerifier
Async verifier with JWKS caching support
AuthContext
Auth context extracted from a verified token
KeyLoader
Key loader for different sources
Limits
Resource limits for a session
Server
Main server interface with fluent builder API
ServerBuilder
Builder for configuring and creating a HyperStack server
Spec
Specification for a HyperStack server Contains bytecode, parsers, and program information
TokenVerifier
Token verifier for validating session tokens using Ed25519 (EdDSA)
VerifyingKey
A verifying key for token verification

Enums§

RetryPolicy
Retry policy for authentication errors

Type Aliases§

ParserSetupFn
Type alias for a parser setup function.