Quickstart
From zero to your first Solana slot in under a minute.
Find your endpoint
Every OpenInfra server ships with a dedicated RPC endpoint. For testing you can use the shared public endpoint — your dashboard shows your server's dedicated URL once provisioned.
Make your first request
Fetch the current slot number using
getSlot. Choose your language:import { Connection } from "@solana/web3.js"; const conn = new Connection("https://rpc.openinfra.sh", "confirmed");const slot = await conn.getSlot();console.log("Current slot:", slot);Expected response:
{ "jsonrpc": "2.0", "result": 312445981, "id": 1 }Subscribe over WebSockets
Open a WebSocket connection to receive real-time slot updates without polling:
const ws = new WebSocket("wss://rpc.openinfra.sh"); ws.onopen = () => { ws.send(JSON.stringify({ jsonrpc: "2.0", id: 1, method: "slotSubscribe", }));}; ws.onmessage = (ev) => { const msg = JSON.parse(ev.data); console.log("Slot:", msg.params?.result?.slot);};Next steps
You're connected. Explore what's possible:
- → Authentication — secure your endpoint with API keys
- → Yellowstone gRPC — sub-millisecond streaming
- → ShredStream — raw shred data before block confirmation