Dump Peers
Returns addresses of connected peers matching specified version and service filters. Optionally connects to all peers. Requires admin password. This is a POST-only endpoint.
Request
POST /nxt?requestType=dumpPeers&adminPassword=<adminPassword>&version=<version>&includeNewer=<boolean>&connect=<boolean>&service=<service>
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
version | string | No | Filter peers by version prefix (e.g., 1.7.0). |
includeNewer | boolean | No | If true, include peers with newer versions. Defaults to false. |
connect | boolean | No | If true, connects to all peers. Requires admin password. Defaults to false. |
service | string | No | Filter by peer service (e.g., PRUNABLE, FULL, NETWORK). May be repeated. |
adminPassword | string | Conditional | Admin password required if nxt.adminPassword is set. |
Response
{
"peers": "192.168.1.1:22024; 192.168.1.2:22024; ",
"count": 2
}
Response Fields
| Field | Type | Description |
|---|---|---|
peers | string | Semicolon-separated list of peer addresses. |
count | integer | Number of matching peers. |
Error Responses
| Condition | Response |
|---|---|
| Invalid service value | {"error": "service", "errorDescription": "Incorrect service, '- <value>' is not defined"} |
| Networking disabled | {"error": "peersNetworking", "errorDescription": "Peers networking is disabled"} |
Notes
- This endpoint does not require the blockchain to be running (
requireBlockchain = false). - Not chain-specific.
- Requires admin password authentication (
requirePassword = true). - Requires POST method (
requirePost = true). - Only includes peers that are connected, share addresses, are not blacklisted, provide the requested services, and match the version filter.
Source: DumpPeers.java.
Example
curl -X POST "http://localhost:22024/nxt" \
-d "requestType=dumpPeers" \
-d "adminPassword=mySecretPassword" \
-d "version=1.7.0" \
-d "includeNewer=false" \
-d "connect=false"