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

# getGenesisHash

> Trả về hàm băm genesis — mã định danh duy nhất của một cụm Solana (mainnet, devnet hoặc testnet) — dùng để xác minh kết nối với đúng mạng mong muốn.



## OpenAPI

````yaml vi/openapi/rpc-http/getGenesisHash.yaml POST /
openapi: 3.1.0
info:
  title: Solana RPC API
  version: 1.0.0
  description: >-
    API nhận dạng mạng để truy xuất mã băm khởi nguyên duy nhất, đóng vai trò là
    mã định danh mật mã của mạng blockchain Solana cụ thể (mainnet, testnet hoặc
    devnet).
  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 của mainnet
  - url: https://devnet.helius-rpc.com
    description: Điểm cuối RPC của devnet
security: []
paths:
  /:
    post:
      tags:
        - RPC
      summary: getGenesisHash
      description: >
        Truy xuất mã định danh mật mã duy nhất của mạng blockchain Solana mà bạn
        đang kết nối.

        API xác minh mạng này trả về mã băm khởi nguyên — một dấu vân tay đặc
        trưng được tạo từ

        khối đầu tiên của blockchain, giúp xác định duy nhất rằng bạn đang kết
        nối với Solana mainnet,

        testnet, devnet hay một cụm tùy chỉnh. Mã băm khởi nguyên đóng vai trò
        là mã định danh chuỗi cơ bản,

        không bao giờ thay đổi đối với một mạng cụ thể. API này rất cần thiết
        cho các ứng dụng phải xác minh rằng chúng đang kết nối

        với mạng Solana dự kiến trước khi thực hiện giao dịch, các dịch vụ xuyên
        chuỗi phải

        phân biệt giữa các môi trường Solana khác nhau và các framework xây dựng
        chức năng nhận biết mạng.
      operationId: getGenesisHash
      requestBody:
        required: true
        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'
                  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:
                    - getGenesisHash
                  example: getGenesisHash
                  default: getGenesisHash
      responses:
        '200':
          description: Đã truy xuất mã băm khởi nguyên thành công.
          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: >-
                      Mã băm khởi nguyên duy nhất (được mã hóa base-58), dùng để
                      nhận dạng bằng mật mã mạng blockchain Solana cụ thể này
                      (khác nhau giữa mainnet, testnet và devnet).
                    example: GH7ome3EiwEr7tu9JuTh2dpYWBJK3z69Xm1ZE3MEE6JC
        '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: Invalid params
        '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: Unauthorized
                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: Too many requests
                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: Internal error
                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: Service unavailable
                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: Gateway timeout
                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).

````