Skip to content

Instantly share code, notes, and snippets.

@thanhson1085
Forked from etienne-napoleone/remove-faulty-peer.sh
Last active January 17, 2019 09:49
Show Gist options
  • Save thanhson1085/99bbdbc24e5a77b0d40fd6aee47a7d8e to your computer and use it in GitHub Desktop.
Save thanhson1085/99bbdbc24e5a77b0d40fd6aee47a7d8e to your computer and use it in GitHub Desktop.
Remove faulty peer
#!/bin/sh
# get tomochain container id
container_id=$(docker ps -q -f "name=tomochain")
# remove first peer
echo "\n------------------------\n!! Removing all peers\n------------------------\n"
docker exec -t $container_id tomo attach data/tomo.ipc --exec "for (i = 0; i < admin.peers.length; i++) { admin.removePeer(admin.peers[i].id) }"
# restart node
echo "\n------------------------\n!! Restarting node\n------------------------\n"
tmn update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment