getpeerinfo - Zcash
Example code for the getpeerinfo JSON-RPC method. Сomplete guide on how to use the getpeerinfo JSON-RPC method in GetBlock.io Web3 documentation.
Parameters
Request
curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"method": "getpeerinfo",
"params": [],
"id": "getblock.io"
}'const axios = require('axios');
const response = await axios.post('https://go.getblock.io/<ACCESS-TOKEN>/', {
jsonrpc: '2.0',
method: 'getpeerinfo',
params: [],
id: 'getblock.io'
}, {
headers: { 'Content-Type': 'application/json' }
});
console.log(response.data.result);import requests
response = requests.post(
'https://go.getblock.io/<ACCESS-TOKEN>/',
headers={'Content-Type': 'application/json'},
json={
'jsonrpc': '2.0',
'method': 'getpeerinfo',
'params': [],
'id': 'getblock.io'
}
)
print(response.json())Response
{
"jsonrpc": "2.0",
"id": "getblock.io",
"result": [
{
"addr": "213.136.68.237:8233",
"services": "0000000000000001",
"lastrecv": 1784671886,
"inbound": false,
"banscore": 0,
"subver": "/Zebra:5.1.0/",
"version": 170150,
"connection_state": "connected",
"pingtime": 0.031849273
},
{
"addr": "47.75.194.174:8233",
"services": "0000000000000001",
"lastrecv": 1784671855,
"inbound": false,
"banscore": 0,
"subver": "/Zakura:1.0.1/",
"version": 170160,
"connection_state": "connected",
"pingtime": 0.183128632
}
]
}Response Parameters
Parameter
Type
Description
Use Cases
Error Handling
Error Code
Message
Description
Last updated
Was this helpful?