Peers

https://img.shields.io/badge/auth-required-orange.svg

Hint

The rules for generating queries to the node are given in module How to use REST API.

POST /peers/connect

Request to connect a new host to the node.

Method Query:

{
    "host":"127.0.0.1",
    "port":"9084"
}

Method Response:

{
  "hostname": "localhost",
  "status": "Trying to connect"
}

GET /peers/connected

Returns a list of connected nodes.

Method Response:

{
  "peers": [
    {
      "address": "52.51.92.182/52.51.92.182:6863",
      "declaredAddress": "N/A",
      "peerName": "zx 182",
      "peerNonce": 183759
    },
    {
      "address": "ec2-52-28-66-217.eu-central-1.compute.amazonaws.com/52.28.66.217:6863",
      "declaredAddress": "N/A",
      "peerName": "zx 217",
      "peerNonce": 1021800
    }
  ]
}

GET /peers/all

Returns a list of all known nodes.

Method Response:

{
  "peers": [
    {
      "address": "/13.80.103.153:6864",
      "lastSeen": 1544704874714
    }
  ]
}

GET /peers/suspended

Returns a list of suspended nodes.

Method Response:

[
  {
    "hostname": "/13.80.103.153",
    "timestamp": 1544704754619
  }
]

POST /peers/identity

Gets the public key of the peer which is used by the node for the connection and the confidential data transfer.

Method Query:

{
  "address": "3NBVqYXrapgJP9atQccdBPAgJPwHDKkh6A8",
  "signature": "6RwMUQcwrxtKDgM4ANes9Amu5EJgyfF9Bo6nTpXyD89ZKMAcpCM97igbWf2MmLXLdqNxdsUc68fd5TyRBEB6nqf"
}

Parameters:

  • address - the blockchain address corresponding to the “privacy.owner-address” parameter in the node configuration file;

  • signature - electronic signature of the “address” field value.

Method Response:

{
  "publicKey": "3NBVqYXrapgJP9atQccdBPAgJPwHDKkh6A8"
}

Parameters:

  • publicKey - the peer public key associated with “privacy.owner-address” parameter in the configuration file. This parameter does not appear if the mode of the handshake checking turned off.

GET /peers/hostname/{address}

Gets the hostname and IP Address of the node by its address in the Waves Enterprise net.

Method Response:

{
  "hostname": "node1.we.io",
  "ip": "10.0.0.1"
}

GET /peers/allowedNodes

Gets the actual list of allowed participants at the request moment.

Method Response:

{
  "allowedNodes": [
    {
      "address": "3JNLQYuHYSHZiHr5KjJ89wwFJpDMdrAEJpj",
      "publicKey": "Gt3o1ghh2M2TS65UrHZCTJ82LLcMcBrxuaJyrgsLk5VY"
    },
    {
      "address": "3JLp8wt7rEUdn4Cca5Hp9jZ7w8T5XDAKicd",
      "publicKey": "J3ffCciVu3sustgb5vxmEHczACMR89Vty5ZBLbPn9xyg"
    },
    {
      "address": "3JRY1cp7atRMBd8QQoswRpH7DLawM5Pnk3L",
      "publicKey": "5vn4UcB9En1XgY6w2N6e9W7bqFshG4SL2RLFqEWEbWxG"
    }
  ],
  "timestamp": 1558697649489
}