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

# getEpochInfo

> 返回当前纪元的信息。

## 请求参数

<ParamField body="commitment" type="string">
  请求的承诺级别。

  * `confirmed`
  * `finalized`
</ParamField>

<ParamField body="minContextSlot" type="number">
  请求可以评估的最小槽位。
</ParamField>


## OpenAPI

````yaml zh/openapi/rpc-http/getEpochInfo.yaml POST /
openapi: 3.1.0
info:
  title: Solana RPC API
  version: 1.0.0
  description: 全面的Solana纪元监控API，用于跟踪验证器周期进度、质押周期和区块链时间指标，并提供详细的纪元统计。
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
servers:
  - url: https://mainnet.helius-rpc.com
    description: 主网RPC端点
  - url: https://devnet.helius-rpc.com
    description: 开发网RPC端点
security: []
paths:
  /:
    post:
      tags:
        - RPC
      summary: getEpochInfo
      description: >
        检索有关当前 Solana 纪元、验证者周期和网络进展的详细信息。此重要 API
        提供全面的纪元指标，包括当前纪元编号、插槽进展和交易计数。纪元代表验证者轮换周期、质押奖励期和 Solana
        区块链上的时间分段。对于质押应用、奖励计算器、验证者监控工具以及任何需要跟踪网络进展或实现基于纪元逻辑（如奖励分配或协议升级）的应用至关重要。
      operationId: getEpochInfo
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                jsonrpc:
                  type: string
                  description: JSON-RPC 协议版本。
                  enum:
                    - '2.0'
                  example: '2.0'
                  default: '2.0'
                id:
                  type: string
                  description: 请求的唯一标识符。
                  example: '1'
                  default: '1'
                method:
                  type: string
                  description: 要调用的 RPC 方法名称。
                  enum:
                    - getEpochInfo
                  example: getEpochInfo
                  default: getEpochInfo
                params:
                  type: array
                  description: 请求的可选参数。
                  default: []
                  items:
                    type: object
                    properties:
                      commitment:
                        type: string
                        description: 请求的承诺级别。
                        enum:
                          - confirmed
                          - finalized
                        example: finalized
                      minContextSlot:
                        type: integer
                        description: 请求可以评估的最小插槽。
                        example: 1000
            example:
              jsonrpc: '2.0'
              id: '1'
              method: getEpochInfo
              params:
                - commitment: finalized
                  minContextSlot: 1000
      responses:
        '200':
          description: 成功检索到 epoch 信息。
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                    description: JSON-RPC 协议版本。
                    enum:
                      - '2.0'
                    example: '2.0'
                  id:
                    type: string
                    description: 与请求匹配的标识符。
                    example: '1'
                  result:
                    type: object
                    properties:
                      absoluteSlot:
                        type: integer
                        description: 当前绝对 Solana 槽号，表示全球区块链进度。
                        example: 166598
                      blockHeight:
                        type: integer
                        description: 当前 Solana 区块链高度（以区块为单位），用于跟踪整体链增长。
                        example: 166500
                      epoch:
                        type: integer
                        description: 当前 Solana epoch 编号，表示验证者周期和质押期。
                        example: 27
                      slotIndex:
                        type: integer
                        description: epoch 内的当前位置，显示验证者周期的进展。
                        example: 2790
                      slotsInEpoch:
                        type: integer
                        description: 当前 epoch 中的总槽数，定义 epoch 持续时间和验证者计划长度。
                        example: 8192
                      transactionCount:
                        type: integer
                        nullable: true
                        description: 自创世以来在 Solana 上处理的成功交易的累计数量。
                        example: 22661093
              examples:
                default:
                  value:
                    jsonrpc: '2.0'
                    id: '1'
                    result:
                      absoluteSlot: 166598
                      blockHeight: 166500
                      epoch: 27
                      slotIndex: 2790
                      slotsInEpoch: 8192
                      transactionCount: 22661093
        '400':
          description: 错误请求 - 请求参数无效或请求格式错误。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32602
                  message: 参数无效
        '401':
          description: 未授权 - API 密钥无效或缺失。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32001
                  message: 未授权
        '429':
          description: 请求过多 - 超出速率限制。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32005
                  message: 请求过多
        '500':
          description: 内部服务器错误 - 服务器发生错误。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32603
                  message: 内部错误
        '503':
          description: 服务不可用 - 服务暂时不可用。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32002
                  message: 服务不可用
        '504':
          description: 网关超时 - 请求超时。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32003
                  message: 网关超时
                id: '1'
      security:
        - ApiKeyQuery: []
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        jsonrpc:
          type: string
          description: JSON-RPC协议版本。
          enum:
            - '2.0'
          example: '2.0'
        error:
          type: object
          properties:
            code:
              type: integer
              description: 错误代码。
              example: -32602
            message:
              type: string
              description: 错误信息。
            data:
              type: object
              description: 关于错误的附加数据。
  securitySchemes:
    ApiKeyQuery:
      type: apiKey
      in: query
      name: api-key
      description: 您的Helius API密钥。您可以在[仪表板](https://dashboard.helius.dev/api-keys)中免费获取一个。

````