-
-
Save etienne-napoleone/1b887a4eb188af3f5709e3b6cd70fdbc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # get tomochain container id | |
| container_id=$(docker ps -q -f "name=tomochain") | |
| # remove all peers | |
| 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) }" | |
| # add TomoChain peers | |
| docker exec -t $container_id tomo attach data/tomo.ipc --exec "admin.addPeer('enode://df6a2423d01af3bf706a54417747553d02532d982eb5c612ef92d9e70e6b9eafe21afcfc27c7cd477e4fe2dcc0b46b73c977010811ede1c1dfca0944b8f310f6@35.202.169.170:30303')" | |
| docker exec -t $container_id tomo attach data/tomo.ipc --exec "admin.addPeer('enode://c77e3b75a831b08eeac4ccdcc8b9085e357794b97e27eeee840c787b39d22b89d394e6796c6ff701cb14625a4c82c14e31f2162d2c6b9b000b6fd91c6f2b89dd@188.166.207.189:30303')" | |
| docker exec -t $container_id tomo attach data/tomo.ipc --exec "admin.addPeer('enode://64bda1653bf6da87984c2b2bebcaa6811097a1ff87c15b3b421108ce82ed3dd8ed9e0be7c388a44c131b6b4934d2413c301f214e794d2d12b724d158878ba65f@104.248.98.59:30303')" | |
| # restart node | |
| echo "\n------------------------\n!! Restarting node\n------------------------\n" | |
| docker-compose stop; docker-compose start |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can run it with
bash <(curl -s https://gist.githubusercontent.com/etienne-napoleone/1b887a4eb188af3f5709e3b6cd70fdbc/raw/342e284f83e94678b3cd0d6d1716042149807a9b/add-tomochain-peers.sh)