Documentation Index
Fetch the complete documentation index at: https://docs.orbitflare.com/llms.txt
Use this file to discover all available pages before exploring further.
创建账户
在 orbitflare.com 注册,并选择适合你需求的方案。提供免费套餐,无需信用卡即可立即开始构建。免费方案包含每秒 10 个请求——足够在升级之前进行原型设计和测试集成。
获取许可证密钥
登录后,导航到控制面板并找到许可证部分。你的许可证密钥随服务订阅一同提供——从那里复制它。你将通过在端点 URL 上附加 api_key 查询参数来验证 RPC 请求。请妥善保管你的许可证密钥。不要将其提交到版本控制系统或在客户端代码中暴露。
发起首个 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
OrbitFlare 支持持久 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);
});
WebSocket 连接使用相同的 api_key 查询参数进行身份验证。
下一步
身份验证与限制
了解 API key 使用、端点格式、速率限制和流连接数限制。
RPC 文档
深入了解完整的 HTTP RPC 方法参考。
数据流
使用 Jetstream 实时流式传输 Solana 数据。
错误代码
HTTP 状态码、JSON-RPC 错误及处理方法。
入门模板
在 Solana 上构建的生产就绪入门模板——Blinks、兑换等。