get_block_count - 获取区块数量
get_block_count
调用来获取在节点最长链中的区块数量。其别名为getblockcount
。
输入
无
输出
- count:节点所见最长链中的区块数量,unsigned int
- status:RPC错误代码,string,"OK"表示一切正常
示例代码
curl请求:
$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block_count"}' -H 'Content-Type: application/json'
响应结果:
{
"id": "0",
"jsonrpc": "2.0",
"result": {
"count": 993163,
"status": "OK"
}
}