Net module

net_listening

Invocation
{"method":"net_listening","params":[]}
Returned type
Description
Boolean
Example request of net_listening
Example response of net_listening
curl --data '{"method":"net_listening","params":[],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST localhost:8545
{
"jsonrpc": "2.0",
"result": true,
"id": 1
}

net_localAddress

Invocation
{"method":"net_localAddress","params":[]}
Returned type
Description
Address
Example request of net_localAddress
Example response of net_localAddress
curl --data '{"method":"net_localAddress","params":[],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST localhost:8545
{
"jsonrpc": "2.0",
"result": 0x247b5f5f007fb5d50de13cfcbd4460db21c12bcb,
"id": 1
}

net_localEnode

Invocation
{"method":"net_localEnode","params":[]}
Returned type
Description
String
Example request of net_localEnode
Example response of net_localEnode
curl --data '{"method":"net_localEnode","params":[],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST localhost:8545
{
"jsonrpc": "2.0",
"result": enode://a9cfa3cb16b537e131b0f141b5ef0c0ab9bf0dbec7799c3fc7bf8a974ff3e74e9[email protected]18.193.43.58:30303,
"id": 1
}

net_peerCount

Invocation
{"method":"net_peerCount","params":[]}
Returned type
Description
Quantity
Example request of net_peerCount
Example response of net_peerCount
curl --data '{"method":"net_peerCount","params":[],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST localhost:8545
{
"jsonrpc": "2.0",
"result": 0x11,
"id": 1
}

net_version

Invocation
{"method":"net_version","params":[]}
Returned type
Description
String
Example request of net_version
Example response of net_version
curl --data '{"method":"net_version","params":[],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST localhost:8545
{
"jsonrpc": "2.0",
"result": 4,
"id": 1
}
Copy link
On this page
net_listening
net_localAddress
net_localEnode
net_peerCount
net_version