debug migration

This commit is contained in:
rootzoll
2020-07-26 03:00:21 +02:00
parent b1e916634e
commit 284a035a52
3 changed files with 18 additions and 15 deletions

View File

@@ -84,24 +84,12 @@ if [ ${bitcoinActive} -eq 0 ] || [ ${#bitcoinErrorFull} -gt 0 ] || [ "${1}" == "
echo echo
fi fi
echo "POSSIBLE OPTIONS:"
# check if maybe problems with txindex # check if maybe problems with txindex
source <(/home/admin/config.scripts/network.txindex.sh status) source <(/home/admin/config.scripts/network.txindex.sh status)
if [ "${txindex}" == "1" ]; then if [ "${txindex}" == "1" ]; then
if [ "${indexFinished}" == "0" ]; then echo "-> Use command 'repair' and then choose 'DELETE-INDEX' to try rebuilding transaction index."
# bitcoind is not starting while still building index - recommend turning off index and restart
whiptail --title "Problems with Bitcoin Index" --yes-button "TurnOff TxIndex" --no-button "Do Nothing" --yesno "It looks like ${network}d has problems building the txindex. Turning Off the txindex and restart is recommended." 10 60
if [ $? -eq 0 ]; then
# delete txindex, turn off and deactivate apps needed index
sudo /home/admin/config.scripts/network.txindex.sh delete
whiptail --msgbox "OK txindex was turned off.\n\nTo be able to build a valid txindex in the future you might need to reset/redownload the blockchain." 10 56 "" --title " TXINDEX OFF "
/home/admin/XXshutdown.sh reboot
fi
else
# bitcoind is not starting but index was build in the past - recommend repair with turning off index
echo "-> Use command 'repair' and then choose 'DELETE-INDEX' to try rebuilding transaction index."
fi
fi fi
echo "-> Use command 'repair' and then choose 'RESET-CHAIN' to try downloading new blockchain." echo "-> Use command 'repair' and then choose 'RESET-CHAIN' to try downloading new blockchain."
echo "-> Use command 'debug' for more log output you can use for getting support." echo "-> Use command 'debug' for more log output you can use for getting support."
echo "-> Use command 'menu' to open main menu." echo "-> Use command 'menu' to open main menu."

View File

@@ -151,6 +151,8 @@ if [ "$1" = "export-gui" ]; then
echo "To complete the data migration follow then instructions on the github FAQ." echo "To complete the data migration follow then instructions on the github FAQ."
echo echo
read key read key
echo "Shutting down ...."
sleep 4
/home/admin/XXshutdown.sh /home/admin/XXshutdown.sh
exit 0 exit 0
fi fi
@@ -257,7 +259,7 @@ if [ "$1" = "import-gui" ]; then
# make sure HDD/SSD is not mounted # make sure HDD/SSD is not mounted
# because importing migration just works during early setup # because importing migration just works during early setup
if [ ${isMounted} -eq 1 ]; then if [ ${isMounted} -eq 1 ]; then
echo "FAIL --> cannot import migration data when HDD(SDD is mounted" echo "FAIL --> cannot import migration data when HDD/SSD is mounted"
exit 1 exit 1
fi fi
@@ -273,10 +275,18 @@ if [ "$1" = "import-gui" ]; then
exit 1 exit 1
fi fi
# ask format for new HDD/SSD # ask format for new HDD/SSD
OPTIONS=(EXT4 "Ext4 & 1 Partition (default)" \ OPTIONS=(EXT4 "Ext4 & 1 Partition (default)" \
BTRFS "BTRFS & 3 Partitions (experimental)" BTRFS "BTRFS & 3 Partitions (experimental)"
) )
# check if HDD/SSD contains Bitcoin Blockchain
if [ "${hddBlocksBitcoin}" == "1" ]; then
OPTIONS+=(CLEAN "Just clean HDD & use Blockchain")
fi
CHOICE=$(whiptail --clear --title "Formatting ${hddCandidate}" --menu "" 9 52 2 "${OPTIONS[@]}" 2>&1 >/dev/tty) CHOICE=$(whiptail --clear --title "Formatting ${hddCandidate}" --menu "" 9 52 2 "${OPTIONS[@]}" 2>&1 >/dev/tty)
clear clear
case $CHOICE in case $CHOICE in
@@ -296,6 +306,10 @@ if [ "$1" = "import-gui" ]; then
exit 1 exit 1
fi fi
;; ;;
CLEAN)
echo "CLEAN HDD & Keep Blockchain"
sudo /home/admin/XXcleanHDD.sh
;;
*) *)
echo "CANCEL" echo "CANCEL"
exit 0 exit 0

View File

@@ -102,6 +102,7 @@ if [ "$1" = "delete" ]; then
sudo sed -i "s/^txindex=.*/txindex=0/g" /mnt/hdd/${network}/${network}.conf sudo sed -i "s/^txindex=.*/txindex=0/g" /mnt/hdd/${network}/${network}.conf
echo "# deleting tx index ..." echo "# deleting tx index ..."
sudo rm -r /mnt/hdd/${network}/indexes/txindex sudo rm -r /mnt/hdd/${network}/indexes/txindex
echo "# restarting bitcoind ..."
sudo systemctl restart ${network}d sudo systemctl restart ${network}d
exit 0 exit 0
fi fi