For API request, it needs to perform a POST line with required parameters. The manual presents examples of requests using curl. Return code 201 indicates successful operation.
{
"peer": "string", // The IP address or URL of the peer
"connecting": true, // "true" if the peer is connecting, otherwise "false"
"syncing": true, // "true" if the peer is syncing, otherwise "false"
"last_handshake": { // Structure holding detailed information about the connection
"network_version": 0, // Incremental value above a computed base. Defaults to "0"
"chain_id": "string", // Chain ID. Used to identify chain (sha256)
"node_id": "string", // Node ID. Used to identify peers and prevent self-connect (sha256)
"key": "string", // Authentication public key
"time": "string", // Date/time in the format (YYYY-MM-DDTHH:MM:SS.sss)
"token": "string", // Digest of time to prove we own the private key of the key above (sha256)
"sig": "string", // Signature for the digest
"p2p_address": "string", // Address of the peer (IP address or URL)
"last_irreversible_block_num": 0, // Last irreversible block number. Defaults to "0"
"last_irreversible_block_id": "string", // Last irreversible block ID (sha256)
"head_num": 0, // Head number. Defaults to "0"
"head_id": "string", // Head ID (sha256)
"os": "string", // Operating system name
"agent": "string", // Agent name
"generation": 0, // Generation number
"considers_gray": // Considers gray. Optional field. Defaults to "false".
}
}
connections
The request returns an array of all peer connection statuses.
[
{
"peer": "string", // The IP address or URL of the peer
"connecting": true, // "true" if the peer is connecting, otherwise "false"
"syncing": true, // "true" if the peer is syncing, otherwise "false"
"last_handshake": { // Structure holding detailed information about the connection
...
}
}
{...}
]