Skip to main content

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

NameTypeRequiredDescription
versionstringNoFilter peers by version prefix (e.g., 1.7.0).
includeNewerbooleanNoIf true, include peers with newer versions. Defaults to false.
connectbooleanNoIf true, connects to all peers. Requires admin password. Defaults to false.
servicestringNoFilter by peer service (e.g., PRUNABLE, FULL, NETWORK). May be repeated.
adminPasswordstringConditionalAdmin password required if nxt.adminPassword is set.

Response

{
"peers": "192.168.1.1:22024; 192.168.1.2:22024; ",
"count": 2
}

Response Fields

FieldTypeDescription
peersstringSemicolon-separated list of peer addresses.
countintegerNumber of matching peers.

Error Responses

ConditionResponse
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"