getSyncStatus

返回指定群组内的同步状态信息

参数

  • groupID: unsigned int - 群组ID

返回值

  • object - 同步状态信息,字段如下:
    • blockNumber: unsigned int - 最新区块高度
    • genesisHash: string - 创世块哈希
    • isSyncing: bool - 正在同步标志
    • knownHighestNumber: unsigned int - 此节点已知的当前区块链最高块高
    • knownLatestHash: string - 此节点已知的当前区块链最高块哈希
    • latestHash: string - 最新区块哈希
    • nodeId: string - 节点的ID
    • protocolId: unsigned int - 协议ID号
    • txPoolSize: string - 交易池中交易的数量
    • peers: array - 已连接的指定群组内p2p节点,节点信息字段如下:
      • blockNumber: unsigned int - 最新区块高度
      • genesisHash: string - 创始区块哈希
      • latestHash: string - 最新块哈希
      • nodeId: string - 节点的ID
  • 示例
  1. // Request
  2. curl -X POST --data '{"jsonrpc":"2.0","method":"getSyncStatus","params":[1],"id":1}' http://127.0.0.1:8545 |jq
  3.  
  4. // Result
  5. {
  6. "id": 1,
  7. "jsonrpc": "2.0",
  8. "result": {
  9. "blockNumber": 0,
  10. "genesisHash": "0x4765a126a9de8d876b87f01119208be507ec28495bef09c1e30a8ab240cf00f2",
  11. "isSyncing": false,
  12. "knownHighestNumber":0,
  13. "knownLatestHash":"0x4765a126a9de8d876b87f01119208be507ec28495bef09c1e30a8ab240cf00f2",
  14. "latestHash": "0x4765a126a9de8d876b87f01119208be507ec28495bef09c1e30a8ab240cf00f2",
  15. "nodeId": "41285429582cbfe6eed501806391d2825894b3696f801e945176c7eb2379a1ecf03b36b027d72f480e89d15bacd43462d87efd09fb0549e0897f850f9eca82ba",
  16. "peers": [
  17. {
  18. "blockNumber": 0,
  19. "genesisHash": "0x4765a126a9de8d876b87f01119208be507ec28495bef09c1e30a8ab240cf00f2",
  20. "latestHash": "0x4765a126a9de8d876b87f01119208be507ec28495bef09c1e30a8ab240cf00f2",
  21. "nodeId": "29c34347a190c1ec0c4507c6eed6a5bcd4d7a8f9f54ef26da616e81185c0af11a8cea4eacb74cf6f61820292b24bc5d9e426af24beda06fbd71c217960c0dff0"
  22. },
  23. {
  24. "blockNumber": 0,
  25. "genesisHash": "0x4765a126a9de8d876b87f01119208be507ec28495bef09c1e30a8ab240cf00f2",
  26. "latestHash": "0x4765a126a9de8d876b87f01119208be507ec28495bef09c1e30a8ab240cf00f2",
  27. "nodeId": "87774114e4a496c68f2482b30d221fa2f7b5278876da72f3d0a75695b81e2591c1939fc0d3fadb15cc359c997bafc9ea6fc37345346acaf40b6042b5831c97e1"
  28. },
  29. {
  30. "blockNumber": 0,
  31. "genesisHash": "0x4765a126a9de8d876b87f01119208be507ec28495bef09c1e30a8ab240cf00f2",
  32. "latestHash": "0x4765a126a9de8d876b87f01119208be507ec28495bef09c1e30a8ab240cf00f2",
  33. "nodeId": "d5b3a9782c6aca271c9642aea391415d8b258e3a6d92082e59cc5b813ca123745440792ae0b29f4962df568f8ad58b75fc7cea495684988e26803c9c5198f3f8"
  34. }
  35. ],
  36. "protocolId": 265,
  37. "txPoolSize": "0"
  38. }
  39. }