I'm running on a private network at the moment, is there a way to remove a peer from your node without restarting Geth?
3 Answers
As per the documentation
Currently the console is lacking support for removing a peer, increasing peercount or adding a non-static peer but not to keep try reconnecting.
If you don't mind building Geth from source, there's currently an open PR to implement an admin.removePeer()
command, which would allow you to remove a node from the static* node array:
*It wouldn't allow you to remove nodes from the list of "bootstrap" nodes.
At this time, Geth 1.8.1-stable, is able to do it from the console, with the following command (already mentioned by Richard Horrocks):
admin.removePeer('<peer_id>')
Also, it is still not documented, but you can use it, without worries.