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

> Trả về slot đã đạt đến mức cam kết được chỉ định hoặc mặc định.

## Tham số yêu cầu

<ParamField body="commitment" type="string">
  Mức độ hoàn tất dùng để truy xuất slot (processed = nhanh nhất, finalized = được xác nhận đầy đủ).

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

<ParamField body="minContextSlot" type="number">
  Slot tối thiểu trên blockchain Solana phải đạt được trước khi xử lý yêu cầu này.
</ParamField>


## OpenAPI

````yaml vi/openapi/rpc-http/getSlot.yaml POST /
openapi: 3.1.0
info:
  title: Solana RPC API
  version: 1.0.0
  description: >-
    API đồng bộ blockchain để truy xuất số slot hiện tại của mạng Solana với các
    mức đảm bảo tính hoàn tất khác nhau, phục vụ giám sát theo thời gian thực và
    theo dõi tiến trình.
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
servers:
  - url: https://mainnet.helius-rpc.com
    description: Điểm cuối RPC Mainnet
  - url: https://devnet.helius-rpc.com
    description: Điểm cuối RPC Devnet
security: []
paths:
  /:
    post:
      tags:
        - RPC
      summary: getSlot
      description: >
        Truy xuất số slot hiện tại trên blockchain Solana với các mức đảm bảo
        tính hoàn tất có thể cấu hình.

        API nền tảng này cung cấp thông tin theo thời gian thực về tiến trình
        của mạng, cần thiết cho việc

        đồng bộ, giám sát và theo dõi sự phát triển của blockchain. Số slot biểu
        thị

        chiều cao hiện tại của chuỗi và được dùng làm tham chiếu cho việc đưa
        giao dịch vào khối, thời điểm tạo khối

        và xác định trạng thái hoàn tất. API này rất quan trọng đối với các ứng
        dụng cần theo dõi tiến trình mạng,

        xác định trạng thái xác nhận hoặc triển khai logic dựa trên thời gian có
        đồng bộ với blockchain.
      operationId: getSlot
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                jsonrpc:
                  type: string
                  enum:
                    - '2.0'
                  description: Phiên bản giao thức JSON-RPC.
                  example: '2.0'
                  default: '2.0'
                id:
                  type: string
                  description: Mã định danh duy nhất cho yêu cầu.
                  example: '1'
                  default: '1'
                method:
                  type: string
                  enum:
                    - getSlot
                  description: Tên của phương thức RPC cần gọi.
                  example: getSlot
                  default: getSlot
                params:
                  type: array
                  description: Đối tượng cấu hình không bắt buộc.
                  default: []
                  items:
                    type: object
                    properties:
                      commitment:
                        type: string
                        description: >-
                          Mức độ hoàn tất dùng để truy xuất slot (processed =
                          nhanh nhất, finalized = đã xác nhận hoàn toàn).
                        enum:
                          - confirmed
                          - finalized
                          - processed
                        example: finalized
                      minContextSlot:
                        type: integer
                        description: >-
                          Slot tối thiểu trên blockchain Solana phải đạt được
                          trước khi xử lý yêu cầu này.
                        example: 1000
      responses:
        '200':
          description: Đã truy xuất thành công slot hiện tại.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                    description: Phiên bản giao thức JSON-RPC.
                    enum:
                      - '2.0'
                    example: '2.0'
                  id:
                    type: string
                    description: Mã định danh khớp với yêu cầu.
                    example: '1'
                  result:
                    type: integer
                    description: >-
                      Số slot hiện tại trên blockchain Solana, biểu thị chiều
                      cao và tiến trình của mạng.
                    example: 1234
              examples:
                getSlotExample:
                  $ref: '#/components/examples/getSlotResponse'
        '400':
          description: >-
            Yêu cầu không hợp lệ - Tham số yêu cầu không hợp lệ hoặc yêu cầu sai
            định dạng.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32602
                  message: Tham số không hợp lệ
                id: '1'
        '401':
          description: Không được phép - Khóa API không hợp lệ hoặc bị thiếu.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32001
                  message: Không được phép
                id: '1'
        '429':
          description: Quá nhiều yêu cầu - Đã vượt quá giới hạn tốc độ.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32005
                  message: Quá nhiều yêu cầu
                id: '1'
        '500':
          description: Lỗi máy chủ nội bộ - Đã xảy ra lỗi trên máy chủ.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32603
                  message: Lỗi nội bộ
                id: '1'
        '503':
          description: Dịch vụ không khả dụng - Dịch vụ tạm thời không khả dụng.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32002
                  message: Dịch vụ không khả dụng
                id: '1'
        '504':
          description: Hết thời gian chờ cổng kết nối - Yêu cầu đã hết thời gian chờ.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32003
                  message: Hết thời gian chờ cổng kết nối
                id: '1'
      security:
        - ApiKeyQuery: []
components:
  examples:
    getSlotResponse:
      value:
        jsonrpc: '2.0'
        id: '1'
        result: 1234
  schemas:
    ErrorResponse:
      type: object
      properties:
        jsonrpc:
          type: string
          description: Phiên bản giao thức JSON-RPC.
          enum:
            - '2.0'
          example: '2.0'
        error:
          type: object
          properties:
            code:
              type: integer
              description: Mã lỗi.
              example: -32602
            message:
              type: string
              description: Thông báo lỗi.
            data:
              type: object
              description: Dữ liệu bổ sung về lỗi.
        id:
          type: string
          description: Mã định danh khớp với yêu cầu.
          example: '1'
  securitySchemes:
    ApiKeyQuery:
      type: apiKey
      in: query
      name: api-key
      description: >-
        Khóa API Helius của bạn. Bạn có thể nhận khóa miễn phí trong [bảng điều
        khiển](https://dashboard.helius.dev/api-keys).

````