> ## 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

<Steps>
  <Step title="创建账户">
    在 [orbitflare.com](https://orbitflare.com) 注册，并选择适合你需求的方案。提供**免费套餐**，无需信用卡即可立即开始构建。

    <Tip>
      免费方案包含每秒 10 个请求——足够在升级之前进行原型设计和测试集成。
    </Tip>
  </Step>

  <Step title="获取许可证密钥">
    登录后，导航到**控制面板**并找到**许可证**部分。你的许可证密钥随服务订阅一同提供——从那里复制它。

    你将通过在端点 URL 上附加 `api_key` 查询参数来验证 RPC 请求。

    <Warning>
      请妥善保管你的许可证密钥。不要将其提交到版本控制系统或在客户端代码中暴露。
    </Warning>
  </Step>

  <Step title="发起首个 RPC 调用">
    使用主网端点调用 `getBlockHeight`，确认一切正常运行。

    <CodeGroup>
      ```bash cURL theme={null}
      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"
        }'
      ```

      ```javascript JavaScript theme={null}
      const response = await fetch(
        "https://mainnet.rpc.orbitflare.com?api_key=YOUR_API_KEY",
        {
          method: "POST",
          headers: { "Content-Type": "application/json" },
          body: JSON.stringify({
            jsonrpc: "2.0",
            id: 1,
            method: "getBlockHeight",
          }),
        }
      );

      const data = await response.json();
      console.log("Block height:", data.result);
      ```

      ```python Python theme={null}
      import requests

      response = requests.post(
          "https://mainnet.rpc.orbitflare.com?api_key=YOUR_API_KEY",
          headers={"Content-Type": "application/json"},
          json={
              "jsonrpc": "2.0",
              "id": 1,
              "method": "getBlockHeight",
          },
      )

      data = response.json()
      print("Block height:", data["result"])
      ```
    </CodeGroup>

    成功的响应如下所示：

    ```json theme={null}
    {
      "jsonrpc": "2.0",
      "result": 283458923,
      "id": 1
    }
    ```
  </Step>

  <Step title="试用 WebSocket">
    OrbitFlare 支持持久 WebSocket 连接以获取实时数据。连接到 `wss://mainnet.rpc.orbitflare.com` 并订阅更新。

    ```javascript JavaScript theme={null}
    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);
    });
    ```

    <Note>
      WebSocket 连接使用相同的 `api_key` 查询参数进行身份验证。
    </Note>
  </Step>
</Steps>

## 下一步

<CardGroup cols={2}>
  <Card title="身份验证与限制" icon="key" href="/cn/authentication">
    了解 API key 使用、端点格式、速率限制和流连接数限制。
  </Card>

  <Card title="RPC 文档" icon="server" href="/rpc/http">
    深入了解完整的 HTTP RPC 方法参考。
  </Card>

  <Card title="数据流" icon="bolt" href="/data-streaming/jetstream">
    使用 Jetstream 实时流式传输 Solana 数据。
  </Card>

  <Card title="错误代码" icon="triangle-exclamation" href="/rpc/error-codes">
    HTTP 状态码、JSON-RPC 错误及处理方法。
  </Card>

  <Card title="入门模板" icon="rectangle-terminal" href="https://github.com/orbitflare/templates">
    在 Solana 上构建的生产就绪入门模板——Blinks、兑换等。
  </Card>
</CardGroup>
