net

The net namespace offers RPC endpoints for retrieving network-related information about your node. These endpoints allow you to check whether the node is listening for connections, view the current peer count, and obtain the network ID. This information is useful for network diagnostics and monitoring the overall connectivity status of your R5 node.


net_listening

Description: Indicates whether the node is actively listening for network connections. This can help verify that your node is reachable and accepting incoming peer connections.

Sample Request:

{
  "jsonrpc": "2.0",
  "method": "net_listening",
  "params": [],
  "id": 1
}

Expected Response:

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

Parameters: None.


net_peerCount

Description: Returns the number of peers currently connected to the node. The peer count is typically represented as a hexadecimal string.

Sample Request:

{
  "jsonrpc": "2.0",
  "method": "net_peerCount",
  "params": [],
  "id": 1
}

Expected Response:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0x5"
}

Parameters: None.


net_version

Description: Provides the network ID as a string. This value represents the network on which the node is operating and is useful for ensuring that nodes are connected to the correct blockchain network.

Sample Request:

{
  "jsonrpc": "2.0",
  "method": "net_version",
  "params": [],
  "id": 1
}

Expected Response:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "1"
}

Parameters: None.

Last updated