Extract Slot and Error from block and transaction respectively, create these 2 new fields for each table, write it.
Added combined events + instruction display for Pumpfun & Pumpswap
How much time needed to parse 1 block, 1 tx ? How much time needed to save block of transactions ? CPU and memory consumption
Make optimizations based on the results
use futures::{SinkExt, StreamExt};
use serde_json::json;
use tokio_tungstenite::{connect_async, tungstenite::protocol::Message};
#[tokio::main]
async fn main() -> anyhow::Result<()> {
// WebSocket endpoint Helius
let url = "wss://solana-mainnet.core.chainstack.com/3dec72ea492a69e1ea1fa532c2de1af7";
let (mut ws_stream, _response) = connect_async(url).await?;
println!("✅ Connected to {url}");
// blockSubscribe с mentionsAccountOrProgram (pump.fun program)
let subscribe_msg = json!({
"jsonrpc": "2.0",
"id": 1,
"method": "blockSubscribe",
"params": [
{
"mentionsAccountOrProgram": "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"
},
{
"commitment": "confirmed",
"encoding": "json", // или "base64", если хочешь сырые данные
"transactionDetails": "full", // full / signatures / none
"maxSupportedTransactionVersion": 0,
"showRewards": false
}
]
});
ws_stream
.send(Message::Text(subscribe_msg.to_string()))
.await?;
println!("📨 Sent blockSubscribe");
// Читаем блоки
while let Some(msg) = ws_stream.next().await {
let msg = msg?;
if let Message::Text(text) = msg {
println!("🔔 Got block: {text}");
}
}
Ok(())
}