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://go.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"
}'

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?