Skip to content

Instantly share code, notes, and snippets.

@assafmo
Last active September 23, 2020 21:29
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save assafmo/a39fdb535f74ce2d6493a1a3f695e4ca to your computer and use it in GitHub Desktop.
Save assafmo/a39fdb535f74ce2d6493a1a3f695e4ca to your computer and use it in GitHub Desktop.
Export a list of peers from your Enigma blockchain node
#!/bin/bash
curl -s http://bootstrap.mainnet.enigma.co:26657/net_info |
jq -cr '.result.peers[] | [.node_info.id,.remote_ip,.node_info.listen_addr] | @csv' |
tr -d \" |
tr , @ |
perl -pe 's#\@tcp://.+?:#:#g' |
sort > /tmp/peers.txt
echo "# Generated at $(date -u --rfc-3339=seconds) by https://gist.github.com/assafmo/a39fdb535f74ce2d6493a1a3f695e4ca" > /home/ubuntu/peers/peers.txt
cat /tmp/peers.txt >> /home/ubuntu/peers/peers.txt
@assafmo
Copy link
Author

assafmo commented Mar 11, 2020

The sort is for my OCD...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment