Tendermint RPC API文档

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

ConsensusParams - 获取共识参数

ConsensusParams调用获取指定高度时的共识参数。如果未指定高度,则 返回当前的共识参数。

API请求

GET /consensus_params

查询参数:

  • height:区块高度

API响应

返回JSON对象,结构如下:

  • jsonrpc:JSONRPC版本,固定为"2.0"
  • id:API请求的ID编号
  • error:错误描述信息
  • result:结果对象
    • block_height:区块高度
    • consensus_params:共识参数对象,结构如下:
      • block_size_params:区块尺寸参数
      • evidence_params:证据参数

示例代码

使用curl调用ConsensusParams接口,获取当前共识参数:

~$ curl 'localhost:26657/consensus_params'

响应结果:

{
    "jsonrpc": "2.0",
    "id": "",
    "result": {
      "block_height": "1",
      "consensus_params": {
        "block_size_params": {
          "max_txs_bytes": "22020096",
          "max_gas": "-1"
        },
        "evidence_params": {
          "max_age": "100000"
        }
      }
    }

}