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"
}
}
}
}