Skip to content

Instantly share code, notes, and snippets.

@mslinn
Created June 28, 2018 00:29
Show Gist options
  • Select an option

  • Save mslinn/1ad98ed5440b8adaa8389f3c8f56bda5 to your computer and use it in GitHub Desktop.

Select an option

Save mslinn/1ad98ed5440b8adaa8389f3c8f56bda5 to your computer and use it in GitHub Desktop.
#!/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