init base chain from snapshot

This commit is contained in:
Sebastian
2023-10-22 08:05:27 +02:00
parent 4808637b2e
commit 78c5ec9bea

View File

@@ -14,25 +14,25 @@ HOST_IP="0.0.0.0"
P2P_PORT="${P2P_PORT:-30303}" P2P_PORT="${P2P_PORT:-30303}"
ADDITIONAL_ARGS="" ADDITIONAL_ARGS=""
mkdir -p $GETH_DATA_DIR #mkdir -p $GETH_DATA_DIR
if [ ! -d "$GETH_CHAINDATA_DIR" ]; then #if [ ! -d "$GETH_CHAINDATA_DIR" ]; then
echo "$GETH_CHAINDATA_DIR missing, running init" # echo "$GETH_CHAINDATA_DIR missing, running init"
echo "Initializing genesis." # echo "Initializing genesis."
./geth --verbosity="$VERBOSITY" init \ # ./geth --verbosity="$VERBOSITY" init \
--datadir="$GETH_DATA_DIR" \ # --datadir="$GETH_DATA_DIR" \
"$OP_GETH_GENESIS_FILE_PATH" # "$OP_GETH_GENESIS_FILE_PATH"
else #else
echo "$GETH_CHAINDATA_DIR exists." # echo "$GETH_CHAINDATA_DIR exists."
fi #fi
#wget https://base-mainnet-archive-snapshots.s3.us-east-1.amazonaws.com/$(curl https://base-mainnet-archive-snapshots.s3.us-east-1.amazonaws.com/latest) #wget https://base-mainnet-archive-snapshots.s3.us-east-1.amazonaws.com/$(curl https://base-mainnet-archive-snapshots.s3.us-east-1.amazonaws.com/latest)
if [ ! -f "${GETH_DATA_DIR}/bootstrapped" ]; if [ ! -f "${GETH_DATA_DIR}/bootstrapped" ];
then then
echo "downloading snapshot" echo "downloading snapshot"
rm -rf $GETH_CHAINDATA_DIR/* rm -rf $GETH_DATA_DIR/geth
wget --tries=0 -O - "https://base-mainnet-archive-snapshots.s3.us-east-1.amazonaws.com/$(curl https://base-mainnet-archive-snapshots.s3.us-east-1.amazonaws.com/latest)" | tar -xz -C ${GETH_CHAINDATA_DIR} && touch ${GETH_DATA_DIR}/bootstrapped wget --tries=0 -O - "https://base-mainnet-archive-snapshots.s3.us-east-1.amazonaws.com/$(curl https://base-mainnet-archive-snapshots.s3.us-east-1.amazonaws.com/latest)" | tar -xz --strip-components=1 -C ${GETH_DATA_DIR} && touch ${GETH_DATA_DIR}/bootstrapped
fi fi
echo "$OP_NODE_L2_ENGINE_AUTH_RAW" > "$OP_NODE_L2_ENGINE_AUTH" echo "$OP_NODE_L2_ENGINE_AUTH_RAW" > "$OP_NODE_L2_ENGINE_AUTH"