Skip to content

Instantly share code, notes, and snippets.

@CowboyJim
Created May 18, 2017 13:13
Show Gist options
  • Save CowboyJim/a3ac63d83f8f83cc396babce3231b114 to your computer and use it in GitHub Desktop.
Save CowboyJim/a3ac63d83f8f83cc396babce3231b114 to your computer and use it in GitHub Desktop.
Script to retrieve enode values
#!/bin/bash
out_file="static-nodes.json"
echo "[" > $out_file
for (( x=1; x<=4; x++ ))
do
cmd=`geth --exec 'admin.nodeInfo.enode' attach http://localhost:810$x`
echo $cmd>>$out_file
if [ $x -lt 4 ]; then
echo ",">>$out_file
fi
done
echo "]" >> $out_file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment