quicknode-cascade
Stream Solana data at insane speed. One crate. Parallel. Consistent. Crash-safe.
Powered by QuickNode Cascade — edge-cached block archive, 300+ PoPs, sub-50ms latency worldwide.
30-Second Start
That fetches real Solana blocks and prints every non-vote transaction. No config, no setup, just data.
Add to Your Project
use ;
;
You implement the hooks. The framework handles parallel fetching, retries, ordering, and crash-safe cursors. Bring your own database.
How It Works
┌─────────────────────────────────────────────────────────┐
│ CascadeRunner │
│ │
│ ┌──────────┐ ┌───────────┐ ┌──────────────────┐ │
│ │ Fetch │───▶│ Extract │───▶│ Your Plugin │ │
│ │ parallel │ │ zero-copy │ │ on_block() │ │
│ │ + retry │ │ │ │ on_transaction()│ │
│ │ forever │ │ BlockData │ │ on_token_...() │ │
│ │ │ │ TxData │ │ on_account_..()│ │
│ └──────────┘ │ Tokens │ └──────────────────┘ │
│ │ │ Accounts │ │ │
│ │ └───────────┘ │ │
│ │ ▼ │
│ │ ┌──────────────────┐ │
│ └─────────────────────────▶│ Cursor (atomic) │ │
│ │ crash-safe resume │ │
│ └──────────────────┘ │
└─────────────────────────────────────────────────────────┘
Slots always arrive in order, even though they're fetched in parallel. Cursor saves after every batch. Kill the process, restart, it picks up exactly where it left off.
Examples
| Example | What it does | Run it |
|---|---|---|
solana_backfill |
Fetch blocks, print summaries | cargo run --release --example solana_backfill |
crash_recovery_test |
Two-stage backfill proving cursor resume | cargo run --release --example crash_recovery_test |
Running Modes
// Backfill a range of slots
solana_mainnet
.backfill
.concurrency
.run
// Follow the chain tip in real-time
solana_mainnet
.live
.run
// Follow from a specific slot
solana_mainnet
.live_from
.run
Configuration
solana_mainnet
.auth_token // JWT for Cascade API
.concurrency // parallel workers (default: 10)
.encoding // "json" (structured) or raw
.cursor_file // resume support
.tip_buffer // slots behind tip (live mode)
.source_url // override endpoint
.with_plugin // register plugins
.run
Plugin Hooks
All hooks default to no-op. Override only what you need.
For convenience: use quicknode_cascade::solana::prelude::*;
Data Types
| Type | Key Fields |
|---|---|
BlockData |
slot, blockhash, parent_slot, block_time, block_height, transaction_count, raw |
TransactionData |
slot, tx_index, signature, success, fee, compute_units, is_vote, pre/post_balances, log_messages, raw |
TokenTransferData |
slot, tx_index, signature, mint, owner, pre_amount, post_amount, decimals |
AccountActivityData |
slot, tx_index, signature, account, pre/post_balance, balance_change, is_signer, is_fee_payer |
Every type with a raw field carries the full JSON so you can parse anything the framework doesn't extract.
Reliability
| What happens | What the framework does |
|---|---|
| Network error / timeout / 5xx | Retry forever, exponential backoff |
| HTTP 429 | Wait 5s, retry forever |
| Skipped slot | on_skipped_slot(), cursor advances |
| Plugin error | Log it, keep going |
on_load error |
Fail fast, clean up loaded plugins |
| Ctrl-C / SIGTERM | on_exit() all plugins, save cursor |
| SIGKILL (crash) | Cursor up to 1 batch stale, replay is safe |
Delivery guarantee: at-least-once. On crash recovery, some slots may replay. Design your plugins for idempotent writes.
Multi-Chain
Solana types live under quicknode_cascade::solana. When new chains ship, they get their own modules:
use ; // now
// use quicknode_cascade::ethereum::{Plugin, BlockData}; // future
CascadeRunner::chain("solana-mainnet") maps to https://solana-mainnet-cascade.quiknode.io. Same pattern for any chain.
License
Apache-2.0