Net
This page describes network related APIs
net_join
Instructs the client to join a network. The client sends a Handshake message to the addresses and adds them as peers if the handshake was successful.
Private: Requires authentication.
Parameters
Argument | Type | Description |
addresses | Array<String> | A list of addresses. |
Curl Example:
Console Example
Returns:
Boolean
Output:
net_addPeer
Add one or more addresses to the peer list. These addresses will be lazily connected to only when the client needs more peer connections.
Private: Requires authentication.
Parameters
Argument | Type | Description |
addresses | Array<String> | A list of addresses. |
Curl Example:
Console Example
Returns:
Boolean
Output:
net_stats
Get the client's connection statistics.
Parameters
Curl Example:
Console Example
Returns:
Object
Field | Type | Description |
inbound | Integer | The number of inbound connections. |
outbound | Integer | The number of outbound connections. |
intros | Integer | The number of intro messages received. |
total | Integer | The total number of connections. |
Output:
net_getPeers
Get all known peers.
Parameters
Curl Example:
Console Example
Returns:
Array<Object>
Field | Type | Description |
id | String | The ID of the peer. |
name | String | The node's user-friendly name. |
connected | Boolean | Indicates that the local peer is connected to the peer or not. |
isInbound | Boolean | Indicates that the connection to this peer is inbound or not. |
isBanned | Boolean | Indicates that the peer is currently banned or not. |
isAcquainted | Boolean | Indicates that the peer and the local peer have performed the Handshake ritual or not. |
banEndTime | String | The time this peer will complete its ban term. |
lastSeen | String | The time this peer was last heard from. |
Output:
net_getActivePeers
Get all active peers. Active peers are peers that are not serving any ban time and have been seen in the last 3 hours.
Parameters
Curl Example:
Console Example
Returns:
Array<Object>
Field | Type | Description |
id | String | The ID of the peer. |
name | String | The node's user-friendly name. |
connected | Boolean | Indicates that the local peer is connected to the peer or not. |
isInbound | Boolean | Indicates that the connection to this peer is inbound or not. |
isBanned | Boolean | Indicates that the peer is currently banned or not. |
isAcquainted | Boolean | Indicates that the peer and the local peer have performed the Handshake ritual or not. |
banEndTime | String | The time this peer will complete its ban term. |
lastSeen | String | The time this peer was last heard from. |
Output:
net_dumpPeers
Clear all peers stored in memory and on disk.
Parameters
Curl Example:
Console Example
Returns:
Boolean
Output:
net_broadcasters
Returns the addresses of peers that have been selected by the peer as recipients of messages (transactions, blocks, addresses e.t.c) that need to be broadcast or forwarded. These broadcasters are separated into two categories namely:
Regular broadcasters
Random broadcasters
Regular broadcasters are peers that are actively connected and known by the node. They are acquainted and compatible with the node. Random broadcasters may not be known or compatible with the node. They are mostly used for broadcasting addresses to aid the network's discovery protocol.
Parameters
Curl Example:
Console Example
Returns:
Object
Field | Type | Description |
broadcasters | Array<string> | A list of regular broadcasters address. |
randomBroadcasters | Array<string> | A list of random broadcasters address. |
Output:
net_noNet
Disables network activities. Prevents inbound or outbound connections by shutting down the client's network function.
Private: Requires authentication.
Parameters: Nonde
Curl Example:
Console Example
Returns:
Boolean
Output:
Last updated