Skip to content

Instantly share code, notes, and snippets.

@assafmo
assafmo / export_peers.sh
Last active September 23, 2020 21:29
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