Lantern - WebSocket Support
Lantern supports Solana WebSocket methods for real-time account and program subscriptions on a local caching stack.
Supported WebSocket Methods
In addition to answering RPC requests about cached accounts, Lantern supports the following WebSocket methods:
accountSubscribe
Subscribe to account changes
accountUnsubscribe
Unsubscribe from account updates
programSubscribe
Subscribe to program account changes
programUnsubscribe
Unsubscribe from program updates
You can access these methods as usual — just make your requests to the Lantern port in your config file.
WebSockets respond to Lantern's runtime caching feature a little differently than normal RPC calls. See Runtime Behavior for more information.
Usage
Subscribing to an account or program that Lantern is caching will work normally and provide real-time updates as the data changes.
The exact behavior when subscribing to accounts or programs Lantern is not caching depends on the cache_requests setting in your configuration:
cache_requests = true
Subscribing to an uncached account will cause Lantern to fetch and begin caching it. After this, subscriptions work as expected. Note: caching System or Token Program accounts can consume significant bandwidth — a Business plan at FluxRPC is recommended.
Subscribing to an uncached program will fail (returns "not found"). To subscribe to a program, add it to your config file explicitly.
cache_requests = false
Subscribing to an account or program that Lantern is not currently caching will fail (returns "not found").
Regardless of configuration, trying to subscribe to an account or program that doesn't exist will fail (returns "not found").
Open the section overview for the broader context, live navigation, and interactive code examples.
Continue in this section
- Lantern - Yellowstone gRPC Support — Lantern supports Yellowstone gRPC for efficient account and owner subscriptions with reduced bandwidth usage.
- Lantern - Runtime Behavior — Learn how Lantern behaves during startup, runtime requests, network failures, and shutdown or restart cycles.
- Lantern - Benchmarking — Learn how to benchmark Lantern performance with the open-source RPC testing suite and compare local-cache throughput.
- Lantern - FAQ — Frequently asked questions about Lantern installation, usage, performance, cost, and troubleshooting.
- Lantern - Known Issues — Known issues and platform-specific considerations when running Lantern on Windows, macOS, and Linux.
- Lantern - Edge-Caching for Solana — Lantern provides edge-caching for Solana account state with zero-latency RPC access and selective local synchronization.