disconnectnode

network dangerous since 0.12.0

immediately disconnects from the specified peer node.

Share: X Bluesky Mastodon Reddit HN
↑ shares the docs page. Use Share this query below for a link with your current arg values.
Not executable from the web. Would harm the node, the network, or expose secrets. Documentation only, never executable from the web.
Call from your own code

Replace $BITCOIN_RPC_USER / $BITCOIN_RPC_PASSWORD with credentials from your bitcoind's bitcoin.conf, and replace localhost:8332 with your node's RPC address. You can't run this RPC against our node, but you can run it against your own bitcoind.

Help

disconnectnode ( "address" nodeid )

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.

Arguments:
1. address    (string, optional, default=fallback to nodeid) The IP address/port of the node
2. nodeid     (numeric, optional, default=fallback to address) The node ID (see getpeerinfo for node IDs)

Result:
null    (json null)

Examples:
> bitcoin-cli disconnectnode "192.168.0.6:8333"
> bitcoin-cli disconnectnode "" 1
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "disconnectnode", "params": ["192.168.0.6:8333"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "disconnectnode", "params": ["", 1]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
← back to all RPCs