blacklistPeer

Finalized

Introduction

The blacklistPeer method is an administrative endpoint that allows a node operator to manually block all network connections to and from a specific peer. This is a security and network management feature used to isolate the node from misbehaving, malicious, or malfunctioning peers.

A peer can be blacklisted in one of two ways:

  1. By its network host (IP address or hostname).
  2. By its cryptographic wallet address.

Once a peer is blacklisted, the node will refuse any incoming connections from it and will not attempt to establish any outbound connections to it.


Request

Requests can be made using either HTTP POST with a JSON body or HTTP GET with URL query parameters. At least one of the two parameters must be provided.

Parameters

NameTypeRequiredDescription
hoststringNo (at least one parameter is required)The IP address or hostname of the peer to blacklist.
walletstringNo (at least one parameter is required)The base58-encoded Ixian wallet address of the peer to blacklist.

Example POST Request (by Host)

POST /blacklistPeer
Content-Type: application/json

{
  "jsonrpc": "2.0",
  "method": "blacklistPeer",
  "params": {
    "host": "198.51.100.123"
  },
  "id": 1
}

Example GET Request (by Wallet Address)

GET /blacklistPeer?wallet=1EXSqPpj49ZmKiWF8stsMsMXVnSfkee7EzTaBakwNn9sJdaWm

Response

If the request is successful, the response result is a simple confirmation string.

Result Fields (on Success)

NameTypeDescription
resultstringThe static string "OK" on success.

Example Success Response

{
  "jsonrpc": "2.0",
  "result": "OK",
  "id": 1,
  "error": null
}

Example Error Response

An error may be returned if the wallet address format is invalid.

{
    "jsonrpc": "2.0",
    "result": null,
    "id": 1,
    "error": {
        "code": -32602,
        "message": "Invalid address format."
    }
}