Skip to content

Commit

Permalink
geth init always
Browse files Browse the repository at this point in the history
  • Loading branch information
ericlee42 authored Aug 16, 2022
1 parent 62f565f commit e15e0a8
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions geth.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -eou

RETRIES=${RETRIES:-40}
VERBOSITY=${VERBOSITY:-6}
VERBOSITY=${VERBOSITY:-3}

if [ -z "$DATADIR" ]; then
echo "Must pass DATADIR"
Expand All @@ -29,15 +29,14 @@ fi
# If it exists, assume it's correct and skip geth init step
GETH_CHAINDATA_DIR=$DATADIR/geth/chaindata

if [ -d "$GETH_CHAINDATA_DIR" ]; then
echo "$GETH_CHAINDATA_DIR existing, skipping geth init"
else
echo "$GETH_CHAINDATA_DIR missing, running geth init"
echo "Retrieving genesis file $L2GETH_GENESIS_URL"
TEMP_DIR=$(mktemp -d)
wget -O "$TEMP_DIR"/genesis.json "$L2GETH_GENESIS_URL"
geth init --datadir=/"$DATADIR" "$TEMP_DIR"/genesis.json
fi
echo "$GETH_CHAINDATA_DIR missing, running geth init"
echo "Retrieving genesis file $L2GETH_GENESIS_URL"
TEMP_DIR=$(mktemp -d)
wget -O "$TEMP_DIR"/genesis.json "$L2GETH_GENESIS_URL"
geth init --datadir=/"$DATADIR" "$TEMP_DIR"/genesis.json

# Delete temp dir
rm -rf $TEMP_DIR

# Check for an existing keystore folder.
# If it exists, assume it's correct and skip geth acount import step
Expand Down

0 comments on commit e15e0a8

Please sign in to comment.