Network RPCs

addnode

Attempts to add or remove a node from the addnode list.

Or try a connection to a node once.

Method: POST

https://btc-testnet.nownodes.io

Example body (raw)

{
    "jsonrpc": "1.0",
    "id": "curltest",
    "method": "addnode",
    "params": [
        "192.168.0.6:8333",
        "onetry"
    ]
}

Example response: 200

{
    "result": null,
    "error": null,
    "id": "curltest"
}

clearbanned

Clear all banned IPs.

Method: POST

https://btc-testnet.nownodes.io

Example body (raw)

{
    "jsonrpc": "1.0",
    "id": "curltest",
    "method": "clearbanned",
    "params": []
}

Example response: 200

{
    "result": null,
    "error": null,
    "id": "curltest"
}

disconnectnode

Immediately disconnects from the specified peer node.

Strictly one out of ‘address’ and ‘nodeid’ can be provided to identify the node.

To disconnect by nodeid, either set ‘address’ to the empty string, or call using the named ‘nodeid’ argument only.

Method: POST

https://btc-testnet.nownodes.io

Example body (raw)

{
    "jsonrpc": "1.0",
    "id": "curltest",
    "method": "disconnectnode",
    "params": [
        "192.168.0.6:8333"
    ]
}

Example response: 200

{
    "result": null,
    "error": {
        "code": -29,
        "message": "Node not found in connected nodes"
    },
    "id": "curltest"
}

getaddednodeinfo

Returns information about the given added node, or all added nodes (note that onetry addnodes are not listed here)

Method: POST

https://btc-testnet.nownodes.io

Example body (raw)

{
    "jsonrpc": "1.0",
    "id": "curltest",
    "method": "getaddednodeinfo",
    "params": [
        "192.168.0.201"
    ]
}

Example response: 200

{
    "result": null,
    "error": {
        "code": -24,
        "message": "Error: Node has not been added."
    },
    "id": "curltest"
}

getconnectioncount

Returns the number of connections to other nodes.

Method: POST

https://btc-testnet.nownodes.io

Example body (raw)

{
    "jsonrpc": "1.0",
    "id": "curltest",
    "method": "getconnectioncount",
    "params": []
}

Example response: 200

{
    "result": 10,
    "error": null,
    "id": "curltest"
}

getnettotals

Returns information about network traffic, including bytes in, bytes out, and current time.

Method: POST

https://btc-testnet.nownodes.io

Example body (raw)

{
    "jsonrpc": "1.0",
    "id": "curltest",
    "method": "getnettotals",
    "params": []
}

Example response: 200

{
    "result": {
        "totalbytesrecv": 293286237,
        "totalbytessent": 181968955,
        "timemillis": 1712760249801,
        "uploadtarget": {
            "timeframe": 86400,
            "target": 0,
            "target_reached": false,
            "serve_historical_blocks": true,
            "bytes_left_in_cycle": 0,
            "time_left_in_cycle": 0
        }
    },
    "error": null,
    "id": "curltest"
}

getnetworkinfo

Returns an object containing various state info regarding P2P networking.

Method: POST

https://btc-testnet.nownodes.io

Example body (raw)

{
    "jsonrpc": "1.0",
    "id": "curltest",
    "method": "getnetworkinfo",
    "params": []
}

Example response: 200

{
    "result": {
        "version": 260100,
        "subversion": "/Satoshi:26.1.0/",
        "protocolversion": 70016,
        "localservices": "0000000000000409",
        "localservicesnames": [
            "NETWORK",
            "WITNESS",
            "NETWORK_LIMITED"
        ],
        "localrelay": true,
        "timeoffset": 0,
        "networkactive": true,
        "connections": 10,
        "connections_in": 0,
        "connections_out": 10,
        "networks": [
            {
                "name": "ipv4",
                "limited": false,
                "reachable": true,
                "proxy": "",
                "proxy_randomize_credentials": false
            },
            {
                "name": "ipv6",
                "limited": false,
                "reachable": true,
                "proxy": "",
                "proxy_randomize_credentials": false
            },
            {
                "name": "onion",
                "limited": true,
                "reachable": false,
                "proxy": "",
                "proxy_randomize_credentials": false
            },
            {
                "name": "i2p",
                "limited": true,
                "reachable": false,
                "proxy": "",
                "proxy_randomize_credentials": false
            },
            {
                "name": "cjdns",
                "limited": true,
                "reachable": false,
                "proxy": "",
                "proxy_randomize_credentials": false
            }
        ],
        "relayfee": 0.00001000,
        "incrementalfee": 0.00001000,
        "localaddresses": [],
        "warnings": "Unknown new rules activated (versionbit 28)"
    },
    "error": null,
    "id": "curltest"
}

getpeerinfo

Returns data about each connected network node as a json array of objects.

Method: POST

https://btc-testnet.nownodes.io

Example body (raw)

{
    "jsonrpc": "1.0",
    "id": "curltest",
    "method": "getpeerinfo",
    "params": []
}

Example response: 200

{
    "result": [
        {
            "id": 0,
            "addr": "46.101.189.209:18333",
            "addrbind": "172.20.0.2:58720",
            "addrlocal": "136.243.64.190:58720",
            "network": "ipv4",
            "services": "0000000000000409",
            "servicesnames": [
                "NETWORK",
                "WITNESS",
                "NETWORK_LIMITED"
            ],
            "relaytxes": false,
            "lastsend": 1712760417,
            "lastrecv": 1712760417,
            "last_transaction": 0,
            "last_block": 0,
            "bytessent": 498486,
            "bytesrecv": 418673,
            "conntime": 1712145715,
            "timeoffset": -1,
            "pingtime": 0.006775,
            "minping": 0.005174,
            "version": 70015,
            "subver": "/Satoshi:0.20.1/",
            "inbound": false,
            "bip152_hb_to": false,
            "bip152_hb_from": false,
            "startingheight": 2585051,
            "presynced_headers": -1,
            "synced_headers": 2585858,
            "synced_blocks": 2585858,
            "inflight": [],
            "addr_relay_enabled": false,
            "addr_processed": 0,
            "addr_rate_limited": 0,
            "permissions": [],
            "minfeefilter": 0.00000000,
            "bytessent_per_msg": {
                "getheaders": 131806,
                "headers": 38665,
                "ping": 163904,
                "pong": 163904,
                "sendcmpct": 33,
                "sendheaders": 24,
                "verack": 24,
                "version": 126
            },
            "bytesrecv_per_msg": {
                "addr": 17135,
                "feefilter": 32,
                "getheaders": 1117,
                "headers": 72341,
                "ping": 163904,
                "pong": 163904,
                "sendcmpct": 66,
                "sendheaders": 24,
                "verack": 24,
                "version": 126
            },
            "connection_type": "block-relay-only",
            "transport_protocol_type": "v1",
            "session_id": ""
        },
        {
            "id": 1,
            "addr": "195.201.246.33:18333",
            "addrbind": "172.20.0.2:41164",
            "addrlocal": "136.243.64.190:41164",
            "network": "ipv4",
            "services": "0000000000000409",
            "servicesnames": [
                "NETWORK",
                "WITNESS",
                "NETWORK_LIMITED"
            ],
...

listbanned

List all manually banned IPs/Subnets.

Method: POST

https://btc-testnet.nownodes.io

Example body (raw)

{
    "jsonrpc": "1.0",
    "id": "curltest",
    "method": "listbanned",
    "params": []
}

Example response: 200

{
    "result": [],
    "error": null,
    "id": "curltest"
}

ping

Requests that a ping be sent to all other nodes, to measure ping time.

Results provided in getpeerinfo, pingtime and pingwait fields are decimal seconds.

Ping command is handled in queue with all other commands, so it measures processing backlog, not just network ping.

Method: POST

https://btc-testnet.nownodes.io

Example body (raw)

{
    "jsonrpc": "1.0",
    "id": "curltest",
    "method": "ping",
    "params": []
}

Example response: 200

{
    "result": null,
    "error": null,
    "id": "curltest"
}

setban

Attempts to add or remove an IP/Subnet from the banned list.

Method: POST

https://btc-testnet.nownodes.io

Example body (raw)

{
    "jsonrpc": "1.0",
    "id": "curltest",
    "method": "setban",
    "params": [
        "192.168.0.6",
        "add",
        86400
    ]
}

Example response: 200

{
    "result": null,
    "error": null,
    "id": "curltest"
}

Last updated