Skip to content

Commit 5f906c9

Browse files
authored
add choose donwload snapshot (#178)
1 parent 80b56e2 commit 5f906c9

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

scripts/setup_fullnode.sh

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -419,14 +419,25 @@ function main() {
419419
pushd ${IOTEX_HOME}
420420
mkdir data log etc > /dev/null 2>&1
421421
popd
422+
fi
423+
424+
wantdownload=Y
425+
read -p "Do you prefer to start from a snapshot, This will overwrite existing data. Download the db file. [Y/N] (Default: Y)? " wantdownload
426+
if [ "$_PLUGINS_"X = "gateway"X ];then
422427

423-
wantdownload=N
424-
read -p "Do you prefer to start from a snapshot, Download the db file. [Y/N] (Default: N)? " wantdownload
425-
if [ "${wantdownload}X" = "YX" ] || [ "${wantdownload}X" = "yX" ];then
426-
# Download db file
427-
donwloadBlockDataFile
428+
if [[ "$runversion" == "v1.1"* && "$version" == "v1.2"* ]] && ([ "$wantdownload"X = "N"X ] || [ "$wantdownload"X = "n"X ]);then
429+
read -p "Confirm that the current bloomfilter.index.db file will be deleted to be forward-compatible." dbf
430+
pushd ${IOTEX_HOME}
431+
rm -f data/bloomfilter.index.db || echo 'Not exist bloomfilter.index.db.'
432+
popd
428433
fi
429434
fi
435+
436+
if [ "${wantdownload}X" = "YX" ] || [ "${wantdownload}X" = "yX" ];then
437+
# Download db file
438+
donwloadBlockDataFile
439+
fi
440+
430441

431442
echo -e "Confirm your externalHost: ${YELLOW} $ip ${NC}"
432443
echo -e "Confirm your producerPrivKey: ${RED} $privKey ${NC}"

0 commit comments

Comments
 (0)