> ## Documentation Index
> Fetch the complete documentation index at: https://www.helius.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Solana 区块和网络 RPC 方法

> 区块、槽位、纪元、供应、费用和网络 Solana RPC 方法——getBlock、getSlot、getEpochInfo、getLatestBlockhash、getFeeForMessage 等。

## 内容概述

除了[交易](/zh/rpc/historical-data)、[账户](/zh/rpc/accounts)和[代币与NFT](/zh/das-api)，Solana 提供用于区块、槽位、纪元、供应、费用和节点状态的 RPC 方法。本页面汇总了最有用的方法，每个卡片链接到其完整指南。

## 区块与槽位

<CardGroup cols={2}>
  <Card title="getBlock" icon="cube" href="/zh/rpc/guides/getblock">
    已确认区块的所有交易和元数据。
  </Card>

  <Card title="getBlocks" icon="cubes" href="/zh/rpc/guides/getblocks">
    两个槽位之间已确认区块的列表。
  </Card>

  <Card title="getBlockTime" icon="clock" href="/zh/rpc/guides/getblocktime">
    区块的预计生产时间，作为 Unix 时间戳。
  </Card>

  <Card title="getSlot" icon="gauge" href="/zh/rpc/guides/getslot">
    已达到给定或默认承诺级别的槽位。
  </Card>
</CardGroup>

## 纪元与网络

<CardGroup cols={2}>
  <Card title="getEpochInfo" icon="calendar" href="/zh/rpc/guides/getepochinfo">
    当前纪元的信息，包括槽位进度。
  </Card>

  <Card title="getClusterNodes" icon="network-wired" href="/zh/rpc/guides/getclusternodes">
    参与集群的所有节点的详细信息。
  </Card>

  <Card title="getVersion" icon="tag" href="/zh/rpc/guides/getversion">
    节点上运行的 Solana 版本。
  </Card>

  <Card title="getHealth" icon="heart-pulse" href="/zh/rpc/guides/gethealth">
    节点的当前健康状态。
  </Card>
</CardGroup>

## 供应与费用

<CardGroup cols={2}>
  <Card title="getSupply" icon="coins" href="/zh/rpc/guides/getsupply">
    当前流通和总 SOL 供应的信息。
  </Card>

  <Card title="getLatestBlockhash" icon="hashtag" href="/zh/rpc/guides/getlatestblockhash">
    构建和签署交易所需的最新区块哈希。
  </Card>

  <Card title="getFeeForMessage" icon="money-bill" href="/zh/rpc/guides/getfeeformessage">
    提交的消息所需的费用。
  </Card>

  <Card title="getRecentPrioritizationFees" icon="gauge-high" href="/zh/rpc/guides/getrecentprioritizationfees">
    最近的优先级费用，有助于设置优先费用。另请参见[优先级费用 API](/zh/priority-fee-api)。
  </Card>
</CardGroup>

## 快速开始

这些方法中的许多不需要参数。例如，`getLatestBlockhash` 返回一个可以用于构建交易的 blockhash：

<CodeGroup>
  ```typescript TypeScript theme={"system"}
  const response = await fetch(`https://mainnet.helius-rpc.com/?api-key=YOUR_API_KEY`, {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
      jsonrpc: '2.0',
      id: '1',
      method: 'getLatestBlockhash',
      params: [{ commitment: 'finalized' }],
    }),
  });

  const { result } = await response.json();
  console.log(result.value.blockhash);
  ```

  ```python Python theme={"system"}
  import requests

  url = "https://mainnet.helius-rpc.com/?api-key=YOUR_API_KEY"
  payload = {
      "jsonrpc": "2.0",
      "id": "1",
      "method": "getLatestBlockhash",
      "params": [{"commitment": "finalized"}],
  }
  print(requests.post(url, json=payload).json()["result"]["value"]["blockhash"])
  ```

  ```bash cURL theme={"system"}
  curl https://mainnet.helius-rpc.com/?api-key=YOUR_API_KEY \
    -X POST \
    -H "Content-Type: application/json" \
    -d '{
      "jsonrpc": "2.0",
      "id": "1",
      "method": "getLatestBlockhash",
      "params": [{ "commitment": "finalized" }]
    }'
  ```
</CodeGroup>

## 下一步

<CardGroup cols={2}>
  <Card title="所有 RPC 方法" icon="server" href="/zh/rpc/guides/overview">
    浏览完整的 Solana RPC 方法参考，每个方法都有指南。
  </Card>

  <Card title="HTTP 方法参考" icon="code" href="/zh/api-reference/rpc/http-methods">
    所有 HTTP RPC 方法的正式请求和响应架构。
  </Card>

  <Card title="帐户" icon="circle-info" href="/zh/rpc/accounts">
    使用 getAccountInfo 等读取帐户状态。
  </Card>

  <Card title="交易" icon="clock-rotate-left" href="/zh/rpc/historical-data">
    查询地址的交易和转账历史。
  </Card>
</CardGroup>
