几分钟内开始使用 OrbitFlare
创建账户
获取许可证密钥
api_key
发起首个 RPC 调用
getBlockHeight
curl -X POST "https://mainnet.rpc.orbitflare.com?api_key=YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "getBlockHeight" }'
{ "jsonrpc": "2.0", "result": 283458923, "id": 1 }
试用 WebSocket
wss://mainnet.rpc.orbitflare.com
const WebSocket = require("ws"); const ws = new WebSocket( "wss://mainnet.rpc.orbitflare.com?api_key=YOUR_API_KEY" ); ws.on("open", () => { ws.send( JSON.stringify({ jsonrpc: "2.0", id: 1, method: "slotSubscribe", }) ); console.log("Subscribed to slot updates"); }); ws.on("message", (data) => { const message = JSON.parse(data); console.log("Received:", message); }); ws.on("error", (err) => { console.error("WebSocket error:", err); });
此页面对您有帮助吗?