banned - Monero
Example code for the banned JSON-RPC method. Complete guide on how to use banned JSON-RPC in GetBlock Web3 documentation.
This method checks whether a given IP address is currently banned on the node.
Parameters
Parameter
Type
Required
Description
address
string
Yes
IP address or hostname to check
Request Example
curl --location --request POST 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"method": "banned",
"params": {
"address": "192.0.2.1"
},
"id": "getblock.io"
}'import axios from 'axios';
const data = JSON.stringify({
"jsonrpc": "2.0",
"method": "banned",
"params": {
"address": "192.0.2.1"
},
"id": "getblock.io"
});
const config = {
method: 'post',
url: 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/',
headers: {
'Content-Type': 'application/json'
},
data: data
};
axios(config)
.then(response => console.log(JSON.stringify(response.data, null, 2)))
.catch(error => console.log(error));Response Example
{
"id": "getblock.io",
"jsonrpc": "2.0",
"result": {
"banned": false,
"seconds": 0,
"status": "OK"
}
}Response Parameters
Field
Type
Description
result.banned
boolean
true if the address is currently banned
result.seconds
unsigned int
Seconds remaining on the ban (0 if not banned)
result.status
string
OK if the query succeeded
Use Cases
Checking ban state for a specific IP
Automated peer-health monitoring
Error Handling
Status Code
Error Message
Cause
404
not found
Missing or invalid <ACCESS-TOKEN>
-32602
Invalid params
Request parameters are missing or malformed
429
Too Many Requests
Rate limit exceeded for your plan
SDK Integration
Last updated
Was this helpful?