Net
This page describes network related APIs

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:
curl -X POST --data '{
"jsonrpc":"2.0",
"method":"net_join",
"params": [
"ellcrys://[email protected]:9000"
],
"id":21
}'

> net.join(["ellcrys://[email protected]:9000"])
> net.join(
"ellcrys://[email protected]:9000",
"ellcrys://[email protected]:9000"
)

Boolean

{
"id": 8534968035807551000,
"jsonrpc": "2.0",
"result": true
}

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:
curl -X POST --data '{
"jsonrpc":"2.0",
"method":"net_addPeer",
"params": [
"ellcrys://[email protected]:9000"
],
"id":21
}'

> net.addPeer(["ellcrys://[email protected]:9000"])
> net.addPeer(
"ellcrys://[email protected]:9000",
"ellcrys://[email protected]:9000"
)

Boolean

{
"id": 8534968035807551000,
"jsonrpc": "2.0",
"result": true
}

Get the client's connection statistics.
Parameters
Curl Example:
curl -X POST --data '{"jsonrpc":"2.0", "method":"net_stats", "id":21 }'

> net.stats()

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.

{
"id": 7082198080470856000,
"jsonrpc": "2.0",
"result": {
"inbound": 5,
"intros": 3,
"outbound": 6,
"total": 9
}
}

Get all known peers.
Parameters
Curl Example:
curl -X POST --data '{"jsonrpc":"2.0", "method":"net_getPeers", "id":21 }'

> net.getPeers()

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.

{
"id": 21,
"jsonrpc": "2.0",
"result": [
{
"name": "normally-liked-eel",
"banEndTime": "0001-01-01T00:00:00Z",
"connected": true,
"id": "12D3KooWHHzSeKaY8xuZVzkLbKFfvNgPPeKhFBGrMbNzbm5akpqu",
"isAcquainted": true,
"isBanned": false,
"isInbound": false,
"lastSeen": "2018-11-10T15:05:46.915069009+01:00"
}
]
}

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:
curl -X POST --data '{"jsonrpc":"2.0", "method":"net_getActivePeers", "id":21 }'

> net.getActivePeers()

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.

{
"id": 21,
"jsonrpc": "2.0",
"result": [
{
"name": "normally-liked-eel",
"banEndTime": "0001-01-01T00:00:00Z",
"connected": true,
"id": "12D3KooWHHzSeKaY8xuZVzkLbKFfvNgPPeKhFBGrMbNzbm5akpqu",
"isAcquainted": true,
"isBanned": false,
"isInbound": false,
"lastSeen": "2018-11-10T15:05:46.915069009+01:00"
}
]
}

Clear all peers stored in memory and on disk.
Parameters
Curl Example:
curl -X POST --data '{"jsonrpc":"2.0", "method":"net_dumpPeers", "id":21 }'

> net.dumpPeers()

Boolean

{
"id": 21,
"jsonrpc": "2.0",
"result": true
}

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:
curl -X POST --data '{"jsonrpc":"2.0", "method":"net_broadcasters", "id":21 }'

> net.broadcasters()

Object
Field
Type
Description
broadcasters
Array<string>
A list of regular broadcasters address.
randomBroadcasters
Array<string>
A list of random broadcasters address.

{
"id": 21,
"jsonrpc": "2.0",
"result": {
"broadcasters": [
"ellcrys://[email protected]:9000",
"ellcrys://[email protected]:9000",
"ellcrys://[email protected]:9000"
],
"randomBroadcasters": [
"ellcrys://[email protected]:9000",
"ellcrys://[email protected]:9000",
"ellcrys://[email protected]:9000"
]
}
}

Disables network activities. Prevents inbound or outbound connections by shutting down the client's network function.
Private: Requires authentication.
Parameters: Nonde
Curl Example:
curl -X POST --data '{
"jsonrpc":"2.0",
"method":"net_noNet",
"params": null,
"id":21
}'

> net.noNet()

Boolean

{
"id": 8534968035807551000,
"jsonrpc": "2.0",
"result": true
}
Copy link
On this page
net_join
net_addPeer
net_stats
net_getPeers
net_getActivePeers
net_dumpPeers
net_broadcasters
net_noNet