Documentation
Search…
Nodeos Net API
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.
Producer API requests supported:

connect

The request initiates a connection to a specified peer.
Params:
  • (string) endpoint — The endpoint to connect to expressed as either IP address or URL.
Request example:
1
curl --request POST --data '{"endpoint": "string"}' http://<node>/v1/net/connect
Copied!

Responses

Code: 201 OK
Value:
1
{
2
"added connection" // Otherwise "already connected" if the connection was already initiated before
3
}
Copied!

disconnect

The request initiates disconnection from a specified peer.
Params:
  • (string) endpoint — The endpoint to disconnect from, expressed as either IP address or URL.
Request example:
1
curl --request POST --data '{"endpoint": "string"}' http://<node>/v1/net/disconnect
Copied!

Responses

Code: 201 OK
Value:
1
{
2
"connection removed" // Otherwise "no known connection for host" if no connection was initiated to the peer
3
}
Copied!

status

The request retreives the connection status for a specified peer.
Params:
  • (string) endpoint — The endpoint to get the status for, to expressed as either IP address or URL.
Request example:
1
curl --request POST --data '{"endpoint": "string"}' http://<node>/v1/net/status
Copied!

Responses

Code: 201 OK
Value:
1
{
2
"peer": "string", // The IP address or URL of the peer
3
"connecting": true, // "true" if the peer is connecting, otherwise "false"
4
"syncing": true, // "true" if the peer is syncing, otherwise "false"
5
"last_handshake": { // Structure holding detailed information about the connection
6
"network_version": 0, // Incremental value above a computed base. Defaults to "0"
7
"chain_id": "string", // Chain ID. Used to identify chain (sha256)
8
"node_id": "string", // Node ID. Used to identify peers and prevent self-connect (sha256)
9
"key": "string", // Authentication public key
10
"time": "string", // Date/time in the format (YYYY-MM-DDTHH:MM:SS.sss)
11
"token": "string", // Digest of time to prove we own the private key of the key above (sha256)
12
"sig": "string", // Signature for the digest
13
"p2p_address": "string", // Address of the peer (IP address or URL)
14
"last_irreversible_block_num": 0, // Last irreversible block number. Defaults to "0"
15
"last_irreversible_block_id": "string", // Last irreversible block ID (sha256)
16
"head_num": 0, // Head number. Defaults to "0"
17
"head_id": "string", // Head ID (sha256)
18
"os": "string", // Operating system name
19
"agent": "string", // Agent name
20
"generation": 0, // Generation number
21
"considers_gray": // Considers gray. Optional field. Defaults to "false".
22
}
23
}
Copied!

connections

The request returns an array of all peer connection statuses.
Params: No params required.
Request example:
1
curl --request POST --data '' http://<node>/v1/net/connections
Copied!

Responses

Code: 201 OK
Value:
1
[
2
{
3
"peer": "string", // The IP address or URL of the peer
4
"connecting": true, // "true" if the peer is connecting, otherwise "false"
5
"syncing": true, // "true" if the peer is syncing, otherwise "false"
6
"last_handshake": { // Structure holding detailed information about the connection
7
...
8
}
9
}
10
{...}
11
]
Copied!
Last modified 1yr ago