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

# getLeaderSchedule

> getLeaderSchedule trả về lịch trình leader của Solana cho một epoch — trình xác thực tạo khối trong từng slot, dùng để định tuyến giao dịch theo leader.

## Tham số yêu cầu

<ParamField body="slot" type="number" required>
  Số epoch hoặc slot cần truy xuất lịch trình leader. Nếu bỏ qua, phương thức sẽ trả về lịch trình của epoch hiện tại.
</ParamField>

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

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

<ParamField body="identity" type="string">
  Khóa công khai định danh tùy chọn của trình xác thực, dùng để lọc kết quả chỉ cho lịch trình của một trình xác thực cụ thể.
</ParamField>


## OpenAPI

````yaml vi/openapi/rpc-http/getLeaderSchedule.yaml POST /
openapi: 3.1.0
info:
  title: Solana RPC API
  version: 1.0.0
  description: >-
    API lập lịch trình trình xác thực để truy xuất toàn bộ trình tự luân phiên
    trình dẫn đầu của Solana, qua đó xác định trình xác thực nào tạo khối trong
    các slot cụ thể của một epoch.
  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: getLeaderSchedule
      description: >
        Truy xuất toàn bộ lịch trình luân phiên trình xác thực cho cả một epoch
        Solana.

        API đồng thuận này cung cấp ánh xạ chi tiết về các nút trình xác thực
        được chỉ định 

        làm trình dẫn đầu slot trong suốt một epoch, cho biết chính xác các slot
        mà mỗi trình xác thực

        chịu trách nhiệm tạo khối. Lịch trình trình dẫn đầu được suy ra theo
        cách xác định

        bằng một hàm ngẫu nhiên có thể xác minh dựa trên cơ chế lựa chọn có
        trọng số theo stake. API này rất cần thiết cho 

        đơn vị vận hành trình xác thực theo dõi trách nhiệm tạo khối sắp tới,

        ứng dụng staking phân tích cơ hội tham gia của trình xác thực, công cụ 

        giám sát mạng trực quan hóa các mẫu đồng thuận và ứng dụng cần

        dự đoán hoặc phân tích thời điểm tạo khối cũng như sự phân bổ trên toàn
        mạng.
      operationId: getLeaderSchedule
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - jsonrpc
                - id
                - method
              properties:
                jsonrpc:
                  type: string
                  description: Phiên bản giao thức JSON-RPC.
                  enum:
                    - '2.0'
                  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
                  description: Tên của phương thức RPC cần gọi.
                  enum:
                    - getLeaderSchedule
                  example: getLeaderSchedule
                  default: getLeaderSchedule
                params:
                  type: array
                  description: Các tham số cho phương thức.
                  items:
                    oneOf:
                      - type: integer
                        description: >-
                          Số epoch hoặc slot cần truy xuất lịch trình trình dẫn
                          đầu. Nếu bỏ qua, API trả về lịch trình của epoch hiện
                          tại.
                        example: null
                      - type: object
                        description: Đối tượng cấu hình với các tùy chọn bổ sung.
                        properties:
                          commitment:
                            type: string
                            description: Mức độ cam kết cho yêu cầu.
                            enum:
                              - confirmed
                              - finalized
                              - processed
                            example: finalized
                          identity:
                            type: string
                            description: >-
                              Khóa công khai định danh trình xác thực tùy chọn,
                              dùng để lọc kết quả chỉ theo lịch trình của một
                              trình xác thực cụ thể.
                            example: 4Qkev8aNZcqFNSRhQzwyLMFSsi94jHqE8WNVTJzTP99F
      responses:
        '200':
          description: Đã truy xuất thành công lịch trình trình dẫn đầu.
          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:
                    oneOf:
                      - type: 'null'
                        description: Null nếu không tìm thấy epoch được yêu cầu.
                      - type: object
                        description: >-
                          Ánh xạ từ danh tính trình xác thực đến các slot trình
                          dẫn đầu được chỉ định cho họ trong epoch này.
                        additionalProperties:
                          type: array
                          description: >-
                            Mảng chỉ số slot trong epoch mà trình xác thực này
                            được lên lịch tạo khối.
                          items:
                            type: integer
                            example: 0
        '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ệ
        '401':
          description: Chưa được xác thực - 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 xác thực
                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 - 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
                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).

````