Expand description
Tidepool HTTP + WebSocket JSON-RPC server. Wraps the service layer’s async functions behind an axum front-end.
Public surface:
runstarts the server and blocks until shutdown.ServerConfigholds port, upstream URL, and optional indexed trees.HttpUpstreamis the productionUpstreamClientimpl; consumers building their own servers can import it directly.
Re-exports§
pub use config::ServerConfig;pub use http::run;pub use upstream_http::HttpUpstream;pub use ws::run_ws;
Modules§
- config
- Server configuration. Shape mirrors the TS
ProxyOptionsplus server-specific knobs (port, WS URL override). - dispatcher
- JSON-RPC method dispatch. The core architectural win: every
method we serve maps to a
Methodenum variant, and the dispatch function does an exhaustive match. Adding a new method = add a variant + a match arm; compiler fails the build if you forget. - http
- axum HTTP server: JSON-RPC over POST, CORS, passthrough proxy for anything the dispatcher doesn’t claim.
- json_
rpc - JSON-RPC 2.0 envelope types. Kept minimal + lenient — Solana’s RPC ecosystem varies slightly between 1.0 / 2.0 implementations and we want to pass through whatever clients send without over- validating.
- rest
- REST transport. Mirrors the paths
helius-sdkhits onapi.helius.xyz/v0/...— served from the same base URL as our JSON-RPC endpoint so a user pointinghelius-sdkat Tidepool gets every method, on the transport the SDK expects. - upstream_
http - Production
UpstreamClientimpl overreqwest. Plain JSON-RPC POST to the upstream URL. - webhook_
runtime - Per-process webhook runtime: registry + background delivery tasks.
- ws
- WebSocket server with polling-based subscription polyfills.
Traits§
- Upstream
Client - An abstract Solana RPC client.
rpc_callis the catch-all; typed conveniences sit on top of it where we care about ergonomics.