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

# getSlot

> 返回已达到给定或默认承诺级别的槽位。

## 请求参数

<ParamField body="commitment" type="string">
  要检索槽号的最终性级别（processed = 最快，finalized = 完全确认）。

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

<ParamField body="minContextSlot" type="number">
  处理此请求之前必须达到的最低 Solana 区块链槽号。
</ParamField>


## OpenAPI

````yaml zh/openapi/rpc-http/getSlot.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: getSlot
      description: >-
        在Solana区块链上检索当前插槽号，并具有可配置的最终性保证。这个基本的API提供关于网络进展的实时信息，对于同步、监控和跟踪区块链进展至关重要。插槽号表示链的当前高度，并用作交易包含、区块时间和确定最终性状态的参考。对于需要跟踪网络进展、确定确认状态或实现基于时间的逻辑与区块链同步的应用程序来说至关重要。
      operationId: getSlot
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                jsonrpc:
                  type: string
                  enum:
                    - '2.0'
                  description: JSON-RPC协议版本。
                  example: '2.0'
                  default: '2.0'
                id:
                  type: string
                  description: 请求的唯一标识符。
                  example: '1'
                  default: '1'
                method:
                  type: string
                  enum:
                    - getSlot
                  description: 要调用的RPC方法名称。
                  example: getSlot
                  default: getSlot
                params:
                  type: array
                  description: 可选的配置对象。
                  default: []
                  items:
                    type: object
                    properties:
                      commitment:
                        type: string
                        description: 要检索插槽的最终性级别（processed = 最快，finalized = 完全确认）。
                        enum:
                          - 已确认
                          - finalized
                          - processed
                        example: finalized
                      minContextSlot:
                        type: integer
                        description: >-
                          Minimum Solana blockchain slot that must be reached
                          before processing this request.
                        example: 1000
            examples:
              getSlotExample:
                $ref: '#/components/examples/getSlotRequest'
      responses:
        '200':
          description: 成功检索到当前插槽。
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                    enum:
                      - '2.0'
                    description: JSON-RPC 协议版本。
                    example: '2.0'
                  id:
                    type: string
                    description: 与请求匹配的标识符。
                    example: '1'
                  result:
                    type: integer
                    description: 当前 Solana 区块链插槽号，表示网络的高度和进度。
                    example: 1234
              examples:
                getSlotExample:
                  $ref: '#/components/examples/getSlotResponse'
        '400':
          description: 错误请求 - 请求参数无效或请求格式错误。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32602
                  message: 参数无效
                id: '1'
        '401':
          description: 未授权 - API 密钥无效或缺失。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32001
                  message: 未授权
                id: '1'
        '429':
          description: 请求过多 - 超出速率限制。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32005
                  message: 请求过多
                id: '1'
        '500':
          description: 内部服务器错误 - 服务器发生错误。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32603
                  message: 内部错误
                id: '1'
        '503':
          description: 服务不可用 - 服务暂时不可用。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32002
                  message: 服务不可用
                id: '1'
        '504':
          description: 网关超时 - 请求超时。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32003
                  message: 网关超时
                id: '1'
      security:
        - ApiKeyQuery: []
components:
  examples:
    getSlotRequest:
      value:
        jsonrpc: '2.0'
        id: '1'
        method: getSlot
        params:
          - commitment: finalized
    getSlotResponse:
      value:
        jsonrpc: '2.0'
        id: '1'
        result: 1234
  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: 关于错误的附加数据。
        id:
          type: string
          description: 与请求匹配的标识符。
          example: '1'
  securitySchemes:
    ApiKeyQuery:
      type: apiKey
      in: query
      name: api-key
      description: 您的Helius API密钥。您可以在[仪表板](https://dashboard.helius.dev/api-keys)中免费获取一个。

````