From 81cc367c875a10bf4b9f5c3b8e603daf88f837e3 Mon Sep 17 00:00:00 2001 From: openoms Date: Thu, 19 Aug 2021 10:37:16 +0100 Subject: [PATCH] Merge branch 'dev' of https://github.com/rootzoll/raspiblitz into dev --- CHANGES.md | 1 + FAQ.md | 18 +++++---- README.md | 4 +- build_sdcard.sh | 18 ++++----- home.admin/00infoLCD.sh | 2 +- home.admin/_bootstrap.sh | 40 +++++++------------ home.admin/assets/background.service | 4 +- .../bonus.stacking-sats-kraken.sh | 2 +- home.admin/setup.scripts/eventInfoWait.sh | 14 +++++++ 9 files changed, 55 insertions(+), 48 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 56581a897..821a71176 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,6 +6,7 @@ - Update: Pool CLI v0.5.1-alpha [details](https://github.com/lightninglabs/pool/releases/tag/v0.5.1-alpha) - Update: Balance of Satoshis 10.7.8 (BOS) + keep data on reinstall [details](https://github.com/alexbosworth/balanceofsatoshis/blob/master/CHANGELOG.md#version-8010) - Update: mempool space 2.2.1 [details](https://github.com/mempool/mempool) +- Update: stacking-sats-kraken 0.4.4 [details](https://github.com/dennisreimann/stacking-sats-kraken/blob/master/README.md) - Fix: Prevent Pool dataloss on SDcard update [details](https://github.com/rootzoll/raspiblitz/issues/2266) ## What's new in Version 1.7.0 of RaspiBlitz? diff --git a/FAQ.md b/FAQ.md index 0d1d6fac5..9c2b1df37 100644 --- a/FAQ.md +++ b/FAQ.md @@ -7,7 +7,7 @@ - [How to verify the SD card image after download?](#how-to-verify-the-sd-card-image-after-download) - [How to update an old RaspiBlitz BEFORE v1.0? (LEGACY)](#how-to-update-an-old-raspiblitz-before-v10-legacy) - [Why do I need to re-burn my SD card for an update?](#why-do-i-need-to-re-burn-my-sd-card-for-an-update) -- [I have the full blockchain on another computer. How do I copy it to the RaspiBlitz?](#i-have-the-full-blockchain-on-another-computer-how-do-i-copy-it-to-the-raspiblitz) +- [I have the full blockchain on another storage. How do I copy it to the RaspiBlitz?](#i-have-the-full-blockchain-on-another-storage-how-do-i-copy-it-to-the-raspiblitz) - [How do I generate a Debug Report?](#how-do-i-generate-a-debug-report) - [Can I run my RaspiBlitz on Solar Energy?](#can-i-run-my-raspiblitz-on-solar-energy) - [Why is my "final sync" taking so long?](#why-is-my-final-sync-taking-so-long) @@ -55,11 +55,11 @@ - [How do I solve a "signature mismatch after caveat verification" error?](#how-do-i-solve-a-signature-mismatch-after-caveat-verification-error) - [Why is my node not routing?](#why-is-my-node-not-routing) - [How can I update LND or bitcoind even before the next RaspiBlitz update?](#how-can-i-update-lnd-or-bitcoind-even-before-the-next-raspiblitz-update) -- [I cannot connect per SSH to my RaspiBlitz. What can I do?](#i-cannot-connect-per-ssh-to-my-raspiblitz-what-to-do) +- [I cannot connect via SSH to my RaspiBlitz. What do I do?](#i-cannot-connect-via-ssh-to-my-raspiblitz-what-do-i-do) - [How to SSH over Tor?](#how-to-ssh-over-tor) -- [How do I setup port-forwarding with a SSH tunnel?](#how-to-setup-port-forwarding-with-a-ssh-tunnel) -- [How do I setup just a port-forwarding user on my public server?](#how-to-setup-just-a-port-forwarding-user-on-my-public-server) -- [How do I connect a UPS to the RaspiBlitz?](#how-to-connect-a-ups-to-the-raspiblitz) +- [How to setup port-forwarding with a SSH tunnel?](#how-to-setup-port-forwarding-with-a-ssh-tunnel) +- [How do I setup just a port-forwarding user on my public server?](#how-do-i-setup-just-a-port-forwarding-user-on-my-public-server) +- [How do I connect a UPS to the RaspiBlitz?](#how-do-i-connect-a-ups-to-the-raspiblitz) - [Why use BTRFS on RaspiBlitz?](#why-use-btrfs-on-raspiblitz) - [Storing your important Data in RAID1 with a USB Thumb Drive](#storing-your-important-data-in-raid1-with-a-usb-thumb-drive) - [Snapshotting the Blockchain](#snapshotting-the-blockchain) @@ -170,15 +170,17 @@ Of course, people should modify the system, add own scripts, etc ... but if you *BTW there is a beneficial side effect when updating with a new SD card: You also get rid of any malware or system bloat that happened 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? +## I have the full blockchain on another storage. 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 or replacing a corrupted blockchain with a fresh one. Also that way you have synced and verified the blockchain yourself, and are not trusting the RaspiBlitz Torrent downloads (Don't trust, verify). +Copying a already synced blockchain from another storage (e.g. your Laptop or external hard drive) can be a quick way to get the RaspiBlitz started or replacing a corrupted blockchain with a fresh one. Also that way you have synced and verified the blockchain yourself, and are not trusting the RaspiBlitz Torrent downloads (Don't trust, verify). One requirement is that the blockchain is from another bitcoin-core client with version greater or equal to 0.17.1. But we don't copy the data via USB to the device, because the HDD needs to be formatted in EXT4 and that is usually not read/writable by Windows or Mac computers. So I will explain a way to copy the data through 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) need to be connected to the same local network. Make sure that bitcoind/bitcoin-qt is stopped on the computer containing the blockchain. If your blockchain source is another RaspiBlitz with v1.5 or higher - go to `REPAIR` > `COPY-SOURCE`. If your RaspiBlitz is below v1.5 then on the terminal `sudo systemctl stop bitcoind` and then go to the directory where the blockchain data is with `cd /mnt/hdd/bitcoin` - when the 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) need to be connected to the same local network. Make sure that bitcoind/bitcoin-qt is stopped on the computer containing the blockchain. +If your blockchain source is another RaspiBlitz v1.5 or higher - go to `REPAIR` > `COPY-SOURCE`. +If your RaspiBlitz is below v1.5 then on the terminal `sudo systemctl stop bitcoind` and then go to the directory where the blockchain data is with `cd /mnt/hdd/bitcoin` - when the copy/transfer is done later reboot a RaspiBlitz source with `sudo shutdown -r now`. If everything described above is in order, start the setup of the new RaspiBlitz with a fresh SD card (like explained in the README) - it's 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 transfer 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/README.md b/README.md index 232e1242e..44bbfdc36 100644 --- a/README.md +++ b/README.md @@ -270,9 +270,9 @@ With the new RaspberryPi 4 (with SSD & min 2GB RAM) this is the best way to go. First you need to download & validate the blockchain on your own computer/laptop. Todo so install bitcoin-core (0.18.1 or higher) from [bitcoin.org](https://bitcoin.org/en/download) and keep it running until blockchain is synced (will need around 320 GB). -Then you can use the COPY option to copy the blockchain over to the RaspiBlitz. This will be done over the local network by SCP (SSH file transfer) - follow the instructions given during the dialog. +Then you can use the COPY option to copy the blockchain over to the RaspiBlitz. This will be done over the local network by SCP (SSH file transfer) - follow the instructions given in the dialogs. -It's advised to keep the bitcoin-core & the blockchain data as a backup on the laptop in case you need to re-setup the RaspiBlitz. +It's advised to keep a backup of the bitcoin-core & the blockchain data (e.g. on your laptop) in case you need to re-setup the RaspiBlitz. More details: [I have the full blockchain on another computer. How do I copy it to the RaspiBlitz?](FAQ.md#i-have-the-full-blockchain-on-another-computer-how-do-i-copy-it-to-the-raspiblitz) diff --git a/build_sdcard.sh b/build_sdcard.sh index c2039a1a1..64b141c57 100755 --- a/build_sdcard.sh +++ b/build_sdcard.sh @@ -363,7 +363,7 @@ fi echo "" echo "*** CONFIG ***" -# based on https://github.com/Stadicus/guides/blob/master/raspibolt/raspibolt_20_pi.md#raspi-config +# based on https://stadicus.github.io/RaspiBolt/raspibolt_20_pi.html#raspi-config # set new default password for root user echo "root:raspiblitz" | sudo chpasswd @@ -475,7 +475,7 @@ sudo service rsyslog restart echo "" echo "*** SOFTWARE UPDATE ***" -# based on https://github.com/Stadicus/guides/blob/master/raspibolt/raspibolt_20_pi.md#software-update +# based on https://stadicus.github.io/RaspiBolt/raspibolt_20_pi.html#software-update # installs like on RaspiBolt sudo apt install -y htop git curl bash-completion vim jq dphys-swapfile bsdmainutils @@ -541,7 +541,7 @@ sudo apt -y autoremove echo "" echo "*** ADDING MAIN USER admin ***" -# based on https://github.com/Stadicus/guides/blob/master/raspibolt/raspibolt_20_pi.md#adding-main-user-admin +# based on https://stadicus.github.io/RaspiBolt/raspibolt_20_pi.html#add-users # using the default password 'raspiblitz' sudo adduser --disabled-password --gecos "" admin @@ -561,7 +561,7 @@ sudo chmod 755 /home/admin/raspiblitz.info echo "" echo "*** ADDING SERVICE USER bitcoin" -# based on https://github.com/Stadicus/guides/blob/master/raspibolt/raspibolt_20_pi.md#adding-the-service-user-bitcoin +# based on https://stadicus.github.io/RaspiBolt/raspibolt_20_pi.html#add-users # create user and set default password for user sudo adduser --disabled-password --gecos "" bitcoin @@ -681,7 +681,7 @@ sudo bash -c "echo '# Raspiblitz' >> /home/admin/.bashrc" echo "" echo "*** SWAP FILE ***" -# based on https://github.com/Stadicus/guides/blob/master/raspibolt/raspibolt_20_pi.md#moving-the-swap-file +# based on https://stadicus.github.io/RaspiBolt/raspibolt_20_pi.html#move-swap-file # but just deactivating and deleting old (will be created alter when user adds HDD) sudo dphys-swapfile swapoff @@ -689,7 +689,7 @@ sudo dphys-swapfile uninstall echo "" echo "*** INCREASE OPEN FILE LIMIT ***" -# based on https://github.com/Stadicus/guides/blob/master/raspibolt/raspibolt_20_pi.md#increase-your-open-files-limit +# based on https://stadicus.github.io/RaspiBolt/raspibolt_21_security.html#increase-your-open-files-limit sudo sed --in-place -i "56s/.*/* soft nofile 128000/" /etc/security/limits.conf sudo bash -c "echo '* hard nofile 128000' >> /etc/security/limits.conf" @@ -820,7 +820,7 @@ sudo cp /home/admin/assets/background.service /etc/systemd/system/background.ser sudo systemctl enable background # "*** BITCOIN ***" -# based on https://github.com/Stadicus/guides/blob/master/raspibolt/raspibolt_30_bitcoin.md#installation +# based on https://stadicus.github.io/RaspiBolt/raspibolt_30_bitcoin.html#installation echo "" echo "*** PREPARING BITCOIN ***" @@ -936,7 +936,7 @@ echo "" echo "*** PREPARING LIGHTNING ***" # "*** LND ***" -## based on https://github.com/Stadicus/guides/blob/master/raspibolt/raspibolt_40_lnd.md#lightning-lnd +## based on https://stadicus.github.io/RaspiBolt/raspibolt_40_lnd.html#lightning-lnd ## see LND releases: https://github.com/lightningnetwork/lnd/releases lndVersion="0.13.1-beta" @@ -1180,4 +1180,4 @@ if [ "${displayClass}" != "headless" ] || [ "${baseimage}" = "raspbian" ] || [ " sudo /home/admin/config.scripts/blitz.display.sh set-display ${displayClass} fi -echo "# BUILD DONE - see above" \ No newline at end of file +echo "# BUILD DONE - see above" diff --git a/home.admin/00infoLCD.sh b/home.admin/00infoLCD.sh index e87a6079a..bf86150cd 100755 --- a/home.admin/00infoLCD.sh +++ b/home.admin/00infoLCD.sh @@ -18,7 +18,7 @@ function usage() { # Default Values verbose=0 -pause=12 +pause=3 # this is used by touchscreen and command 'status' # TODO: remove on v1.8 diff --git a/home.admin/_bootstrap.sh b/home.admin/_bootstrap.sh index dd5889f12..ae323b5a6 100755 --- a/home.admin/_bootstrap.sh +++ b/home.admin/_bootstrap.sh @@ -151,24 +151,6 @@ else echo "No SSHRESET switch found. " >> $logFile fi -################################ -# BACKGROUND TASK RUN FROM BEGINNING -# on 1.7 sd card build background task runs after boostrap -# but bootstrap already needs background task running now -# REMOVE ON v1.8 release #2328 -################################ - -backgroundNeedsEdit=$(sudo cat /etc/systemd/system/background.service 2>/dev/null | grep -c 'Wants=bootstrap.service') -if [ ${backgroundNeedsEdit} -eq 1 ]; then - echo "BACKGROUND EDIT needed ..." >> $logFile - sudo sed -i "s/^Wants=.*/Wants=network.target/g" /etc/systemd/system/background.service - sudo sed -i "s/^After=.*/After=network.target/g" /etc/systemd/system/background.service - systemInitReboot=1 - sed -i "s/^message=.*/message='BACKGROUND EDIT'/g" ${infoFile} -else - echo "BACKGROUND EDIT already done. " >> $logFile -fi - ################################ # FS EXPAND # if a file called 'ssh.reset' gets @@ -215,9 +197,8 @@ fi if [ "${systemInitReboot}" == "1" ]; then sudo cp ${logFile} ${logFile}.systeminit - sudo sed -i "s/^state=.*/state=initreboot/g" ${infoFile} - sleep 60 - sudo sed -i "s/^state=.*/state=reboot/g" ${infoFile} + sudo sed -i "s/^state=.*/state=reboot-init/g" ${infoFile} + sleep 8 sudo shutdown -r now sleep 100 exit 0 @@ -338,10 +319,8 @@ source <(sudo /home/admin/config.scripts/blitz.datadrive.sh uasp-fix) if [ "${neededReboot}" == "1" ]; then echo "UASP FIX applied (2nd-try) ... reboot needed." >> $logFile sudo cp ${logFile} ${logFile}.uasp - sudo sed -i "s/^state=.*/state=uaspreboot/g" ${infoFile} - sed -i "s/^message=.*/message='UASP2'/g" ${infoFile} - sleep 60 sudo sed -i "s/^state=.*/state=reboot/g" ${infoFile} + sleep 8 sudo shutdown -r now sleep 100 exit 0 @@ -454,12 +433,23 @@ if [ ${isMounted} -eq 0 ]; then sed -i "s/^state=.*/state=errorHDD/g" ${infoFile} sed -i "s/^message=.*/message='lost HDD - rebooting'/g" ${infoFile} sudo cp ${logFile} ${logFile}.error - sleep 60 + sleep 8 sudo shutdown -r now sleep 100 exit 0 fi + # detect if network get deconnected again + # --> "removing network cable" can be used as signal to shutdown clean on test startup + source <(/home/admin/config.scripts/internet.sh status) + if [ "${localip}" == "" ]; then + sed -i "s/^state=.*/state=errorNetwork/g" ${infoFile} + sleep 8 + sudo shutdown now + sleep 100 + exit 0 + fi + # give the loop a little bed time sleep 4 diff --git a/home.admin/assets/background.service b/home.admin/assets/background.service index 83c6e13c1..b6c5e4d64 100644 --- a/home.admin/assets/background.service +++ b/home.admin/assets/background.service @@ -3,8 +3,8 @@ [Unit] Description=RaspiBlitz Background Monitoring Service -Wants=bootstrap.service -After=bootstrap.service +Wants=network.target +After=network.target # for use with sendmail alert (coming soon) #OnFailure=systemd-sendmail@%n diff --git a/home.admin/config.scripts/bonus.stacking-sats-kraken.sh b/home.admin/config.scripts/bonus.stacking-sats-kraken.sh index f4f0c6e47..1cdd2cf6f 100755 --- a/home.admin/config.scripts/bonus.stacking-sats-kraken.sh +++ b/home.admin/config.scripts/bonus.stacking-sats-kraken.sh @@ -9,7 +9,7 @@ CONFIG_FILE=$APP_DATA_DIR/.env RASPIBLITZ_FILE=/mnt/hdd/raspiblitz.conf SCRIPT_DIR=$HOME_DIR/stacking-sats-kraken SCRIPT_NAME=stacksats.sh -SCRIPT_VERSION=0.4.3 +SCRIPT_VERSION=0.4.4 # command info if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then diff --git a/home.admin/setup.scripts/eventInfoWait.sh b/home.admin/setup.scripts/eventInfoWait.sh index 969fd3a19..9e9818ad6 100644 --- a/home.admin/setup.scripts/eventInfoWait.sh +++ b/home.admin/setup.scripts/eventInfoWait.sh @@ -58,6 +58,12 @@ elif [ "${eventID}" == "reboot" ]; then Shutting down for reboot. " 5 30 +elif [ "${eventID}" == "reboot-init" ]; then + + dialog --backtitle "${backtitle}" --cr-wrap --infobox " +Rebooting for Setup (${contentString}) +" 5 30 + elif [ "${eventID}" == "error" ] && [ "${mode}" == "lcd" ]; then dialog --backtitle "${backtitle}" --cr-wrap --infobox " @@ -273,6 +279,14 @@ Detailed Error Message: ${contentString} " 7 35 +elif [ "${eventID}" == "errorNetwork" ]; then + + dialog --backtitle "${backtitle}" --cr-wrap --infobox " +PROBLEM: LOST NETWORK +Shutting down ... +Manual restart needed. +" 7 35 + elif [ "${eventID}" == "sdtoosmall" ]; then # contentWords[0] --> size string (for example '16GB')