Tendermint RPC API文档

在线工具推荐: Three.js AI纹理开发包 - YOLO合成数据生成器 - GLTF/GLB在线编辑 - 3D模型格式在线转换 - 可编程3D场景编辑器

Genesis - 获取创世文件

Genesis接口用来获取区块链的创世文件。

API请求

GET /genesis

API响应

返回JSON对象,结构如下:

  • jsonrpc:JSONRPC版本,固定为"2.0"
  • id:API请求的ID编号
  • error:错误描述信息
  • result:结果对象
    • genesis:创世对象
      • app_hash:app哈希
      • validators:验证节点集合
      • chain_id:链ID
      • genesis_time:创世时间

示例代码

使用curl调用Genesis接口,获取当前创世文件:

~$ curl 'localhost:26657/genesis'

响应结果:

{
    "error": "",
    "result": {
        "genesis": {
            "app_hash": "",
            "validators": [
                {
                    "name": "",
                    "power": "10",
                    "pub_key": {
                        "data": "68DFDA7E50F82946E7E8546BED37944A422CD1B831E70DF66BA3B8430593944D",
                        "type": "ed25519"
                    }
                }
            ],
            "chain_id": "test-chain-6UTNIN",
            "genesis_time": "2017-05-29T15:05:41.671Z"
        }
    },
    "id": "",
    "jsonrpc": "2.0"
}