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

# getSlotLeader

> getSlotLeader trả về trình xác thực hiện đang tạo khối với vai trò là leader của slot trên Solana, được xác định bằng khóa công khai — hữu ích cho việc định tuyến có nhận biết leader và giám sát nút.

## Tham số yêu cầu

<ParamField body="commitment" type="string">
  Mức cam kết cho yêu cầu.

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

<ParamField body="minContextSlot" type="number">
  Slot tối thiểu mà tại đó yêu cầu có thể được đánh giá.
</ParamField>


## OpenAPI

````yaml vi/openapi/rpc-http/getSlotLeader.yaml POST /
openapi: 3.1.0
info:
  title: API RPC Solana
  version: 1.0.0
  description: >-
    API lập lịch trình trình xác thực để xác định trình xác thực Solana nào chịu
    trách nhiệm tạo khối trong một slot cụ thể của blockchain.
  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: getSlotLeader
      description: >
        Xác định trình xác thực Solana cụ thể được chỉ định để tạo khối cho slot
        hiện tại hoặc trong tương lai.

        API điều phối đồng thuận này trả về danh tính trình xác thực (khóa công
        khai) đã được

        lên lịch làm leader cho một slot cụ thể trong blockchain. Thông tin này
        rất cần thiết cho các công cụ

        giám sát mạng, phân tích hiệu suất trình xác thực, theo dõi quá trình
        tạo khối và các ứng dụng

        cần nắm được lịch trình leader hiện tại. Thông tin về slot leader được
        xác định

        bởi thuật toán lựa chọn leader proof-of-stake của Solana dựa trên trọng
        số stake và tính ngẫu nhiên.
      operationId: getSlotLeader
      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:
                    - getSlotLeader
                  description: Tên của phương thức RPC cần gọi.
                  example: getSlotLeader
                  default: getSlotLeader
                params:
                  type: array
                  description: Đối tượng cấu hình tùy chọn.
                  items:
                    type: object
                    properties:
                      commitment:
                        type: string
                        description: Mức độ cam kết cho yêu cầu.
                        enum:
                          - confirmed
                          - finalized
                          - processed
                        example: finalized
                      minContextSlot:
                        type: integer
                        description: Slot tối thiểu mà yêu cầu có thể được đánh giá tại đó.
                        example: 1000
      responses:
        '200':
          description: Đã truy xuất thành công leader của slot.
          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: string
                    description: >-
                      Danh tính trình xác thực Solana (khóa công khai) được lên
                      lịch làm bên tạo khối cho slot này.
                    example: ENvAW7JScgYq6o4zKZwewtkzzJgDzuJAFxYasvmEQdpS
              example:
                jsonrpc: '2.0'
                id: '1'
                result: ENvAW7JScgYq6o4zKZwewtkzzJgDzuJAFxYasvmEQdpS
        '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: Chưa được ủy quyền - 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: Chưa được ủy quyền
                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:
  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).

````