admin_peers

描述:查询节点已连接的远程节点的相关信息

parameter

return

返回远程节点对象数组

example

Request:

curl -X POST \
  http://127.0.0.1:8283 \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc": "2.0", "id": 1, "method": "admin_peers", "params": []}'

Response:

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": [
        {
            "enode": "enode://c4b165b185fcd82630d1b7395755d77d7bf93f9d9e04b123fa53f861262b7a296d77fd6c69e71115d535989b851a7b5c15a8e3c4614b030b140ff84d937e034a@127.0.0.1:9283?discport=9284&nat=4&nodetype=2",
            "id": "080f8341efe368f76eed4cda52bba37a318fe1c7c156c796bf07f8e66614153f",
            "name": "0xbe635E5a8D2552160c26221ADC1c8A58730E388B/linux-amd64/go1.13.4",
            "nat": "Port restricted NAT",
            "nodeType": "full",
            "caps": [
                "you/8"
            ],
            "network": {
                "localAddress": "[::]:9283",
                "remoteAddress": "127.0.0.1:9283",
                "inbound": false,
                "trusted": false,
                "static": false
            },
            "protocols": {
                "you": "handshake"
            }
        },
        {
            "enode": "enode://192bf0d44bede4346a8ffba90c85e27e4b971851872371a809bd81b6a85a4ab969dc004f0901ea0a38591dcc1b075ade8fd49e4dbef46ca7524cf5b23e998ab8@127.0.0.1:9283?discport=9284&nat=2&nodetype=2",
            "id": "94c42bb646fd4b80c323cc169d95fc073f507232c56ddd85abaf97c0f160d0fe",
            "name": "YouChain/linux-amd64/go1.13.4",
            "nat": "Full cone NAT",
            "nodeType": "full",
            "caps": [
                "you/8"
            ],
            "network": {
                "localAddress": "[::]:9283",
                "remoteAddress": "127.0.0.1:9283",
                "inbound": false,
                "trusted": false,
                "static": false
            },
            "protocols": {
                "you": "handshake"
            }
        },
        {
            "enode": "enode://a804b9f494636adf7cb29cb1b60135eb519cd0350f9b8ababb0c025864097057f5073159558dc61128d4410fa3c7ca4e24c6e30caea0f3876724fcca2a19aa77@127.0.0.1:9283?nat=4&nodetype=2",
            "id": "b66220023f7375e5327b0b597990145c2c5061d3b8eec9ce2a39d03277ce22a1",
            "name": "YouChain/linux-amd64/go1.13.4",
            "nat": "Port restricted NAT",
            "nodeType": "full",
            "caps": [
                "you/8"
            ],
            "network": {
                "localAddress": "[::]:9283",
                "remoteAddress": "127.0.0.1:9283",
                "inbound": true,
                "trusted": false,
                "static": false
            },
            "protocols": {
                "you": "handshake"
            }
        },
        {
            "enode": "enode://9c20446b80393faa2dd25a9fa20a06614465db8a7949612bd522f61582556bdbece3862f399ab6983ba27b72bc4c53001d2b8e533ae532eef8523d79d2d4c2a7@127.0.0.1:9283?discport=9284&nat=4&nodetype=2",
            "id": "d7e591af148e611994baff47b2a1bbbc184db35c6a9b001a634e7678eadd6a6b",
            "name": "YouChain/linux-amd64/go1.13.4",
            "nat": "Port restricted NAT",
            "nodeType": "full",
            "caps": [
                "you/8"
            ],
            "network": {
                "localAddress": "[::]:9283",
                "remoteAddress": "127.0.0.1:9283",
                "inbound": false,
                "trusted": false,
                "static": false
            },
            "protocols": {
                "you": "handshake"
            }
        }
    ]
}