get_info - 获取节点及网络概况
get_info
用来获取当前节点及网络的总体信息,其别名包括:
- /get_info
- /getinfo
输入参数:
无
输出结果
- alt_blocks_count:替代区块的数量, unsigned int
- block_size_limit:区块大小上限,unsigned int
- block_size_median:最近100个区块大小中位值,unsigned int
- bootstrap_daemon_address:启动引导节点地址,string
- cumulative_difficulty:累积难度,unsigned int
- difficulty:网络难度,unsigned int
- free_space:节点可用磁盘空间,unsigned int
- grey_peerlist_size:对端节点灰名单大小, unsigned int
- height:节点最长链区块高度,unsigned int
- height_without_bootstrap:本地链高度,unsigned int
- incoming_connections_count:入连接数量,unsigned int
- mainnet:是否接入主网,boolean
- offline:是否离线,boolean
- outgoing_connections_count:出连接数量,unsigned int
- rpc_connections_count:rpc连接数量,unsigned int
- stagenet:是否接入stagenet,boolean
- start_time:节点启动unxi时间,unsigned int
- status:RPC错误代码,string
- target:下一个POW目标,unsigned int
- target_height:下一区块高度, unsigned int
- testnet:节点是否接入测试网,boolean
- top_block_hash:最高区块的哈希,string
- tx_count:链上非币基交易总数量,unsigned int
- tx_pool_size:交易池大小,unsigned int
- untrusted,是否不可信,boolean
- was_bootstrap_ever_used:是否使用引导节点,boolean
- white_peerlist_size:对端节点白名单大小,unsigned int
示例代码
curl请求:
$ curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_info"}' -H 'Content-Type: application/json'
响应结果:
{
"id": "0",
"jsonrpc": "2.0",
"result": {
"alt_blocks_count": 6,
"block_size_limit": 600000,
"block_size_median": 129017,
"bootstrap_daemon_address": "",
"cumulative_difficulty": 14121125493385685,
"difficulty": 60580751777,
"free_space": 138758750208,
"grey_peerlist_size": 4998,
"height": 1562168,
"height_without_bootstrap": 1562168,
"incoming_connections_count": 2,
"mainnet": true,
"offline": false,
"outgoing_connections_count": 8,
"rpc_connections_count": 2,
"stagenet": false,
"start_time": 1524751757,
"status": "OK",
"target": 120,
"target_height": 1562063,
"testnet": false,
"top_block_hash": "7a7ba647080844073fdd8e3a069e00554c773d6e6863354dba1dec45a43f5592",
"tx_count": 2759894,
"tx_pool_size": 755,
"untrusted": false,
"was_bootstrap_ever_used": false,
"white_peerlist_size": 1000
}
}