Created
June 28, 2018 00:29
-
-
Save mslinn/1ad98ed5440b8adaa8389f3c8f56bda5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| GNAME=gowalkthrough | |
| GACCT="$HOME/.$GNAME" | |
| GPASS="$HOME/gethpassword" | |
| JSON="$HOME/$GNAME.json" | |
| rm -rf "$JSON" "$GACCT" | |
| touch "$GPASS" # empty password | |
| geth --password "$GPASS" --datadir "$GACCT" account new | |
| export ACCOUNT=$( \ | |
| cat "$GACCT"/keystore/* | \ | |
| python -c "import sys, json; print json.load(sys.stdin)['address']" \ | |
| ) | |
| echo "{ | |
| \"config\": { | |
| \"chainId\": 555, | |
| \"homesteadBlock\": 0, | |
| \"eip155Block\": 0, | |
| \"eip158Block\": 0 | |
| }, | |
| \"difficulty\": \"20\", | |
| \"gasLimit\": \"2100000\", | |
| \"alloc\": { | |
| \"$ACCOUNT\": | |
| { \"balance\": \"42000000000000000000\" } | |
| } | |
| }" > "$JSON" | |
| geth --datadir "$GACCT" init "$JSON" | |
| SYNCMODE=light | |
| SYNCMODE=full | |
| geth --syncmode "$SYNCMODE" \ | |
| --cache 64 --maxpeers 12 \ | |
| --rpcapi --wsapi \ | |
| --datadir "$GACCT" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment