Skip to content

Instantly share code, notes, and snippets.

@dbriggsie
Forked from assafmo/export_peers.sh
Created June 17, 2020 18:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dbriggsie/bb6798da522a5634a52faf3b9fa91b66 to your computer and use it in GitHub Desktop.
Save dbriggsie/bb6798da522a5634a52faf3b9fa91b66 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment