The `net` Module - Wiki OpenEthereum Documentation

JSON-RPC methods

JSON-RPC API Reference

net_listening

Returns true if client is actively listening for network connections.

Parameters

None

Returns

Example

Request

curl --data '{"method":"net_listening","params":[],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST localhost:8545

Response

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

net_peerCount

Returns number of peers currenly connected to the client.

Parameters

None

Returns

Example

Request

curl --data '{"method":"net_peerCount","params":[],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST localhost:8545

Response

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": "0x2" // 2
}

net_version

Returns the current network protocol version.

Parameters

None

Returns

Example

Request

curl --data '{"method":"net_version","params":[],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST localhost:8545

Response

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