eos

2.1 cleos-commands-blockchain

2019-07-24  本文已影响0人  furnace

查询本地节点及链上部分数据的基本信息

1. 获取当前区块链的信息

获取当前区块链的信息。使用方式 cleos get info [OPTIONS]。

$ cleos get info
{
  "server_version": "2da868b3",
  "chain_id": "aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906",
  "head_block_num": 1619372,
  "last_irreversible_block_num": 1619040,
  "last_irreversible_block_id": "0018b46053b4c7c3d80882493f8793bcd5d1b5e3eaffdc823277965cab743cc1",
  "head_block_id": "0018b5ac4e227de2db1bbf8b90509a9a438cf3679b7fd63f2af3636c34c3a451",
  "head_block_time": "2018-06-20T01:04:51.500",
  "head_block_producer": "eosstorebest",
  "virtual_block_cpu_limit": 200000000,
  "virtual_block_net_limit": 1048576000,
  "block_cpu_limit": 200000,
  "block_net_limit": 1048576,
  "server_version_string": "v2.0.1"
}

2. 查询指定区块的信息

2.1 通过区块高度查询

$ cleos get block 1
{
  "timestamp": "2018-06-08T08:08:08.500",
  "producer": "",
  "confirmed": 1,
  "previous": "0000000000000000000000000000000000000000000000000000000000000000",
  "transaction_mroot": "0000000000000000000000000000000000000000000000000000000000000000",
  "action_mroot": "aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906",
  "schedule_version": 0,
  "new_producers": null,
  "header_extensions": [],
  "producer_signature": "SIG_K1_111111111111111111111111111111111111111111111111111111111111111116uk5ne",
  "transactions": [],
  "block_extensions": [],
  "id": "00000001405147477ab2f5f51cda427b638191c66d2c59aa392d5c2c98076cb0",
  "block_num": 1,
  "ref_block_prefix": 4126519930
}

其中:

2.2 通过区块哈希查询

$ cleos get block 00000001405147477ab2f5f51cda427b638191c66d2c59aa392d5c2c98076cb0{
  "timestamp": "2018-06-08T08:08:08.500",
  "producer": "",
  "confirmed": 1,
  "previous": "0000000000000000000000000000000000000000000000000000000000000000",
  "transaction_mroot": "0000000000000000000000000000000000000000000000000000000000000000",
  "action_mroot": "aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906",
  "schedule_version": 0,
  "new_producers": null,
  "header_extensions": [],
  "producer_signature": "SIG_K1_111111111111111111111111111111111111111111111111111111111111111116uk5ne",
  "transactions": [],
  "block_extensions": [],
  "id": "00000001405147477ab2f5f51cda427b638191c66d2c59aa392d5c2c98076cb0",
  "block_num": 1,
  "ref_block_prefix": 4126519930
}

其中:

2.3 查询区块头状态

$ cleos get block 1 --header-state

3. 获取验证人信息

获取验证人列表。使用方式 cleos get schedule [OPTIONS]。

$ cleos get schedule
active schedule version 1
    Producer      Producer key
    ============= ==================
    eosio         EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV

pending schedule empty

proposed schedule empty
$ cleos get schedule --json
{
  "active": {
    "version": 0,
    "producers": [{
        "producer_name": "eosio",
        "block_signing_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"
      }
    ]
  },
  "pending": null,
  "proposed": null
}
$ cleos get schedule
active schedule version 45
    Producer      Producer key
    ============= ==================
    argentinaeos  EOS7jq4FHrFrtCXxpRQ39dBeDMa5AjM4VaRbqBECkSa5aZnizJzrx
    bitfinexeos1  EOS6sgKjHUFtY1XxxQaMDwfxBac6nDBibVzZHb8LFMVmvSjcCdDhE
    cryptolions1  EOS5yHaUBwhpwFftNjADdVwBpCVybLPg5P3z7HpTbDGjUfpqwWSSf
    cypherglasss  EOS5rTrUiqvgu7YCVyKCeQ1QXA7Uo94FZhq7zKcNPqbrCP5u5fQXo
    eos42freedom  EOS4tw7vH62TcVtMgm2tjXzn9hTuHEBbGPUK2eos42ssY7ip4LTzu
    eosauthority  EOS4va3CTmAcAAXsT26T3EBWqYHgQLshyxsozYRgxWm9tjmy17pVV
    eosbeijingbp  EOS5dGpcEhwB4VEhhXEcqtZs9EQj5HeetuXDnsAGVHMXHAFdMjbdj
    eoscafeblock  EOS7MAPWVuYcxNtc2n9e6WaEedEZd9thGVHn2Wpu2PoMhNiteTTqL
    eoscanadacom  EOS5HYV7rWeRxpZMCooe8YHRFQHKK7ncdmmUMTe3wCMaY2EvyVzUx
    eoscannonchn  EOS73cTi9V7PNg4ujW5QzoTfRSdhH44MPiUJkUV6m3oGwj7RX7kML
    eosdacserver  EOS7aBPDACAn1SpJDjmaZHSEUgqfNWdUaNawVZhVuEWUx5aoepJf6
    eosgenblockp  EOS65tu7JUi74KL1JAffKYtMw6HRKnxD1LAxLBFoCvcdfBB9AMU8n
    eoshuobipool  EOS5XKswW26cR5VQeDGwgNb5aixv1AMcKkdDNrC59KzNSBfnH6TR7
    eosiomeetone  EOS5gS4ZtanRS2Jx4vpjAQaVNci3v65iZiGCgMr9DNwu67x2pt8Qd
    eosisgravity  EOS55HTTjoxVX1zVpW8pabxygBb1J3SEnG5D8D3y3KgrnSbLpELfE
    eosliquideos  EOS4v1n2j5kXbCum8LLEc8zQLpeLK9rKVFmsUgLCWgMDN38P6PcrW
    eosnewyorkio  EOS6GVX8eUqC1gN1293B3ivCNbifbr1BT6gzTFaQBXzWH9QNKVM4X
    eosstorebest  EOS8FrjiXUDAFc8pSQkFejk1zRxyALnqPbYdJsqhAwKMya3tY7TaU
    helloeoscnbp  EOS79cHpaEittzgJWgj79tdRhgzLEWy8wXmmQ3fL7kkDjmYYiGNet
    jedaaaaaaaaa  EOS5XP49jx9eJNQZjqvP7pfKNaAe5JmyAbPZMdsiqD61QQEExqUYe
    zbeosbp11111  EOS7rhgVPWWyfMqjSbNdndtCK8Gkza3xnDbUupsPLMZ6gjfQ4nX81

pending schedule empty

proposed schedule empty

项目源代码

项目源代码会逐步上传到 Github,地址为 https://github.com/windstamp/blockchain

Contributor

  1. Windstamp, https://github.com/windstamp
上一篇 下一篇

猜你喜欢

热点阅读