From 82090daecf774ba3f9be1a4492abbd4a6b7ecdab Mon Sep 17 00:00:00 2001 From: rootzoll Date: Tue, 22 Jan 2019 02:08:21 +0100 Subject: [PATCH 01/39] added missing local ip --- home.admin/00settingsMenuServices.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/home.admin/00settingsMenuServices.sh b/home.admin/00settingsMenuServices.sh index 6a87c51..8d24f30 100644 --- a/home.admin/00settingsMenuServices.sh +++ b/home.admin/00settingsMenuServices.sh @@ -165,6 +165,7 @@ if [ "${rtlWebinterface}" != "${choice}" ]; then echo "RTL Webinterface Setting changed .." sudo /home/admin/config.scripts/bonus.rtl.sh ${choice} if [ "${choice}" = "on" ]; then + localip=$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/') l1="RTL web servcie will be ready AFTER NEXT REBOOT:" l2="Try to open the following URL in your local webrowser" l3="and login with your PASSWORD B." From 2e237719ed0734c57c82adbe2bf2a6ae66058a1b Mon Sep 17 00:00:00 2001 From: rootzoll Date: Tue, 22 Jan 2019 23:26:04 +0100 Subject: [PATCH 02/39] copy sync blockchain from other client support --- FAQ.md | 13 ++- home.admin/10setupBlitz.sh | 7 +- home.admin/50copyHDD.sh | 168 +++++++++++++++++++------------------ home.admin/XXcleanHDD.sh | 86 ++++++++++++------- 4 files changed, 158 insertions(+), 116 deletions(-) diff --git a/FAQ.md b/FAQ.md index 66dbd45..0bdd427 100644 --- a/FAQ.md +++ b/FAQ.md @@ -32,6 +32,18 @@ Of course people should modify the system, add own scripts, etc ... but if you w BTW there is a beneficial side effect, when updating with a new SD card: You also get rid of any maleware or system bloat that happend in the past. You start with a fresh system :) +## I have the full blockchain on another computer. How do I copy it to the RaspiBlitz? + +Copying a already synced blockchain from another computer (for example your Laptop) can be a quick way to get the RaspiBlitz started. Also that way you synced and verified the blockchain yourself and not trusting the RaspiBlitz FTP/Torrent downloads (dont trust, verify). + +One requirement is that the blockchain is from another bitcoin-core client with version greater or equal to 0.17.1 with transaction index switched on (`txindex=1` in the `bitcoin.conf`). + +But we dont copy the data via USB to the device, because the HDD needs to be formatted in EXT4 and that is usually not read/writeable by Windows or Mac computers. So I will explain a way to copy the data thru your local network. This should work from Windows, Mac, Linux and even from another already synced RaspiBlitz. + +Both computers (your RaspberryPi and the other computer with the full blockchain on) need to be connected to the same local network. Start the setup of the RaspiBlitz with a fresh SD card like explained in the README - its OK that there is no blockchain data on your HDD. At the point of the Setup about `Getting the Blockchain` choose the COPY option. Starting from version 1.0 of the RaspiBlitz this will give you further detailed instructions how to transfere the blockchain data onto your RaspiBlitz. In short: On your computer with the blockchain data you will execute SCP commands, that will copy the data over to your RaspiBlitz. + +Once you finsihed the transfere the Raspiblitz will make a quick check - but beware that if there is an error during transfere it can result that yo + ## How to backup my Lightning Node? CAUTION: Restoring a backup can lead to LOSS OF ALL CHANNEL FUNDS if its not the latest channel state. There is no perfect backup solution for lightning nodes yet - this topic is in development by the community. @@ -44,7 +56,6 @@ To really have a good backup to rely on such feature needs to be part of the LND But you can try to backup at your own risk. All your Lightning Node data is within the `/mnt/hdd/lnd` directory. Just run a backup of that data when the lnd service is stopped. - ## How do I change the Name/Alias of my lightning node Use the "Change Name/Alias of Node" option in main menu. The RaspiBlitz will make a reboot after this. diff --git a/home.admin/10setupBlitz.sh b/home.admin/10setupBlitz.sh index e55e07c..de651cc 100755 --- a/home.admin/10setupBlitz.sh +++ b/home.admin/10setupBlitz.sh @@ -161,9 +161,9 @@ if [ ${mountOK} -eq 1 ]; then echo "Bitcoin Options" menuitem=$(dialog --clear --beep --backtitle "RaspiBlitz" --title "Getting the Blockchain" \ --menu "You need a copy of the Bitcoin Blockchain - you have 3 options:" 13 75 4 \ - T "TORRENT --> TESTNET + MAINNET thru Torrent (DEFAULT)" \ - D "DOWNLOAD --> TESTNET + MAINNET per FTP (FALLBACK)" \ - C "COPY --> TESTNET + MAINNET from another HDD (TRICKY+FAST)" \ + T "TORRENT --> MAINNET + TESTNET thru Torrent (DEFAULT)" \ + D "DOWNLOAD --> MAINNET + TESTNET per FTP (FALLBACK)" \ + C "COPY --> USE BLOCKCHAINDATA from another computer" \ S "SYNC --> JUST TESTNET thru Bitoin Network (FALLBACK+SLOW)" 2>&1 >/dev/tty) # Litecoin @@ -173,7 +173,6 @@ if [ ${mountOK} -eq 1 ]; then --menu "You need a copy of the Litecoin Blockchain - you have 3 options:" 13 75 4 \ T "TORRENT --> MAINNET thru Torrent (DEFAULT)" \ D "DOWNLOAD --> MAINNET per FTP (FALLBACK)" \ - C "COPY --> MAINNET from another HDD (TRICKY+FAST)" \ S "SYNC --> MAINNET thru Litecoin Network (FALLBACK+SLOW)" 2>&1 >/dev/tty) # error diff --git a/home.admin/50copyHDD.sh b/home.admin/50copyHDD.sh index 69c9a8c..4e683b9 100755 --- a/home.admin/50copyHDD.sh +++ b/home.admin/50copyHDD.sh @@ -3,98 +3,100 @@ ## get basic info source /home/admin/raspiblitz.info 2>/dev/null +# get local ip +localip=$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/') + +# create bitcoin base directory and link with bitcoin user +sudo mkdir /mnt/hdd/bitcoin +sudo chown bitcoin:bitcoin /mnt/hdd/bitcoin +sudo ln -s /mnt/hdd/bitcoin /home/bitcoin/.bitcoin + echo "" -echo "*** Check 1st HDD ***" -sleep 4 -hddA=$(lsblk | grep /mnt/hdd | grep -c sda1) -if [ ${hddA} -eq 0 ]; then - echo "FAIL - 1st HDD not found as sda1" - echo "Try 'sudo shutdown -r now'" - exit 1 -fi -echo "OK - HDD as sda1 found" -echo "" -echo "*** Copy Blockchain form a second HDD ***" +echo "*** Instructions to COPY BLOCKCHAIN from another computer (only MAINNET) ***" echo "" -echo "WARNING: The RaspiBlitz cannot run 2 HDDs without extra Power!" +echo "You can use the blockchain from another bitcoin-core client with version greater or equal" +echo "to 0.17.1 with transaction index switched on (`txindex=1` in the `bitcoin.conf`)." echo "" -echo "You can use a Y cable for the second HDD to inject extra power." -echo "Like this one: https://www.amazon.de/dp/B00ZJBIHVY" -echo "If you see on LCD a error on connecting the 2nd HDD do a restart." +echo "Both computers (your RaspberryPi and the other computer with the full blockchain on) need" +echo "to be connected to the same local network." echo "" -echo "You can use the HDD of another RaspiBlitz for this." -echo "The 2nd HDD needs to be formated Ext4/exFAT and the folder '${network}' is in root of HDD." +echo "Open a terminal on the other computer and change into the directory that constains the" +echo "blockchain data. You should see directories 'blocks', 'chainstate' & 'indexes'". +echo "Make sure the bitcoin client on that computer is stopped." echo "" -echo "**********************************" -echo "--> Please connect now the 2nd HDD" -echo "**********************************" +echo "Copy, Paste and Execute the following commands - line by line:" +echo "scp -R ./blocks bitcoin@${localip}:/home/bitcoin/.bitcoin/blocks" +echo "scp -R ./chainstate bitcoin@${localip}:/home/bitcoin/.bitcoin/chainstate" +echo "scp -R ./indexes bitcoin@${localip}:/home/bitcoin/.bitcoin/indexes" echo "" -echo "If 2nd HDD is connected but setup does not continue," -echo "then cancel (CTRL+c) and reboot." -ready=0 -while [ ${ready} -eq 0 ] - do - hddA=$(lsblk | grep /mnt/hdd | grep -c sda1) - if [ ${hddA} -eq 0 ]; then - echo "FAIL - connection to 1st HDD lost" - echo "It seems there was a POWEROUTAGE while connecting the 2nd HDD." - echo "Try to avoid this next time by adding extra Power or connect more securely." - echo "You need now to reboot with 'sudo shutdown -r now' and then try again." - exit 1 - fi - hddB=$(lsblk | grep -c sdb1) - if [ ${hddB} -eq 1 ]; then - echo "OK - 2nd HDD found" - ready=1 - fi - done +echo "Every command above needs your SSH PASSWORD A to work and will take some time to transfer." +echo "PRESS ENTER if all 3 transfers are done or if you dont care and you want to return to menu." +read key -echo "" -echo "*** Mounting 2nd HDD ***" -sudo mkdir /mnt/genesis -echo "try ext4 .." -sudo mount -t ext4 /dev/sdb1 /mnt/genesis -sleep 2 -mountOK=$(lsblk | grep -c /mnt/genesis) -if [ ${mountOK} -eq 0 ]; then - echo "try exfat .." - sudo mount -t exfat /dev/sdb1 /mnt/genesis - sleep 2 +# unlink bitcoin user (will created later in setup again) +sudo unlink /home/bitcoin/.bitcoin + +# make quick check if data is there +anyDataAtAll=0 +quickCheckOK=1 +count=$(sudo ls /mnt/hdd/bitcoin/blocks | grep -c '.dat') +if [ ${count} -gt 0 ]; then + echo "Found data in /mnt/hdd/bitcoin/blocks" + anyDataAtAll=1 +if +if [ ${count} -lt 3000 ]; then + echo "FAIL: transfere seems invalid - less then 3000 .dat files (${count})" + quickCheckOK=0 fi -mountOK=$(lsblk | grep -c /mnt/genesis) -if [ ${mountOK} -eq 0 ]; then - echo "FAIL - not able to mount the 2nd HDD" - echo "only ext4 and exfat possible" - sleep 4 - ./10setupBlitz.sh - exit 1 -else - echo "OK - 2nd HDD mounted at /mnt/genesis" +count=$(sudo ls /mnt/hdd/bitcoin/chainstate | grep -c '.ldb') +if [ ${count} -gt 0 ]; then + echo "Found data in /mnt/hdd/bitcoin/chainstate" + anyDataAtAll=1 +fi +fi [ ${count} -lt 1400 ]; then + echo "FAIL: transfere seems invalid - less then 1400 .ldb files (${count})" + quickCheckOK=0 +fi +count=$(sudo ls /mnt/hdd/bitcoin/indexes/txindex | grep -c '.ldb') +if [ ${count} -gt 0 ]; then + echo "Found data in /mnt/hdd/bitcoin/indexes/txindex" + anyDataAtAll=1 +fi +if [ ${count} -lt 5200 ]; then + echo "FAIL: less then 5200 .ldb files (${count}) in /mnt/hdd/bitcoin/chainstate (transfere seems invalid)" + quickCheckOK=0 fi -echo "" -echo "*** Copy Blockchain ***" -sudo rsync --append --info=progress2 -a /mnt/genesis/bitcoin /mnt/hdd/ -echo "cleaning up - ok if files do not exists" -sudo rm /mnt/hdd/${network}/${network}.conf -sudo rm /mnt/hdd/${network}/${network}.pid -sudo rm /mnt/hdd/${network}/banlist.dat -sudo rm /mnt/hdd/${network}/debug.log -sudo rm /mnt/hdd/${network}/fee_estimates.dat -sudo rm /mnt/hdd/${network}/mempool.dat -sudo rm /mnt/hdd/${network}/peers.dat -sudo rm /mnt/hdd/${network}/testnet3/banlist.dat -sudo rm /mnt/hdd/${network}/testnet3/debug.log -sudo rm /mnt/hdd/${network}/testnet3/fee_estimates.dat -sudo rm /mnt/hdd/${network}/testnet3/mempool.dat -sudo rm /mnt/hdd/${network}/testnet3/peers.dat -sudo umount -l /mnt/genesis -echo "OK - Copy done :)" -echo "" -echo "---> You can now disconnect the 2nd HDD" +# just if any data transferred .. +if [ ${anyDataAtAll} -eq 1 ]; then + + # data was invalkid - ask user to keep? + if [ ${quickCheckOK} -eq 0 ]; then + echo "*********************************************" + echo "There seems to be a invalid transfere." + echo "Wait 5 secs ..." + sleep 5 + dialog --title " INVALID TRANSFER" --yesno "Quickcheck shows the data you transferred is invalid/incomplete.\nThis can lead further RaspiBlitz setup to get stuck in error state.\nDo you want to reset/delete data data?" 8 57 + response=$? + echo "response(${response})" + case $response in + 0) quickCheckOK=1 ;; + esac + fi -# set SetupState -sudo sed -i "s/^setupStep=.*/setupStep=50/g" /home/admin/raspiblitz.info + if [ ${quickCheckOK} -eq 0 ]; then + echo "Deleting invalid Data ..." + sudo rm -rf /mnt/hdd/bitcoin + sudo rm -rf /home/bitcoin/.bitcoin + sleep 2 + fi + +else + + # when no data transferred - just delete bitcoin base dir again + sudo rm -rf /mnt/hdd/bitcoin + +fi -sleep 5 -./60finishHDD.sh +# setup script will decide the next logical step +./10setupBlitz.sh \ No newline at end of file diff --git a/home.admin/XXcleanHDD.sh b/home.admin/XXcleanHDD.sh index 50d7098..bb54383 100755 --- a/home.admin/XXcleanHDD.sh +++ b/home.admin/XXcleanHDD.sh @@ -1,30 +1,60 @@ +#!/bin/bash echo "" -echo "!!!! This will DELETE your data & POSSIBLE FUNDS from the HDD !!!!" -echo "Press ENTER to really continue - CTRL+c to CANCEL (last chance)" -read key -sudo dphys-swapfile swapoff -sudo systemctl stop bitcoind.service 2>/dev/null -sudo systemctl stop litecoind.service 2>/dev/null -sudo systemctl stop lnd.service 2>/dev/null -sudo rm -f -r /mnt/hdd/lnd -sudo rm -f -r /mnt/hdd/ssh -sudo rm -f /mnt/hdd/swapfile -sudo rm -f /mnt/hdd/bitcoin/bitcoin.conf -sudo rm -f /mnt/hdd/bitcoin/bitcoin.pid -sudo rm -f /mnt/hdd/bitcoin/*.dat -sudo rm -f /mnt/hdd/bitcoin/*.log -sudo rm -f /mnt/hdd/bitcoin/*.pid -sudo rm -f /mnt/hdd/bitcoin/testnet3/*.dat -sudo rm -f /mnt/hdd/bitcoin/testnet3/*.log -sudo rm -f /mnt/hdd/bitcoin/testnet3/.lock -sudo rm -f /mnt/hdd/litecoin/litecoin.conf -sudo rm -f /mnt/hdd/litecoin/litecoin.pid -sudo rm -f /mnt/hdd/litecoin/*.dat -sudo rm -f /mnt/hdd/litecoin/*.log -sudo rm -f /mnt/hdd/litecoin/*.pid -sudo rm -f -r /mnt/hdd/lost+found -sudo rm -f -r /mnt/hdd/download -sudo rm -f -r /mnt/hdd/tor -sudo rm -f /mnt/hdd/raspiblitz.conf -sudo rm -f /home/admin/raspiblitz.info +extraParameter="$1" +if [ "${extraParameter}" = "-all" ]; then + + echo "!!!! This will DELETE ALL DATA & POSSIBLE FUNDS from the HDD !!!!" + echo "Press ENTER to really continue - CTRL+c to CANCEL (last chance)" + read key + + sudo dphys-swapfile swapoff + sudo systemctl stop bitcoind.service 2>/dev/null + sudo systemctl stop litecoind.service 2>/dev/null + sudo systemctl stop lnd.service 2>/dev/null + + # delete plain all on HDD + sudo cd /mnt/hdd + rm -R -- */ + cd + +else + + echo "!!!! This will DELETE your personal data & POSSIBLE FUNDS from the HDD !!!!" + echo "--> It will keep Blockchain data - sou you dont have to download/copy again." + echo "--> If you want to delete also blockchain data, please run with '-all' parameter." + echo "Press ENTER to really continue - CTRL+c to CANCEL (last chance)" + read key + + sudo dphys-swapfile swapoff + sudo systemctl stop bitcoind.service 2>/dev/null + sudo systemctl stop litecoind.service 2>/dev/null + sudo systemctl stop lnd.service 2>/dev/null + + # just delete selective + sudo rm -f -r /mnt/hdd/lnd + sudo rm -f -r /mnt/hdd/ssh + sudo rm -f /mnt/hdd/swapfile + sudo rm -f /mnt/hdd/bitcoin/bitcoin.conf + sudo rm -f /mnt/hdd/bitcoin/bitcoin.pid + sudo rm -f /mnt/hdd/bitcoin/*.dat + sudo rm -f /mnt/hdd/bitcoin/*.log + sudo rm -f /mnt/hdd/bitcoin/*.pid + sudo rm -f /mnt/hdd/bitcoin/testnet3/*.dat + sudo rm -f /mnt/hdd/bitcoin/testnet3/*.log + sudo rm -f /mnt/hdd/bitcoin/testnet3/.lock + sudo rm -f /mnt/hdd/litecoin/litecoin.conf + sudo rm -f /mnt/hdd/litecoin/litecoin.pid + sudo rm -f /mnt/hdd/litecoin/*.dat + sudo rm -f /mnt/hdd/litecoin/*.log + sudo rm -f /mnt/hdd/litecoin/*.pid + sudo rm -f -r /mnt/hdd/lost+found + sudo rm -f -r /mnt/hdd/download + sudo rm -f -r /mnt/hdd/tor + sudo rm -f /mnt/hdd/raspiblitz.conf + sudo rm -f /home/admin/raspiblitz.info + +fi + echo "OK - the HDD is now clean" +echo "reboot -> sudo shutdown -r now" +echo "power off -> sudo shutdown now" From b8e1ffc272c51b67966c3693a6c11a8d9fee1910 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Tue, 22 Jan 2019 23:51:59 +0100 Subject: [PATCH 03/39] FAQ on why is takin Final Sync so long? --- FAQ.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/FAQ.md b/FAQ.md index 0bdd427..06e1490 100644 --- a/FAQ.md +++ b/FAQ.md @@ -40,9 +40,17 @@ One requirement is that the blockchain is from another bitcoin-core client with But we dont copy the data via USB to the device, because the HDD needs to be formatted in EXT4 and that is usually not read/writeable by Windows or Mac computers. So I will explain a way to copy the data thru your local network. This should work from Windows, Mac, Linux and even from another already synced RaspiBlitz. -Both computers (your RaspberryPi and the other computer with the full blockchain on) need to be connected to the same local network. Start the setup of the RaspiBlitz with a fresh SD card like explained in the README - its OK that there is no blockchain data on your HDD. At the point of the Setup about `Getting the Blockchain` choose the COPY option. Starting from version 1.0 of the RaspiBlitz this will give you further detailed instructions how to transfere the blockchain data onto your RaspiBlitz. In short: On your computer with the blockchain data you will execute SCP commands, that will copy the data over to your RaspiBlitz. +Both computers (your RaspberryPi and the other computer with the full blockchain on) need to be connected to the same local network. Make sure that bitcoin is stoped on the computer containing the blockchain. If your blockchain source is another RaspiBlitz run on the terminal `sudo systemctl stop bitcoind` - when copy/transfer is done later reboot a RaspiBlitz source with `sudo shutdown -r now`. -Once you finsihed the transfere the Raspiblitz will make a quick check - but beware that if there is an error during transfere it can result that yo +If everything of the above is prepared, start the setup of the new RaspiBlitz with a fresh SD card (like explained in the README) - its OK that there is no blockchain data on your HDD yet - just follow the setup. When you get to the setup-point `Getting the Blockchain` choose the COPY option. Starting from version 1.0 of the RaspiBlitz this will give you further detailed instructions how to transfere the blockchain data onto your RaspiBlitz. In short: On your computer with the blockchain data source you will execute SCP commands, that will copy the data over your Local Network to your RaspiBlitz. + +Once you finished all the transferes the Raspiblitz will make a quick-check on the data - but that will not guarantee that everything in detail was OK with the transfere. Check further FAQ answeres if you get stuck or see a final sync with a value below 90%. + +## Why is my "final sync" taking so long? + +First of all if you see a final sync over 90% and you can see from time to time small increase - you should be OK ... this can take some looong time to catch up with the network. Only in the case that you activly choose the `SYNC` option in the `Getting the Blockchain` a final sync under 90% is OK. If you did a torrent, a FTP or a copy from another computer and seeing under 90% somthing went wrong and the setup process is ignoring your prepared Blockchain and doing a full sync - which can almost take forever on a raspberryPi. + +So if something is wrong (like mentioned above) then try again from the beginning. You need to reset your HDD for a fresh start: SSH in as admin user. Abort the final sync info with CTRL+c to get to the terminal. There run `sudo /home/admin/XXcleanHDD.sh -all` and follow the script to delete all data in HDD. When finsihed power down with `sudo shutdown now`. Then make a fresh SD card from image and this time try another option to get the blockchain. If you run into trouble the second time, please report an issue on GitHub. ## How to backup my Lightning Node? From f6c03b66a7a2ba37a7661a432d34d94bdeb49c8d Mon Sep 17 00:00:00 2001 From: rootzoll Date: Tue, 22 Jan 2019 23:59:46 +0100 Subject: [PATCH 04/39] fixed delete all on HDD --- home.admin/XXcleanHDD.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/home.admin/XXcleanHDD.sh b/home.admin/XXcleanHDD.sh index bb54383..de4604a 100755 --- a/home.admin/XXcleanHDD.sh +++ b/home.admin/XXcleanHDD.sh @@ -13,14 +13,12 @@ if [ "${extraParameter}" = "-all" ]; then sudo systemctl stop lnd.service 2>/dev/null # delete plain all on HDD - sudo cd /mnt/hdd - rm -R -- */ - cd + sudo rm -rfv /mnt/hdd/* else echo "!!!! This will DELETE your personal data & POSSIBLE FUNDS from the HDD !!!!" - echo "--> It will keep Blockchain data - sou you dont have to download/copy again." + echo "--> It will keep Blockchain data - so you dont have to download/copy again." echo "--> If you want to delete also blockchain data, please run with '-all' parameter." echo "Press ENTER to really continue - CTRL+c to CANCEL (last chance)" read key From 271af5c75dc27e65956175f0eaf7433deac15914 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Wed, 23 Jan 2019 00:43:05 +0100 Subject: [PATCH 05/39] fix copy blockchain commands --- FAQ.md | 2 +- home.admin/50copyHDD.sh | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/FAQ.md b/FAQ.md index 06e1490..5e77dcf 100644 --- a/FAQ.md +++ b/FAQ.md @@ -40,7 +40,7 @@ One requirement is that the blockchain is from another bitcoin-core client with But we dont copy the data via USB to the device, because the HDD needs to be formatted in EXT4 and that is usually not read/writeable by Windows or Mac computers. So I will explain a way to copy the data thru your local network. This should work from Windows, Mac, Linux and even from another already synced RaspiBlitz. -Both computers (your RaspberryPi and the other computer with the full blockchain on) need to be connected to the same local network. Make sure that bitcoin is stoped on the computer containing the blockchain. If your blockchain source is another RaspiBlitz run on the terminal `sudo systemctl stop bitcoind` - when copy/transfer is done later reboot a RaspiBlitz source with `sudo shutdown -r now`. +Both computers (your RaspberryPi and the other computer with the full blockchain on) need to be connected to the same local network. Make sure that bitcoin is stoped on the computer containing the blockchain. If your blockchain source is another RaspiBlitz run on the terminal `sudo systemctl stop bitcoind` and then go to the directory where the blochcian data is with `sudo cd /mht/hdd/bitcoin` - when copy/transfer is done later reboot a RaspiBlitz source with `sudo shutdown -r now`. If everything of the above is prepared, start the setup of the new RaspiBlitz with a fresh SD card (like explained in the README) - its OK that there is no blockchain data on your HDD yet - just follow the setup. When you get to the setup-point `Getting the Blockchain` choose the COPY option. Starting from version 1.0 of the RaspiBlitz this will give you further detailed instructions how to transfere the blockchain data onto your RaspiBlitz. In short: On your computer with the blockchain data source you will execute SCP commands, that will copy the data over your Local Network to your RaspiBlitz. diff --git a/home.admin/50copyHDD.sh b/home.admin/50copyHDD.sh index 4e683b9..3d9b1e2 100755 --- a/home.admin/50copyHDD.sh +++ b/home.admin/50copyHDD.sh @@ -25,9 +25,9 @@ echo "blockchain data. You should see directories 'blocks', 'chainstate' & 'inde echo "Make sure the bitcoin client on that computer is stopped." echo "" echo "Copy, Paste and Execute the following commands - line by line:" -echo "scp -R ./blocks bitcoin@${localip}:/home/bitcoin/.bitcoin/blocks" -echo "scp -R ./chainstate bitcoin@${localip}:/home/bitcoin/.bitcoin/chainstate" -echo "scp -R ./indexes bitcoin@${localip}:/home/bitcoin/.bitcoin/indexes" +echo "sudo scp -R ./blocks bitcoin@${localip}:/home/bitcoin/.bitcoin/blocks" +echo "sudo scp -R ./chainstate bitcoin@${localip}:/home/bitcoin/.bitcoin/chainstate" +echo "sudo scp -R ./indexes bitcoin@${localip}:/home/bitcoin/.bitcoin/indexes" echo "" echo "Every command above needs your SSH PASSWORD A to work and will take some time to transfer." echo "PRESS ENTER if all 3 transfers are done or if you dont care and you want to return to menu." From f1568e9904ece8d34d8f635701e911f1b27a8547 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Wed, 23 Jan 2019 00:43:57 +0100 Subject: [PATCH 06/39] fix command in FAQ --- FAQ.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FAQ.md b/FAQ.md index 5e77dcf..80acb9c 100644 --- a/FAQ.md +++ b/FAQ.md @@ -40,7 +40,7 @@ One requirement is that the blockchain is from another bitcoin-core client with But we dont copy the data via USB to the device, because the HDD needs to be formatted in EXT4 and that is usually not read/writeable by Windows or Mac computers. So I will explain a way to copy the data thru your local network. This should work from Windows, Mac, Linux and even from another already synced RaspiBlitz. -Both computers (your RaspberryPi and the other computer with the full blockchain on) need to be connected to the same local network. Make sure that bitcoin is stoped on the computer containing the blockchain. If your blockchain source is another RaspiBlitz run on the terminal `sudo systemctl stop bitcoind` and then go to the directory where the blochcian data is with `sudo cd /mht/hdd/bitcoin` - when copy/transfer is done later reboot a RaspiBlitz source with `sudo shutdown -r now`. +Both computers (your RaspberryPi and the other computer with the full blockchain on) need to be connected to the same local network. Make sure that bitcoin is stoped on the computer containing the blockchain. If your blockchain source is another RaspiBlitz run on the terminal `sudo systemctl stop bitcoind` and then go to the directory where the blochcian data is with `cd /mnt/hdd/bitcoin` - when copy/transfer is done later reboot a RaspiBlitz source with `sudo shutdown -r now`. If everything of the above is prepared, start the setup of the new RaspiBlitz with a fresh SD card (like explained in the README) - its OK that there is no blockchain data on your HDD yet - just follow the setup. When you get to the setup-point `Getting the Blockchain` choose the COPY option. Starting from version 1.0 of the RaspiBlitz this will give you further detailed instructions how to transfere the blockchain data onto your RaspiBlitz. In short: On your computer with the blockchain data source you will execute SCP commands, that will copy the data over your Local Network to your RaspiBlitz. From 2edfbea48b51a5d2651717e489d498c9c97d0f68 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Wed, 23 Jan 2019 00:45:10 +0100 Subject: [PATCH 07/39] fix syntax --- home.admin/50copyHDD.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home.admin/50copyHDD.sh b/home.admin/50copyHDD.sh index 3d9b1e2..8662635 100755 --- a/home.admin/50copyHDD.sh +++ b/home.admin/50copyHDD.sh @@ -53,7 +53,7 @@ if [ ${count} -gt 0 ]; then echo "Found data in /mnt/hdd/bitcoin/chainstate" anyDataAtAll=1 fi -fi [ ${count} -lt 1400 ]; then +if [ ${count} -lt 1400 ]; then echo "FAIL: transfere seems invalid - less then 1400 .ldb files (${count})" quickCheckOK=0 fi From 80257964aebd9add525ced7c40718d66caa5be07 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Wed, 23 Jan 2019 00:47:20 +0100 Subject: [PATCH 08/39] fix syntax --- home.admin/50copyHDD.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/home.admin/50copyHDD.sh b/home.admin/50copyHDD.sh index 8662635..7c9f10b 100755 --- a/home.admin/50copyHDD.sh +++ b/home.admin/50copyHDD.sh @@ -39,16 +39,16 @@ sudo unlink /home/bitcoin/.bitcoin # make quick check if data is there anyDataAtAll=0 quickCheckOK=1 -count=$(sudo ls /mnt/hdd/bitcoin/blocks | grep -c '.dat') +count=$(sudo ls /mnt/hdd/bitcoin/blocks 2>/dev/null | grep -c '.dat') if [ ${count} -gt 0 ]; then echo "Found data in /mnt/hdd/bitcoin/blocks" anyDataAtAll=1 -if +fi if [ ${count} -lt 3000 ]; then echo "FAIL: transfere seems invalid - less then 3000 .dat files (${count})" quickCheckOK=0 fi -count=$(sudo ls /mnt/hdd/bitcoin/chainstate | grep -c '.ldb') +count=$(sudo ls /mnt/hdd/bitcoin/chainstate 2>/dev/null | grep -c '.ldb') if [ ${count} -gt 0 ]; then echo "Found data in /mnt/hdd/bitcoin/chainstate" anyDataAtAll=1 @@ -57,7 +57,7 @@ if [ ${count} -lt 1400 ]; then echo "FAIL: transfere seems invalid - less then 1400 .ldb files (${count})" quickCheckOK=0 fi -count=$(sudo ls /mnt/hdd/bitcoin/indexes/txindex | grep -c '.ldb') +count=$(sudo ls /mnt/hdd/bitcoin/indexes/txindex 2>/dev/null | grep -c '.ldb') if [ ${count} -gt 0 ]; then echo "Found data in /mnt/hdd/bitcoin/indexes/txindex" anyDataAtAll=1 From 958ba3328e4360657501dd4fc04020949be5cf8e Mon Sep 17 00:00:00 2001 From: rootzoll Date: Wed, 23 Jan 2019 00:48:47 +0100 Subject: [PATCH 09/39] change order of commands --- home.admin/50copyHDD.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home.admin/50copyHDD.sh b/home.admin/50copyHDD.sh index 7c9f10b..abb02e6 100755 --- a/home.admin/50copyHDD.sh +++ b/home.admin/50copyHDD.sh @@ -25,9 +25,9 @@ echo "blockchain data. You should see directories 'blocks', 'chainstate' & 'inde echo "Make sure the bitcoin client on that computer is stopped." echo "" echo "Copy, Paste and Execute the following commands - line by line:" -echo "sudo scp -R ./blocks bitcoin@${localip}:/home/bitcoin/.bitcoin/blocks" echo "sudo scp -R ./chainstate bitcoin@${localip}:/home/bitcoin/.bitcoin/chainstate" echo "sudo scp -R ./indexes bitcoin@${localip}:/home/bitcoin/.bitcoin/indexes" +echo "sudo scp -R ./blocks bitcoin@${localip}:/home/bitcoin/.bitcoin/blocks" echo "" echo "Every command above needs your SSH PASSWORD A to work and will take some time to transfer." echo "PRESS ENTER if all 3 transfers are done or if you dont care and you want to return to menu." From 3d606351b470a752c3be85d5d97a3d8cde67e918 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Wed, 23 Jan 2019 00:52:43 +0100 Subject: [PATCH 10/39] fix commands --- home.admin/50copyHDD.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/home.admin/50copyHDD.sh b/home.admin/50copyHDD.sh index abb02e6..a42f7f9 100755 --- a/home.admin/50copyHDD.sh +++ b/home.admin/50copyHDD.sh @@ -7,8 +7,8 @@ source /home/admin/raspiblitz.info 2>/dev/null localip=$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/') # create bitcoin base directory and link with bitcoin user -sudo mkdir /mnt/hdd/bitcoin -sudo chown bitcoin:bitcoin /mnt/hdd/bitcoin +sudo mkdir /mnt/hdd/bitcoin 2>/dev/null +sudo chown bitcoin:bitcoin /mnt/hdd/bitcoin sudo ln -s /mnt/hdd/bitcoin /home/bitcoin/.bitcoin echo "" @@ -25,9 +25,9 @@ echo "blockchain data. You should see directories 'blocks', 'chainstate' & 'inde echo "Make sure the bitcoin client on that computer is stopped." echo "" echo "Copy, Paste and Execute the following commands - line by line:" -echo "sudo scp -R ./chainstate bitcoin@${localip}:/home/bitcoin/.bitcoin/chainstate" -echo "sudo scp -R ./indexes bitcoin@${localip}:/home/bitcoin/.bitcoin/indexes" -echo "sudo scp -R ./blocks bitcoin@${localip}:/home/bitcoin/.bitcoin/blocks" +echo "sudo scp -r ./chainstate bitcoin@${localip}:/home/bitcoin/.bitcoin/chainstate" +echo "sudo scp -r ./indexes bitcoin@${localip}:/home/bitcoin/.bitcoin/indexes" +echo "sudo scp -r ./blocks bitcoin@${localip}:/home/bitcoin/.bitcoin/blocks" echo "" echo "Every command above needs your SSH PASSWORD A to work and will take some time to transfer." echo "PRESS ENTER if all 3 transfers are done or if you dont care and you want to return to menu." From 092cd3a2acd4cd4c9acfeea78dcd2e70e51e4e5b Mon Sep 17 00:00:00 2001 From: rootzoll Date: Wed, 23 Jan 2019 00:56:08 +0100 Subject: [PATCH 11/39] fix echo output --- home.admin/50copyHDD.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home.admin/50copyHDD.sh b/home.admin/50copyHDD.sh index a42f7f9..551ca37 100755 --- a/home.admin/50copyHDD.sh +++ b/home.admin/50copyHDD.sh @@ -15,7 +15,7 @@ echo "" echo "*** Instructions to COPY BLOCKCHAIN from another computer (only MAINNET) ***" echo "" echo "You can use the blockchain from another bitcoin-core client with version greater or equal" -echo "to 0.17.1 with transaction index switched on (`txindex=1` in the `bitcoin.conf`)." +echo "to 0.17.1 with transaction index switched on (txindex=1 in the bitcoin.conf)." echo "" echo "Both computers (your RaspberryPi and the other computer with the full blockchain on) need" echo "to be connected to the same local network." From 5bd00e90e3db1261287b07329c1417d7f643ed25 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Wed, 23 Jan 2019 01:03:03 +0100 Subject: [PATCH 12/39] fix dialog --- home.admin/50copyHDD.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/home.admin/50copyHDD.sh b/home.admin/50copyHDD.sh index 551ca37..f2a4055 100755 --- a/home.admin/50copyHDD.sh +++ b/home.admin/50copyHDD.sh @@ -76,11 +76,11 @@ if [ ${anyDataAtAll} -eq 1 ]; then echo "There seems to be a invalid transfere." echo "Wait 5 secs ..." sleep 5 - dialog --title " INVALID TRANSFER" --yesno "Quickcheck shows the data you transferred is invalid/incomplete.\nThis can lead further RaspiBlitz setup to get stuck in error state.\nDo you want to reset/delete data data?" 8 57 + dialog --title " INVALID TRANSFER - DELETE DATA?" --yesno "Quickcheck shows the data you transferred is invalid/incomplete. This can lead further RaspiBlitz setup to get stuck in error state.\nDo you want to reset/delete data data?" 8 60 response=$? echo "response(${response})" case $response in - 0) quickCheckOK=1 ;; + 1) quickCheckOK=1 ;; esac fi From 53ba18668709cd2e2af3c6a1cb1773a9e410102d Mon Sep 17 00:00:00 2001 From: rootzoll Date: Wed, 23 Jan 2019 01:07:26 +0100 Subject: [PATCH 13/39] mak sure bitcoin dir is fresh --- home.admin/50copyHDD.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/home.admin/50copyHDD.sh b/home.admin/50copyHDD.sh index f2a4055..9fd5131 100755 --- a/home.admin/50copyHDD.sh +++ b/home.admin/50copyHDD.sh @@ -7,7 +7,8 @@ source /home/admin/raspiblitz.info 2>/dev/null localip=$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/') # create bitcoin base directory and link with bitcoin user -sudo mkdir /mnt/hdd/bitcoin 2>/dev/null +sudo rm -rf /mnt/hdd/bitcoin 2>/dev/null +sudo mkdir /mnt/hdd/bitcoin sudo chown bitcoin:bitcoin /mnt/hdd/bitcoin sudo ln -s /mnt/hdd/bitcoin /home/bitcoin/.bitcoin From d67a40bd2e85a73c057f05f3c9b4d2d1d0571f7b Mon Sep 17 00:00:00 2001 From: rootzoll Date: Wed, 23 Jan 2019 14:07:59 +0100 Subject: [PATCH 14/39] one line scp inluding testnet3 --- home.admin/50copyHDD.sh | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/home.admin/50copyHDD.sh b/home.admin/50copyHDD.sh index 9fd5131..18b08f6 100755 --- a/home.admin/50copyHDD.sh +++ b/home.admin/50copyHDD.sh @@ -12,8 +12,10 @@ sudo mkdir /mnt/hdd/bitcoin sudo chown bitcoin:bitcoin /mnt/hdd/bitcoin sudo ln -s /mnt/hdd/bitcoin /home/bitcoin/.bitcoin -echo "" -echo "*** Instructions to COPY BLOCKCHAIN from another computer (only MAINNET) ***" +clear +echo "************************************************************************************" +echo "Instructions to COPY/TRANSFER SYNCED BLOCKCHAIN from another computer" +echo "************************************************************************************" echo "" echo "You can use the blockchain from another bitcoin-core client with version greater or equal" echo "to 0.17.1 with transaction index switched on (txindex=1 in the bitcoin.conf)." @@ -21,17 +23,24 @@ echo "" echo "Both computers (your RaspberryPi and the other computer with the full blockchain on) need" echo "to be connected to the same local network." echo "" -echo "Open a terminal on the other computer and change into the directory that constains the" +echo "Open a terminal on the source computer and change into the directory that constains the" echo "blockchain data. You should see directories 'blocks', 'chainstate' & 'indexes'". echo "Make sure the bitcoin client on that computer is stopped." echo "" -echo "Copy, Paste and Execute the following commands - line by line:" -echo "sudo scp -r ./chainstate bitcoin@${localip}:/home/bitcoin/.bitcoin/chainstate" -echo "sudo scp -r ./indexes bitcoin@${localip}:/home/bitcoin/.bitcoin/indexes" -echo "sudo scp -r ./blocks bitcoin@${localip}:/home/bitcoin/.bitcoin/blocks" +echo "COPY, PASTE & EXECUTE the following command on the blockchain source computer:" +echo "sudo scp -r ./chainstate ./indexes ./blocks ./testnet3 bitcoin@${localip}:/home/bitcoin/.bitcoin" echo "" -echo "Every command above needs your SSH PASSWORD A to work and will take some time to transfer." -echo "PRESS ENTER if all 3 transfers are done or if you dont care and you want to return to menu." +echo "This command will ask for your SSH PASSWORD A from this RaspiBlitz." +echo "It can take multiple hours until transfer is complete - be patient." +echo "************************************************************************************" +echo "PRESS ENTER if transfers is done OR if you want to choose another another option." +#echo "Copy, Paste and Execute the following commands - line by line:" +#echo "sudo scp -r ./chainstate bitcoin@${localip}:/home/bitcoin/.bitcoin/chainstate" +#echo "sudo scp -r ./indexes bitcoin@${localip}:/home/bitcoin/.bitcoin/indexes" +#echo "sudo scp -r ./blocks bitcoin@${localip}:/home/bitcoin/.bitcoin/blocks" +#echo "" +#echo "Every command above needs your SSH PASSWORD A to work and will take some time to transfer." +#echo "PRESS ENTER if all 3 transfers are done or if you dont care and you want to return to menu." read key # unlink bitcoin user (will created later in setup again) From 1049afd846c64e425152b62dfb342c2d0d47a540 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Wed, 23 Jan 2019 14:16:28 +0100 Subject: [PATCH 15/39] oneline fix --- home.admin/50copyHDD.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home.admin/50copyHDD.sh b/home.admin/50copyHDD.sh index 18b08f6..a9127b3 100755 --- a/home.admin/50copyHDD.sh +++ b/home.admin/50copyHDD.sh @@ -28,7 +28,7 @@ echo "blockchain data. You should see directories 'blocks', 'chainstate' & 'inde echo "Make sure the bitcoin client on that computer is stopped." echo "" echo "COPY, PASTE & EXECUTE the following command on the blockchain source computer:" -echo "sudo scp -r ./chainstate ./indexes ./blocks ./testnet3 bitcoin@${localip}:/home/bitcoin/.bitcoin" +echo "sudo scp -r ./chainstate ./indexes ./testnet3 ./blocks bitcoin@${localip}:/home/bitcoin/.bitcoin" echo "" echo "This command will ask for your SSH PASSWORD A from this RaspiBlitz." echo "It can take multiple hours until transfer is complete - be patient." From 2631b5fb03f9a7b813f2f8892811be87b5d7d989 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Wed, 23 Jan 2019 14:56:23 +0100 Subject: [PATCH 16/39] more debug output --- home.admin/XXcleanHDD.sh | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/home.admin/XXcleanHDD.sh b/home.admin/XXcleanHDD.sh index de4604a..0b314c5 100755 --- a/home.admin/XXcleanHDD.sh +++ b/home.admin/XXcleanHDD.sh @@ -7,12 +7,19 @@ if [ "${extraParameter}" = "-all" ]; then echo "Press ENTER to really continue - CTRL+c to CANCEL (last chance)" read key + echo "stopping services ... (please wait)" + echo "- swap" sudo dphys-swapfile swapoff + echo "- background" + sudo systemctl stop background 2>/dev/null + echo "- lnd" + sudo systemctl stop lnd.service 2>/dev/null + echo "- blockchain" sudo systemctl stop bitcoind.service 2>/dev/null sudo systemctl stop litecoind.service 2>/dev/null - sudo systemctl stop lnd.service 2>/dev/null # delete plain all on HDD + echo "cleaning HDD ... (please wait)" sudo rm -rfv /mnt/hdd/* else @@ -23,12 +30,19 @@ else echo "Press ENTER to really continue - CTRL+c to CANCEL (last chance)" read key + echo "stopping services ... (please wait)" + echo "- swap" sudo dphys-swapfile swapoff + echo "- background" + sudo systemctl stop background 2>/dev/null + echo "- lnd" + sudo systemctl stop lnd.service 2>/dev/null + echo "- blockchain" sudo systemctl stop bitcoind.service 2>/dev/null sudo systemctl stop litecoind.service 2>/dev/null - sudo systemctl stop lnd.service 2>/dev/null # just delete selective + echo "selective delete ... (please wait)" sudo rm -f -r /mnt/hdd/lnd sudo rm -f -r /mnt/hdd/ssh sudo rm -f /mnt/hdd/swapfile From 014f2cb594d4538437de048ff094818e8543f75a Mon Sep 17 00:00:00 2001 From: rootzoll Date: Wed, 23 Jan 2019 14:57:51 +0100 Subject: [PATCH 17/39] better output --- home.admin/XXcleanHDD.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/home.admin/XXcleanHDD.sh b/home.admin/XXcleanHDD.sh index 0b314c5..840aa80 100755 --- a/home.admin/XXcleanHDD.sh +++ b/home.admin/XXcleanHDD.sh @@ -67,6 +67,8 @@ else fi +echo "*************************" echo "OK - the HDD is now clean" +echo "*************************" echo "reboot -> sudo shutdown -r now" echo "power off -> sudo shutdown now" From 47dafae8dae15fae471e0bf2e3ac1d2f4c11cb04 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Thu, 24 Jan 2019 18:27:34 +0100 Subject: [PATCH 18/39] quick fix/fallback for #289 --- home.admin/AAunlockLND.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/home.admin/AAunlockLND.sh b/home.admin/AAunlockLND.sh index 87b7778..6c37ff0 100755 --- a/home.admin/AAunlockLND.sh +++ b/home.admin/AAunlockLND.sh @@ -3,6 +3,7 @@ # load raspiblitz config data (with backup from old config) source /mnt/hdd/raspiblitz.conf 2>/dev/null if [ ${#network} -eq 0 ]; then network=`cat .network`; fi +if [ ${#network} -eq 0 ]; then network="bitcoin"; fi if [ ${#chain} -eq 0 ]; then echo "gathering chain info ... please wait" chain=$(${network}-cli getblockchaininfo | jq -r '.chain') From ed828455d8a0a67c4c9fdc90bb44abb21989b0ef Mon Sep 17 00:00:00 2001 From: rootzoll Date: Fri, 25 Jan 2019 21:56:24 +0100 Subject: [PATCH 19/39] #292 safeguarding against network info loss --- home.admin/BBcashoutWallet.sh | 1 + home.admin/BBcloseAllChannels.sh | 1 + home.admin/BBconnectPeer.sh | 1 + home.admin/BBcreateInvoice.sh | 1 + home.admin/BBfundWallet.sh | 1 + home.admin/BBopenChannel.sh | 1 + home.admin/BBpayInvoice.sh | 1 + 7 files changed, 7 insertions(+) diff --git a/home.admin/BBcashoutWallet.sh b/home.admin/BBcashoutWallet.sh index f6c6b3a..c34f097 100755 --- a/home.admin/BBcashoutWallet.sh +++ b/home.admin/BBcashoutWallet.sh @@ -7,6 +7,7 @@ echo "please wait ..." # load raspiblitz config data (with backup from old config) source /mnt/hdd/raspiblitz.conf 2>/dev/null if [ ${#network} -eq 0 ]; then network=`cat .network`; fi +if [ ${#network} -eq 0 ]; then network="bitcoin"; fi if [ ${#chain} -eq 0 ]; then chain=$(${network}-cli -datadir=/home/bitcoin/.${network} getblockchaininfo | jq -r '.chain') fi diff --git a/home.admin/BBcloseAllChannels.sh b/home.admin/BBcloseAllChannels.sh index 5a35d14..5d06697 100755 --- a/home.admin/BBcloseAllChannels.sh +++ b/home.admin/BBcloseAllChannels.sh @@ -3,6 +3,7 @@ # load raspiblitz config data (with backup from old config) source /mnt/hdd/raspiblitz.conf 2>/dev/null if [ ${#network} -eq 0 ]; then network=`cat .network`; fi +if [ ${#network} -eq 0 ]; then network="bitcoin"; fi if [ ${#chain} -eq 0 ]; then chain=$(${network}-cli getblockchaininfo | jq -r '.chain') fi diff --git a/home.admin/BBconnectPeer.sh b/home.admin/BBconnectPeer.sh index 3d9734f..f721e89 100755 --- a/home.admin/BBconnectPeer.sh +++ b/home.admin/BBconnectPeer.sh @@ -5,6 +5,7 @@ _error="./.error.out" # load raspiblitz config data (with backup from old config) source /mnt/hdd/raspiblitz.conf 2>/dev/null if [ ${#network} -eq 0 ]; then network=`cat .network`; fi +if [ ${#network} -eq 0 ]; then network="bitcoin"; fi if [ ${#chain} -eq 0 ]; then echo "gathering chain info ... please wait" chain=$(${network}-cli getblockchaininfo | jq -r '.chain') diff --git a/home.admin/BBcreateInvoice.sh b/home.admin/BBcreateInvoice.sh index 0678ad7..797070c 100755 --- a/home.admin/BBcreateInvoice.sh +++ b/home.admin/BBcreateInvoice.sh @@ -6,6 +6,7 @@ sudo chmod 7777 ${_error} # load raspiblitz config data (with backup from old config) source /mnt/hdd/raspiblitz.conf 2>/dev/null if [ ${#network} -eq 0 ]; then network=`cat .network`; fi +if [ ${#network} -eq 0 ]; then network="bitcoin"; fi if [ ${#chain} -eq 0 ]; then echo "gathering chain info ... please wait" chain=$(${network}-cli getblockchaininfo | jq -r '.chain') diff --git a/home.admin/BBfundWallet.sh b/home.admin/BBfundWallet.sh index 207d4f4..0278f2e 100755 --- a/home.admin/BBfundWallet.sh +++ b/home.admin/BBfundWallet.sh @@ -3,6 +3,7 @@ # load raspiblitz config data (with backup from old config) source /mnt/hdd/raspiblitz.conf 2>/dev/null if [ ${#network} -eq 0 ]; then network=`cat .network`; fi +if [ ${#network} -eq 0 ]; then network="bitcoin"; fi if [ ${#chain} -eq 0 ]; then echo "gathering chain info ... please wait" chain=$(${network}-cli getblockchaininfo | jq -r '.chain') diff --git a/home.admin/BBopenChannel.sh b/home.admin/BBopenChannel.sh index c1095d6..559a599 100755 --- a/home.admin/BBopenChannel.sh +++ b/home.admin/BBopenChannel.sh @@ -5,6 +5,7 @@ _error="./.error.out" # load raspiblitz config data (with backup from old config) source /mnt/hdd/raspiblitz.conf 2>/dev/null if [ ${#network} -eq 0 ]; then network=`cat .network`; fi +if [ ${#network} -eq 0 ]; then network="bitcoin"; fi if [ ${#chain} -eq 0 ]; then echo "gathering chain info ... please wait" chain=$(${network}-cli getblockchaininfo | jq -r '.chain') diff --git a/home.admin/BBpayInvoice.sh b/home.admin/BBpayInvoice.sh index 26765ad..f076bd2 100755 --- a/home.admin/BBpayInvoice.sh +++ b/home.admin/BBpayInvoice.sh @@ -5,6 +5,7 @@ _error="./.error.out" # load raspiblitz config data (with backup from old config) source /mnt/hdd/raspiblitz.conf 2>/dev/null if [ ${#network} -eq 0 ]; then network=`cat .network`; fi +if [ ${#network} -eq 0 ]; then network="bitcoin"; fi if [ ${#chain} -eq 0 ]; then echo "gathering chain info ... please wait" chain=$(${network}-cli getblockchaininfo | jq -r '.chain') From 54cc926a3acec60e748fe2a922d750462a0c937b Mon Sep 17 00:00:00 2001 From: rootzoll Date: Fri, 25 Jan 2019 22:06:47 +0100 Subject: [PATCH 20/39] updated syncing to mainnet with warning --- home.admin/10setupBlitz.sh | 2 +- home.admin/50syncHDD.sh | 23 ++++++++++++++--------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/home.admin/10setupBlitz.sh b/home.admin/10setupBlitz.sh index de651cc..0082d66 100755 --- a/home.admin/10setupBlitz.sh +++ b/home.admin/10setupBlitz.sh @@ -164,7 +164,7 @@ if [ ${mountOK} -eq 1 ]; then T "TORRENT --> MAINNET + TESTNET thru Torrent (DEFAULT)" \ D "DOWNLOAD --> MAINNET + TESTNET per FTP (FALLBACK)" \ C "COPY --> USE BLOCKCHAINDATA from another computer" \ - S "SYNC --> JUST TESTNET thru Bitoin Network (FALLBACK+SLOW)" 2>&1 >/dev/tty) + S "SYNC --> MAINNET thru Bitoin Network (ULTRA SLOW)" 2>&1 >/dev/tty) # Litecoin elif [ ${network} = "litecoin" ]; then diff --git a/home.admin/50syncHDD.sh b/home.admin/50syncHDD.sh index 0ae9660..a509fde 100755 --- a/home.admin/50syncHDD.sh +++ b/home.admin/50syncHDD.sh @@ -5,23 +5,28 @@ source /home/admin/raspiblitz.info 2>/dev/null # only show warning when bitcoin if [ "$network" = "bitcoin" ]; then - msg="" - msg="$msg Syncing is just practical for Bitcoin TESTNET!\n" - msg="$msg TESTNET is OK for learning, testing and development.\n" - msg="$msg MAINNET is where things get real and fun.\n" + msg="The RaspberryPi has very limited CPU power." + msg="$msg To sync & validate the complete blockchain\n" + msg="$msg can take multiple days - even weeks!\n" + msg="$msg Its recommended to use another option.\n" msg="$msg \n" - msg="$msg Syncing MAINNET on a raspberry is NOT practical.\n" - msg="$msg If you want MAINET, go back & try DOWNLOAD.\n" - msg="$msg \n" - msg="$msg Do you really want to work with ONLY TESTNET?" + msg="$msg So do you really want start syncing now?" - dialog --title " WARNING " --yesno "${msg}" 12 57 + dialog --title " WARNING " --yesno "${msg}" 11 57 response=$? case $response in 0) echo "--> OK";; 1) ./10setupBlitz.sh; exit 1;; 255) ./10setupBlitz.sh; exit 1;; esac + + clear + echo "********************************" + echo "This is madness. This is Sparta!" + echo "********************************" + echo "" + sleep 3 + fi echo "*** Activating Blockain Sync ***" From 6ea4994c08489720d4b9db145e689f9bf5fe5334 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Fri, 25 Jan 2019 23:42:38 +0100 Subject: [PATCH 21/39] fix UI --- home.admin/50syncHDD.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home.admin/50syncHDD.sh b/home.admin/50syncHDD.sh index a509fde..e0328b8 100755 --- a/home.admin/50syncHDD.sh +++ b/home.admin/50syncHDD.sh @@ -5,7 +5,7 @@ source /home/admin/raspiblitz.info 2>/dev/null # only show warning when bitcoin if [ "$network" = "bitcoin" ]; then - msg="The RaspberryPi has very limited CPU power." + msg=" The RaspberryPi has very limited CPU power.\n" msg="$msg To sync & validate the complete blockchain\n" msg="$msg can take multiple days - even weeks!\n" msg="$msg Its recommended to use another option.\n" From c0c10b99e15c8d974e5fcbfb661a79d4af5d60c6 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Sat, 26 Jan 2019 03:12:47 +0100 Subject: [PATCH 22/39] torrent RSS test --- home.admin/assets/raspiblitz-torrents-rss.xml | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 home.admin/assets/raspiblitz-torrents-rss.xml diff --git a/home.admin/assets/raspiblitz-torrents-rss.xml b/home.admin/assets/raspiblitz-torrents-rss.xml new file mode 100644 index 0000000..3c67ad7 --- /dev/null +++ b/home.admin/assets/raspiblitz-torrents-rss.xml @@ -0,0 +1,39 @@ + + + + + + + + + + RaspiBlitz TorrentSeeds RSS + http://github.com/rootzoll/raspiblitz + Help on seeding the lastest RaspiBlitz Torrent Seeds + en-en + + + http://github.com/rootzoll/raspiblitz/raw/master/home.admin/assets/raspiblitz-bitcoin1-2018-10-13-base.torrent + raspiblitz-bitcoin1-2018-10-13-base.torrent + please seed + + + + + http://github.com/rootzoll/raspiblitz/raw/master/home.admin/assets/raspiblitz-bitcoin1-2019-01-16-update.torrent + raspiblitz-bitcoin1-2019-01-16-update.torrent + please seed + + + + + + \ No newline at end of file From 11570e1394aee856711150e239af3e2200d30d51 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Sat, 26 Jan 2019 03:27:23 +0100 Subject: [PATCH 23/39] add link element --- home.admin/assets/raspiblitz-torrents-rss.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/home.admin/assets/raspiblitz-torrents-rss.xml b/home.admin/assets/raspiblitz-torrents-rss.xml index 3c67ad7..6558a2d 100644 --- a/home.admin/assets/raspiblitz-torrents-rss.xml +++ b/home.admin/assets/raspiblitz-torrents-rss.xml @@ -16,6 +16,7 @@ http://github.com/rootzoll/raspiblitz/raw/master/home.admin/assets/raspiblitz-bitcoin1-2018-10-13-base.torrent raspiblitz-bitcoin1-2018-10-13-base.torrent please seed + http://github.com/rootzoll/raspiblitz/raw/master/home.admin/assets/raspiblitz-bitcoin1-2018-10-13-base.torrent http://github.com/rootzoll/raspiblitz/raw/master/home.admin/assets/raspiblitz-bitcoin1-2019-01-16-update.torrent raspiblitz-bitcoin1-2019-01-16-update.torrent please seed + http://github.com/rootzoll/raspiblitz/raw/master/home.admin/assets/raspiblitz-bitcoin1-2019-01-16-update.torrent Date: Sat, 26 Jan 2019 03:32:53 +0100 Subject: [PATCH 24/39] test rss --- home.admin/assets/raspiblitz-torrents-rss.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/home.admin/assets/raspiblitz-torrents-rss.xml b/home.admin/assets/raspiblitz-torrents-rss.xml index 6558a2d..45dfdd5 100644 --- a/home.admin/assets/raspiblitz-torrents-rss.xml +++ b/home.admin/assets/raspiblitz-torrents-rss.xml @@ -13,10 +13,10 @@ en-en + Fri, 25 Jan 2019 21:27:31 -0500 http://github.com/rootzoll/raspiblitz/raw/master/home.admin/assets/raspiblitz-bitcoin1-2018-10-13-base.torrent raspiblitz-bitcoin1-2018-10-13-base.torrent please seed - http://github.com/rootzoll/raspiblitz/raw/master/home.admin/assets/raspiblitz-bitcoin1-2018-10-13-base.torrent + Fri, 25 Jan 2019 21:27:31 -0500 http://github.com/rootzoll/raspiblitz/raw/master/home.admin/assets/raspiblitz-bitcoin1-2019-01-16-update.torrent raspiblitz-bitcoin1-2019-01-16-update.torrent please seed - http://github.com/rootzoll/raspiblitz/raw/master/home.admin/assets/raspiblitz-bitcoin1-2019-01-16-update.torrent Date: Sat, 26 Jan 2019 03:36:53 +0100 Subject: [PATCH 25/39] rss test --- home.admin/assets/raspiblitz-torrents-rss.xml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/home.admin/assets/raspiblitz-torrents-rss.xml b/home.admin/assets/raspiblitz-torrents-rss.xml index 45dfdd5..c05ac92 100644 --- a/home.admin/assets/raspiblitz-torrents-rss.xml +++ b/home.admin/assets/raspiblitz-torrents-rss.xml @@ -1,6 +1,6 @@ - + @@ -17,6 +17,11 @@ http://github.com/rootzoll/raspiblitz/raw/master/home.admin/assets/raspiblitz-bitcoin1-2018-10-13-base.torrent raspiblitz-bitcoin1-2018-10-13-base.torrent please seed + 2405115 + 0 + 0 + 0 + raspiblitz-bitcoin1-2018-10-13-base.torrent Date: Sat, 26 Jan 2019 03:43:20 +0100 Subject: [PATCH 26/39] rss update --- home.admin/assets/raspiblitz-torrents-rss.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/home.admin/assets/raspiblitz-torrents-rss.xml b/home.admin/assets/raspiblitz-torrents-rss.xml index c05ac92..fbf8bbd 100644 --- a/home.admin/assets/raspiblitz-torrents-rss.xml +++ b/home.admin/assets/raspiblitz-torrents-rss.xml @@ -12,12 +12,15 @@ Help on seeding the lastest RaspiBlitz Torrent Seeds en-en + Fri, 25 Jan 2019 21:27:31 -0500 http://github.com/rootzoll/raspiblitz/raw/master/home.admin/assets/raspiblitz-bitcoin1-2018-10-13-base.torrent raspiblitz-bitcoin1-2018-10-13-base.torrent please seed 2405115 + 832c8f29e74e0efb1142a69d84d366caa94b3ad6 + 0 0 0 From 0a0ab7699883b7166b0ce9de4e2312e5fec10555 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Sat, 26 Jan 2019 04:04:01 +0100 Subject: [PATCH 27/39] update rss --- home.admin/assets/raspiblitz-torrents-rss.xml | 35 ++++++++++--------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/home.admin/assets/raspiblitz-torrents-rss.xml b/home.admin/assets/raspiblitz-torrents-rss.xml index fbf8bbd..a89e28b 100644 --- a/home.admin/assets/raspiblitz-torrents-rss.xml +++ b/home.admin/assets/raspiblitz-torrents-rss.xml @@ -4,42 +4,43 @@ - - - RaspiBlitz TorrentSeeds RSS http://github.com/rootzoll/raspiblitz Help on seeding the lastest RaspiBlitz Torrent Seeds en-en - - Fri, 25 Jan 2019 21:27:31 -0500 http://github.com/rootzoll/raspiblitz/raw/master/home.admin/assets/raspiblitz-bitcoin1-2018-10-13-base.torrent raspiblitz-bitcoin1-2018-10-13-base.torrent - please seed - 2405115 - 832c8f29e74e0efb1142a69d84d366caa94b3ad6 - - 0 - 0 - 0 - raspiblitz-bitcoin1-2018-10-13-base.torrent - Fri, 25 Jan 2019 21:27:31 -0500 http://github.com/rootzoll/raspiblitz/raw/master/home.admin/assets/raspiblitz-bitcoin1-2019-01-16-update.torrent raspiblitz-bitcoin1-2019-01-16-update.torrent - please seed + + + + http://github.com/rootzoll/raspiblitz/raw/master/home.admin/assets/raspiblitz-litecoin1-2018-11-18-base.torrent + raspiblitz-litecoin1-2018-11-18-base.torrent + + + + + http://github.com/rootzoll/raspiblitz/raw/master/home.admin/assets/raspiblitz-litecoin1-2018-11-18-update.torrent + raspiblitz-litecoin1-2018-11-18-update.torrent + From f20e743d5b3b872c3b3c725bf302cc7bc0f22d28 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Sat, 26 Jan 2019 04:05:49 +0100 Subject: [PATCH 28/39] update rss --- home.admin/assets/raspiblitz-torrents-rss.xml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/home.admin/assets/raspiblitz-torrents-rss.xml b/home.admin/assets/raspiblitz-torrents-rss.xml index a89e28b..172a355 100644 --- a/home.admin/assets/raspiblitz-torrents-rss.xml +++ b/home.admin/assets/raspiblitz-torrents-rss.xml @@ -1,14 +1,16 @@ - + RaspiBlitz TorrentSeeds RSS - http://github.com/rootzoll/raspiblitz Help on seeding the lastest RaspiBlitz Torrent Seeds en-en + + http://wiki.fulmo.org/downloads/raspiblitz-torrents-rss.xml + http://github.com/rootzoll/raspiblitz/raw/master/home.admin/assets/raspiblitz-bitcoin1-2018-10-13-base.torrent raspiblitz-bitcoin1-2018-10-13-base.torrent From 2988912084aa8d07205a8f7ca54c1c3af3e1688b Mon Sep 17 00:00:00 2001 From: rootzoll Date: Mon, 28 Jan 2019 12:13:37 +0100 Subject: [PATCH 29/39] a bit more space --- home.admin/00infoLCD.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/home.admin/00infoLCD.sh b/home.admin/00infoLCD.sh index c4f4070..0f0fcd1 100755 --- a/home.admin/00infoLCD.sh +++ b/home.admin/00infoLCD.sh @@ -37,7 +37,7 @@ while : l1="Waiting for Network ...\n" l2="Not able to get local IP.\n" l3="Is LAN cable connected?\n" - dialog --backtitle "RaspiBlitz ${codeVersion}" --infobox "$l1$l2$l3" 5 30 + dialog --backtitle "RaspiBlitz ${codeVersion}" --infobox "$l1$l2$l3" 5 40 sleep 3 continue fi @@ -47,7 +47,7 @@ while : l1="Waiting for DHCP ...\n" l2="Not able to get local IP.\n" l3="Will try reboot every 5min.\n" - dialog --backtitle "RaspiBlitz ${codeVersion} (${localip})" --infobox "$l1$l2$l3" 5 30 + dialog --backtitle "RaspiBlitz ${codeVersion} (${localip})" --infobox "$l1$l2$l3" 5 40 sleep 3 continue fi From e653e4158856be72e95228ff804e8372bf598f18 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Mon, 28 Jan 2019 13:15:01 +0100 Subject: [PATCH 30/39] #295 fix TOR detection and line breaks --- home.admin/00infoBlitz.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/home.admin/00infoBlitz.sh b/home.admin/00infoBlitz.sh index 1be974c..21d464d 100755 --- a/home.admin/00infoBlitz.sh +++ b/home.admin/00infoBlitz.sh @@ -152,16 +152,19 @@ torInfo="" networkVersion=$(${network}-cli -datadir=${bitcoin_dir} -version 2>/dev/null | cut -d ' ' -f6) # TOR or IP networkInfo=$(${network}-cli -datadir=${bitcoin_dir} getnetworkinfo) -onionAddress=$(echo ${networkInfo} | jq -r '.localaddresses [0] .address') networkConnections=$(echo ${networkInfo} | jq -r '.connections') networkConnectionsInfo="${color_purple}${networkConnections} ${color_gray}connections" -if [ "${onionAddress}" != "null" ]; then + +if [ "${runBehindTor}" = "on" ]; then + # TOR address + onionAddress=$(echo ${networkInfo} | jq -r '.localaddresses [0] .address') networkConnectionsInfo="${color_purple}${networkConnections} ${color_gray}peers" public_addr="${onionAddress}:${public_port}" public="" public_color="${color_green}" torInfo="+ TOR" + else # IP address @@ -286,7 +289,7 @@ ${color_yellow}${ln_publicColor}${ln_external} "-------------------------------------------" \ "load average:${load##up*, }" "${temp}" \ "${hdd}" "${sync_percentage}" -if [ ${#onionAddress} -eq 0 ]; then +if [ "${runBehindTor}" != "on" ]; then # one extra space line at the end if nodeaddress is not TOR echo "" fi From cafa617cdb66ac8cc5867070b5881670e5874f9c Mon Sep 17 00:00:00 2001 From: rootzoll Date: Mon, 28 Jan 2019 13:15:33 +0100 Subject: [PATCH 31/39] added VPN info --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 955cefd..5129b15 100644 --- a/README.md +++ b/README.md @@ -397,6 +397,7 @@ This is highly experimental. And again: If you restore the LND with an backup th To connect a RaspiBlitz directly (without a router/switch) to your laptop and share the WIFI internet connection, you can follow this [guide for OSX](https://medium.com/@tzhenghao/how-to-ssh-into-your-raspberry-pi-with-a-mac-and-ethernet-cable-636a197d055). In short: +* make sure all VPN are off (can interfere with local LAN) * connect with LAN directly * Settings > Sharing/Freigaben > activate "internet sharing" from WLAN to Ethernet * Settings > Network > Ethernet-Adapter > set to DHCP From e5c42294ef585551538f67f48280e1e8bbd4a3b1 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Mon, 28 Jan 2019 13:33:20 +0100 Subject: [PATCH 32/39] added info about wallet seed --- FAQ.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/FAQ.md b/FAQ.md index 80acb9c..308a062 100644 --- a/FAQ.md +++ b/FAQ.md @@ -64,6 +64,18 @@ To really have a good backup to rely on such feature needs to be part of the LND But you can try to backup at your own risk. All your Lightning Node data is within the `/mnt/hdd/lnd` directory. Just run a backup of that data when the lnd service is stopped. +## What is this mnemonic seed word list? + +With the 24 word list given you by LND on wallet creation you can recover your private key. You should write it down and store it at a save place. + +For more background on mnemonic seeds see this video: https://www.youtube.com/watch?v=wWCIQFNf_8g + +# How does PASSWORD D effects this seed? + +On wallet creation you get asked if you want to protect your word seed list with an additional password. If you choose so, RaspiBlitz recommends you to use your PASSWORD D at this point. + +To use a an additional password for your seed words is optional. If you choose so, you will need the password to recover your private key from your your seed words later on. Without this password your private key cannot be recovered from your seed words. So the password adds an additional layer of security, if someone finds your written down word list. + ## How do I change the Name/Alias of my lightning node Use the "Change Name/Alias of Node" option in main menu. The RaspiBlitz will make a reboot after this. From 19f232a9821a550d7b3387d29d39a97eb289a866 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Mon, 28 Jan 2019 13:46:27 +0100 Subject: [PATCH 33/39] add bip39 info --- FAQ.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FAQ.md b/FAQ.md index 308a062..fab2e42 100644 --- a/FAQ.md +++ b/FAQ.md @@ -66,7 +66,7 @@ But you can try to backup at your own risk. All your Lightning Node data is with ## What is this mnemonic seed word list? -With the 24 word list given you by LND on wallet creation you can recover your private key. You should write it down and store it at a save place. +With the 24 word list given you by LND on wallet creation you can recover your private key (BIP 39). You should write it down and store it at a save place. For more background on mnemonic seeds see this video: https://www.youtube.com/watch?v=wWCIQFNf_8g From f7a06d9096e81c21852c675008024d5fcfbeda62 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Mon, 28 Jan 2019 15:42:24 +0100 Subject: [PATCH 34/39] #293 reindex detection and script --- home.admin/00infoLCD.sh | 11 ++++ home.admin/00mainMenu.sh | 18 ++++++ home.admin/config.scripts/network.reindex.sh | 66 ++++++++++++++++++++ 3 files changed, 95 insertions(+) create mode 100755 home.admin/config.scripts/network.reindex.sh diff --git a/home.admin/00infoLCD.sh b/home.admin/00infoLCD.sh index 0f0fcd1..2dd167e 100755 --- a/home.admin/00infoLCD.sh +++ b/home.admin/00infoLCD.sh @@ -151,6 +151,17 @@ while : continue fi + # if re-indexing + if [ "${state}" = "reindex" ]; then + l1="REINDEXING BLOCKCHAIN\n" + l2="To monitor & detect finish:\n" + l3="ssh admin@${localip}\n" + boxwidth=$((${#localip} + 28)) + dialog --backtitle "RaspiBlitz ${codeVersion} (${state})" --infobox "$l1$l2$l3" 5 ${boxwidth} + sleep 3 + continue + fi + # check if bitcoin is ready sudo -u bitcoin ${network}-cli -datadir=/home/bitcoin/.${network} getblockchaininfo 1>/dev/null 2>error.tmp clienterror=`cat error.tmp` diff --git a/home.admin/00mainMenu.sh b/home.admin/00mainMenu.sh index c956f5e..33fa385 100755 --- a/home.admin/00mainMenu.sh +++ b/home.admin/00mainMenu.sh @@ -58,6 +58,13 @@ if [ "${state}" = "recovered" ]; then exit 1 fi +# signal that a reindex was triggered +if [ "${state}" = "reindex" ]; then + echo "Re-Index in progress ... start monitoring:" + /home/admin/config.scripts/network.reindex.sh + exit 1 +fi + # if pre-sync is running - stop it - before continue if [ "${state}" = "presync" ]; then # stopping the pre-sync @@ -118,6 +125,17 @@ waitUntilChainNetworkIsReady() clienterror=`cat error.tmp` rm error.tmp if [ ${#clienterror} -gt 0 ]; then + + # analyse LOGS for possible reindex + reindex=$(sudo cat /mnt/hdd/${network}/debug.log | grep -c 'Please restart with -reindex or -reindex-chainstate to recover') + if [ ${reindex} -gt 0 ]; then + echo "!! DETECTED NEED FOR RE-INDEX in debug.log ... starting repair script." + sleep 3 + sudo /home/admin/config.scripts/network.reindex.sh + exit + fi + + # normal info boxwidth=40 l1="Waiting for ${network}d to get ready.\n" l2="---> ${clienterror/error*:/}\n" diff --git a/home.admin/config.scripts/network.reindex.sh b/home.admin/config.scripts/network.reindex.sh new file mode 100755 index 0000000..3bbc7be --- /dev/null +++ b/home.admin/config.scripts/network.reindex.sh @@ -0,0 +1,66 @@ +#!/bin/bash + +# command info +if [ "$1" = "-h" ] || [ "$1" = "-help" ]; then + echo "script to run re-index if the blockchain (in case of repair)" + echo "run to start or monitor re-index progress" + exit 1 +fi + +# check and load raspiblitz config +# to know which network is running +source /mnt/hdd/raspiblitz.conf 2>/dev/null +if [ ${#network} -eq 0 ]; then + echo "FAIL - missing /mnt/hdd/raspiblitz.conf" + exit 1 +fi + +# load raspiblitz.info to know if reindex is already running +source /home/admin/raspiblitz.info 2>/dev/null +if [ ${#state} -eq 0 ]; then + echo "FAIL - missing /home/admin/raspiblitz.info" + exit 1 +fi + +# if re-index is not running, start ... +if [ "${state}" != "reindex" ]; then + + # stop services + echo "making sure services are not running .." + sudo systemctl stop lnd 2>/dev/null + sudo systemctl stop ${network}d 2>/dev/null + + # starting reindex + echo "starting re-index ..." + sudo -u bitcoin /usr/local/bin/${network}d -daemon -reindex -conf=/home/bitcoin/.${network}/${network}.conf -datadir=/home/bitcoin/.${network} + + # set reindex flag in raspiblitz.info (gets deleted after (final) reboot) + sudo sed -i "s/^state=.*/state=reindex/g" /home/admin/raspiblitz.info + +fi + +# while loop to wait to finish +finished=0 +while [ ${finished} -eq 0 ] + do + clear + echo "*************************" + echo "REINDEXING BLOCKCHAIN" + echo "*************************" + echo "THIS CAN TAKE SOME LONG TIME" + echo "If you dont see any progress after 24h press X to stop." + + #TODO: detect and display progress + #TODO: determine when finished and then finished=1 + +done + +# trigger reboot when finished +echo "*************************" +echo "Re-Index finished" +echo "Starting reboot ..." +echo "*************************" +# clean logs (to prevent a false reindex detection) +sudo rm /mnt/hdd/${network}/debug.log +# reboot +sudo shutdown -r now \ No newline at end of file From 6f788591cf682b15e1d027c4dc73091ff903db14 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Mon, 28 Jan 2019 15:51:50 +0100 Subject: [PATCH 35/39] press x to stop monitoring --- home.admin/config.scripts/network.reindex.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/home.admin/config.scripts/network.reindex.sh b/home.admin/config.scripts/network.reindex.sh index 3bbc7be..3646eac 100755 --- a/home.admin/config.scripts/network.reindex.sh +++ b/home.admin/config.scripts/network.reindex.sh @@ -48,11 +48,20 @@ while [ ${finished} -eq 0 ] echo "REINDEXING BLOCKCHAIN" echo "*************************" echo "THIS CAN TAKE SOME LONG TIME" - echo "If you dont see any progress after 24h press X to stop." + echo "If you dont see any progress after 24h keep X pressed to stop." #TODO: detect and display progress #TODO: determine when finished and then finished=1 + # wait 2 seconds for key input + read -n 1 -t 2 keyPressed + + # check if user wants to abort monitor + if [ "${keyPressed}" = "x" ]; then + echo "stopped by user ..." + break + fi + done # trigger reboot when finished From 61f4f6faa5ebfcaa399c9e2261ee7a407dff665e Mon Sep 17 00:00:00 2001 From: rootzoll Date: Mon, 28 Jan 2019 15:55:14 +0100 Subject: [PATCH 36/39] more monitor info --- home.admin/config.scripts/network.reindex.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/home.admin/config.scripts/network.reindex.sh b/home.admin/config.scripts/network.reindex.sh index 3646eac..5758128 100755 --- a/home.admin/config.scripts/network.reindex.sh +++ b/home.admin/config.scripts/network.reindex.sh @@ -47,12 +47,21 @@ while [ ${finished} -eq 0 ] echo "*************************" echo "REINDEXING BLOCKCHAIN" echo "*************************" + date echo "THIS CAN TAKE SOME LONG TIME" echo "If you dont see any progress after 24h keep X pressed to stop." + progress=0 + echo "" + echo "PROGRESS: ${progress}%" + echo "" + #TODO: detect and display progress #TODO: determine when finished and then finished=1 + echo "You can close terminal while reindex is running.." + echo "But you have to login again to check if ready." + # wait 2 seconds for key input read -n 1 -t 2 keyPressed From 8f7e57ddfdeaca9e24e697f8a733721aaf41a81b Mon Sep 17 00:00:00 2001 From: rootzoll Date: Mon, 28 Jan 2019 16:38:44 +0100 Subject: [PATCH 37/39] #287 make sure not to use old tmp value --- home.admin/config.scripts/lnd.setname.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/home.admin/config.scripts/lnd.setname.sh b/home.admin/config.scripts/lnd.setname.sh index a7c1bd6..eab11dd 100644 --- a/home.admin/config.scripts/lnd.setname.sh +++ b/home.admin/config.scripts/lnd.setname.sh @@ -13,6 +13,7 @@ newName=$1 # run interactive if 'turn on' && no further parameters if [ ${#newName} -eq 0 ]; then + sudo rm ./.tmp dialog --backtitle "Set LND Name/Alias" --inputbox "ENTER the new Name/Alias for LND node: (free to choose, one word, use basic characters) " 8 52 2>./.tmp From 77165b9464d9f5fb2d268f6399715facafeb86d8 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Mon, 28 Jan 2019 16:55:51 +0100 Subject: [PATCH 38/39] #287 stopping bitcoind softly --- home.admin/00mainMenu.sh | 19 +++++++++++++------ home.admin/00settingsMenuServices.sh | 4 +++- home.admin/95finalSetup.sh | 1 + home.admin/config.scripts/network.reindex.sh | 3 +++ 4 files changed, 20 insertions(+), 7 deletions(-) diff --git a/home.admin/00mainMenu.sh b/home.admin/00mainMenu.sh index 33fa385..49705cb 100755 --- a/home.admin/00mainMenu.sh +++ b/home.admin/00mainMenu.sh @@ -413,14 +413,21 @@ case $CHOICE in ;; NAME) sudo /home/admin/config.scripts/lnd.setname.sh - echo "Press ENTER to Reboot." - read key - sudo shutdown -r now + noreboot=$? + if [ "${noreboot}" = "0" ]; then + sudo -u bitcoin ${network}-cli stop + echo "Press ENTER to Reboot." + read key + sudo shutdown -r now + else + ./00mainMenu.sh + fi ;; PASSWORD) sudo /home/admin/config.scripts/blitz.setpassword.sh noreboot=$? if [ "${noreboot}" = "0" ]; then + sudo -u bitcoin ${network}-cli stop echo "Press ENTER to Reboot .." read key sudo shutdown -r now @@ -437,10 +444,10 @@ case $CHOICE in echo "-----------------------------------------------" echo "stop lnd - please wait .." sudo systemctl stop lnd - echo "stop bitcoind (1) - please wait .." - sudo -u bitcoin bitcoin-cli stop + echo "stop ${network}d (1) - please wait .." + sudo -u bitcoin ${network}-cli stop sleep 10 - echo "stop bitcoind (2) - please wait .." + echo "stop ${network}d (2) - please wait .." sudo systemctl stop ${network}d echo "starting shutdown" sudo shutdown now diff --git a/home.admin/00settingsMenuServices.sh b/home.admin/00settingsMenuServices.sh index 8d24f30..cae9b7d 100644 --- a/home.admin/00settingsMenuServices.sh +++ b/home.admin/00settingsMenuServices.sh @@ -201,6 +201,8 @@ if [ ${needsReboot} -eq 1 ]; then dialog --pause "OK. System will reboot to activate changes." 8 58 8 clear echo "rebooting .. (please wait)" - sleep 3 + # stop bitcoind + sudo -u bitcoin ${network}-cli stop + sleep 4 sudo shutdown -r now fi \ No newline at end of file diff --git a/home.admin/95finalSetup.sh b/home.admin/95finalSetup.sh index ec0af27..b59676d 100755 --- a/home.admin/95finalSetup.sh +++ b/home.admin/95finalSetup.sh @@ -44,6 +44,7 @@ sudo sed -i "s/^setupStep=.*/setupStep=100/g" /home/admin/raspiblitz.info clear echo "Setup done. Rebooting now." +sudo -u bitcoin ${network}-cli stop sleep 3 sudo shutdown -r now \ No newline at end of file diff --git a/home.admin/config.scripts/network.reindex.sh b/home.admin/config.scripts/network.reindex.sh index 5758128..692d418 100755 --- a/home.admin/config.scripts/network.reindex.sh +++ b/home.admin/config.scripts/network.reindex.sh @@ -78,6 +78,9 @@ echo "*************************" echo "Re-Index finished" echo "Starting reboot ..." echo "*************************" +# stop bitcoind +sudo -u bitcoin ${network}-cli stop +sleep 4 # clean logs (to prevent a false reindex detection) sudo rm /mnt/hdd/${network}/debug.log # reboot From 4a1c33b18607ee3de1be081e73c2e965ac633574 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Wed, 30 Jan 2019 00:37:38 +0100 Subject: [PATCH 39/39] lcd color states --- FAQ.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/FAQ.md b/FAQ.md index fab2e42..661927b 100644 --- a/FAQ.md +++ b/FAQ.md @@ -115,4 +115,16 @@ https://www.addictivetips.com/ubuntu-linux-tips/manually-partition-a-hard-drive- ## How do I shrink the QR code for connecting my Shango/Zap mobile phone? -Make the fonts smaller until the QR code fits into your (fullscreen) terminal. In OSX use `CMD` + `-` key. In LINUX use `CTRL`+ `-` key. On WINDOWS Putty go into the settings and change the font size: https://globedrill.com/change-font-size-putty \ No newline at end of file +Make the fonts smaller until the QR code fits into your (fullscreen) terminal. In OSX use `CMD` + `-` key. In LINUX use `CTRL`+ `-` key. On WINDOWS Putty go into the settings and change the font size: https://globedrill.com/change-font-size-putty + +## Why is my bitcoin IP on the display red? + +The bitcoin IP is red, when the RaspiBlitz detects that it cannot reach the port of bitcoin node from the outside. This means the bitcoin node can peer with other bitcoin nodes, but other bitcoin nodes cannot initiate a peering with you. Dont worry, you dont need a publicly reachable bitcoin node to run a (public) lightning node. If you want to change this however, you need to forward port 8333 on your router to the the RaspiBlitz. How to do this is different on every router. + +## Why is my node address on the display red? + +The node address is red, when the RaspiBlitz detects that it cannot reach the port of the LND node from the outside - when the device is behind a NAT or firewall of the the router. Your node is not publicly reachable. This means you can peer+openChannel with other public nodes, but other nodes cannot peer+openChannel with you. To change this you need to forward port 9735 on your router to the the RaspiBlitz. How to do this is different on every router. + +## Why is my node address on the display yellow (not green)? + +Yellow is OK. The RaspiBlitz can detect, that it can reach a service on the port 9735 of your public IP - this is in most cases the LND of your RaspiBlitz. But the RaspiBlitz cannot 100% for sure detect that this is its own LND service on that port - thats why its just yellow, not green. \ No newline at end of file