Skip to content

Instantly share code, notes, and snippets.

@jchung00
Forked from michaeljyeates/eos-vanity.sh
Created June 7, 2018 16:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jchung00/4118183ee2359abeec881d7631e39870 to your computer and use it in GitHub Desktop.
Save jchung00/4118183ee2359abeec881d7631e39870 to your computer and use it in GitHub Desktop.
#!/bin/bash
if [[ $1 == "" ]]; then
echo "Search for vanity keys - Usage : ./vanity.sh STRING"
exit 1
fi
echo "Finding keys containing : $1"
STRING=$(echo "$1" | tr '[:upper:]' '[:lower:]')
while true; do
output=$(cleos create key)
pub=$(cut -d ' ' -f 5 <<< "${output//[$'\r\n']}")
pub=$(echo "$pub" | tr '[:upper:]' '[:lower:]')
if [[ $pub =~ .*$STRING.* ]]; then
echo $output
break
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment