Add --no-snapshot to disable booting a validator from a snapshot (#5050)

automerge
This commit is contained in:
Michael Vines 2019-07-11 21:03:17 -07:00 committed by Grimes
parent ebcdc06dc3
commit 9f58318fc5
1 changed files with 21 additions and 15 deletions

View File

@ -168,6 +168,7 @@ identity_keypair_path=
no_restart=0
airdrops_enabled=1
generate_snapshots=0
boot_from_snapshot=1
positional_args=()
while [[ -n $1 ]]; do
@ -185,6 +186,9 @@ while [[ -n $1 ]]; do
elif [[ $1 = --generate-snapshots ]]; then
generate_snapshots=1
shift
elif [[ $1 = --no-snapshot ]]; then
boot_from_snapshot=0
shift
elif [[ $1 = --replicator ]]; then
node_type=replicator
shift
@ -422,22 +426,24 @@ EOF
done
echo "Fetched genesis ledger in $SECONDS seconds"
SECONDS=
echo "Rsyncing state snapshot ${rsync_entrypoint_url:?}..."
if ! $rsync -P "${rsync_entrypoint_url:?}"/config/state.tgz .; then
echo "State snapshot rsync failed"
rm -f "$SOLANA_RSYNC_CONFIG_DIR"/state.tgz
exit
fi
echo "Fetched snapshot in $SECONDS seconds"
if ((boot_from_snapshot)); then
SECONDS=
echo "Rsyncing state snapshot ${rsync_entrypoint_url:?}..."
if ! $rsync -P "${rsync_entrypoint_url:?}"/config/state.tgz .; then
echo "State snapshot rsync failed"
rm -f "$SOLANA_RSYNC_CONFIG_DIR"/state.tgz
exit
fi
echo "Fetched snapshot in $SECONDS seconds"
SECONDS=
mkdir -p "$state_dir"
(
set -x
tar -C "$state_dir" -zxf "$SOLANA_RSYNC_CONFIG_DIR"/state.tgz
)
echo "Extracted snapshot in $SECONDS seconds"
SECONDS=
mkdir -p "$state_dir"
(
set -x
tar -C "$state_dir" -zxf "$SOLANA_RSYNC_CONFIG_DIR"/state.tgz
)
echo "Extracted snapshot in $SECONDS seconds"
fi
)
fi