eos

2.9 cleos-commands-net

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

net 常用命令

控制本地 p2p 网络连接。使用方式 cleos net SUBCOMMAND。

1. connect

开始到一个对端的新连接。使用方式 cleos net connect host。

$ cleos net connect 127.0.0.1:9099
"added connection"

注意,这会更新 cleos net peers 的输出结果。

2. disconnect

关闭一个已经存在的连接。使用方式 cleos net disconnect host。

$ cleos net disconnect 127.0.0.1:9099
"connection removed"

注意,这会更新 cleos net peers 的输出结果。

3. status

已存在连接的状态。使用方式 cleos net status host。

$ cleos net status 127.0.0.1:9011
{
  "peer": "127.0.0.1:9011",
  "connecting": false,
  "syncing": false,
  "last_handshake": {
    "network_version": 0,
    "chain_id": "0000000000000000000000000000000000000000000000000000000000000000",
    "node_id": "0000000000000000000000000000000000000000000000000000000000000000",
    "key": "EOS1111111111111111111111111111111114T1Anm",
    "time": 0,
    "token": "0000000000000000000000000000000000000000000000000000000000000000",
    "sig": "SIG_K1_111111111111111111111111111111111111111111111111111111111111111116uk5ne",
    "p2p_address": "",
    "last_irreversible_block_num": 0,
    "last_irreversible_block_id": "0000000000000000000000000000000000000000000000000000000000000000",
    "head_num": 0,
    "head_id": "0000000000000000000000000000000000000000000000000000000000000000",
    "os": "",
    "agent": "",
    "generation": 0
  }
}
$ cleos net status 127.0.0.1:9018
null

4. peers

所有已存在对端的状态。使用方式 cleos net peers。

$ cleos net peers
[{
    "peer": "",
    "connecting": false,
    "syncing": false,
    "last_handshake": {
      "network_version": 1206,
      "chain_id": "f22d65c5d3af21db9f2b474ca4ed5f93b2f7e2e72798179585b85570f705e4dc",
      "node_id": "8fc5a23f2595bbd8628acf4cc86f811c8f4be784e544b96eea5be695aa63d46e",
      "key": "EOS1111111111111111111111111111111114T1Anm",
      "time": "1563789282490704426",
      "token": "0000000000000000000000000000000000000000000000000000000000000000",
      "sig": "SIG_K1_111111111111111111111111111111111111111111111111111111111111111116uk5ne",
      "p2p_address": "furnace:9011 - 8fc5a23",
      "last_irreversible_block_num": 24064,
      "last_irreversible_block_id": "00005e005dfc7a9fee7b94faa9a3b345499e43d6b46efc4dbcea1a9669543c92",
      "head_num": 24065,
      "head_id": "00005e01041df6aa4225c68ba7247a8038a001c24693800c69b31ae969bc476c",
      "os": "linux",
      "agent": "\"EOS Test Agent\"",
      "generation": 4
    }
  },{
    "peer": "127.0.0.1:9013",
    "connecting": false,
    "syncing": false,
    "last_handshake": {
      "network_version": 0,
      "chain_id": "0000000000000000000000000000000000000000000000000000000000000000",
      "node_id": "0000000000000000000000000000000000000000000000000000000000000000",
      "key": "EOS1111111111111111111111111111111114T1Anm",
      "time": 0,
      "token": "0000000000000000000000000000000000000000000000000000000000000000",
      "sig": "SIG_K1_111111111111111111111111111111111111111111111111111111111111111116uk5ne",
      "p2p_address": "",
      "last_irreversible_block_num": 0,
      "last_irreversible_block_id": "0000000000000000000000000000000000000000000000000000000000000000",
      "head_num": 0,
      "head_id": "0000000000000000000000000000000000000000000000000000000000000000",
      "os": "",
      "agent": "",
      "generation": 0
    }
  },{
    "peer": "127.0.0.1:9011",
    "connecting": false,
    "syncing": false,
    "last_handshake": {
      "network_version": 0,
      "chain_id": "0000000000000000000000000000000000000000000000000000000000000000",
      "node_id": "0000000000000000000000000000000000000000000000000000000000000000",
      "key": "EOS1111111111111111111111111111111114T1Anm",
      "time": 0,
      "token": "0000000000000000000000000000000000000000000000000000000000000000",
      "sig": "SIG_K1_111111111111111111111111111111111111111111111111111111111111111116uk5ne",
      "p2p_address": "",
      "last_irreversible_block_num": 0,
      "last_irreversible_block_id": "0000000000000000000000000000000000000000000000000000000000000000",
      "head_num": 0,
      "head_id": "0000000000000000000000000000000000000000000000000000000000000000",
      "os": "",
      "agent": "",
      "generation": 0
    }
  },{
    "peer": "127.0.0.1:9012",
    "connecting": false,
    "syncing": false,
    "last_handshake": {
      "network_version": 0,
      "chain_id": "0000000000000000000000000000000000000000000000000000000000000000",
      "node_id": "0000000000000000000000000000000000000000000000000000000000000000",
      "key": "EOS1111111111111111111111111111111114T1Anm",
      "time": 0,
      "token": "0000000000000000000000000000000000000000000000000000000000000000",
      "sig": "SIG_K1_111111111111111111111111111111111111111111111111111111111111111116uk5ne",
      "p2p_address": "",
      "last_irreversible_block_num": 0,
      "last_irreversible_block_id": "0000000000000000000000000000000000000000000000000000000000000000",
      "head_num": 0,
      "head_id": "0000000000000000000000000000000000000000000000000000000000000000",
      "os": "",
      "agent": "",
      "generation": 0
    }
  }
]

项目源代码

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

Contributor

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

猜你喜欢

热点阅读