From 7d8140599ef870411af4bed3e23a62989e9085d2 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Thu, 31 Jan 2019 21:10:01 +0100 Subject: [PATCH 01/23] #298 update to lndconnect --- home.admin/97addMobileWalletZap.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/home.admin/97addMobileWalletZap.sh b/home.admin/97addMobileWalletZap.sh index a764e1e..bcc3f5f 100755 --- a/home.admin/97addMobileWalletZap.sh +++ b/home.admin/97addMobileWalletZap.sh @@ -25,7 +25,7 @@ if [ ${goInstalled} -eq 0 ];then goInstalled=$(go version 2>/dev/null | grep -c 'go') fi if [ ${goInstalled} -eq 0 ];then - echo "FAIL: Was not able to install GO (needed to run ZapConnect)" + echo "FAIL: Was not able to install GO (needed to run LndConnect)" exit 1 fi @@ -35,11 +35,11 @@ echo "*** Setup ***" echo "" echo "Installing zapconnect. Please wait..." echo "" -echo "Getting github.com/LN-Zap/zapconnect (please wait) ..." -go get -d github.com/LN-Zap/zapconnect -cd $GOPATH/src/github.com/LN-Zap/zapconnect +echo "Getting github.com/LN-Zap/lndconnect (please wait) ..." +go get -d github.com/LN-Zap/lndconnect +cd $GOPATH/src/github.com/LN-Zap/lndconnect echo "" -echo "Building github.com/LN-Zap/zapconnect ..." +echo "Building github.com/LN-Zap/lndconnect ..." make cd sleep 3 @@ -69,11 +69,11 @@ clear echo "*** STEP 2 : Click on Scan (make whole QR code fill camera) ***" if [ ${#dynDomain} -eq 0 ]; then - # If you drop the -i parameter, zapconnect will use the external IP. - zapconnect -i + # If you drop the -i parameter, lndconnect will use the external IP. + zapconnect -j -i else # when dynamic domain is set - zapconnect --host=${dynDomain} + zapconnect -j --host=${dynDomain} fi echo "(To shrink QR code: OSX->CMD- / LINUX-> CTRL-) Press ENTER when finished." @@ -82,5 +82,5 @@ read key clear echo "If its not working - check issues on GitHub:" echo "https://github.com/LN-Zap/zap-iOS/issues" -echo "https://github.com/LN-Zap/zapconnect/issues" +echo "https://github.com/LN-Zap/lndconnect/issues" echo "" From b9139d1a33a32435e5bc6de212258ed8aca179db Mon Sep 17 00:00:00 2001 From: rootzoll Date: Thu, 31 Jan 2019 21:14:55 +0100 Subject: [PATCH 02/23] lndconnect fix --- home.admin/97addMobileWalletZap.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/home.admin/97addMobileWalletZap.sh b/home.admin/97addMobileWalletZap.sh index bcc3f5f..18b1e09 100755 --- a/home.admin/97addMobileWalletZap.sh +++ b/home.admin/97addMobileWalletZap.sh @@ -70,10 +70,10 @@ echo "*** STEP 2 : Click on Scan (make whole QR code fill camera) ***" if [ ${#dynDomain} -eq 0 ]; then # If you drop the -i parameter, lndconnect will use the external IP. - zapconnect -j -i + lndconnect -j -i else # when dynamic domain is set - zapconnect -j --host=${dynDomain} + lndconnect -j --host=${dynDomain} fi echo "(To shrink QR code: OSX->CMD- / LINUX-> CTRL-) Press ENTER when finished." From e976e34e3d84f66fd86add661828e5bc53fef7b6 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Thu, 31 Jan 2019 21:17:55 +0100 Subject: [PATCH 03/23] lndconnect fix --- home.admin/97addMobileWalletZap.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/home.admin/97addMobileWalletZap.sh b/home.admin/97addMobileWalletZap.sh index 18b1e09..f1161c1 100755 --- a/home.admin/97addMobileWalletZap.sh +++ b/home.admin/97addMobileWalletZap.sh @@ -70,10 +70,10 @@ echo "*** STEP 2 : Click on Scan (make whole QR code fill camera) ***" if [ ${#dynDomain} -eq 0 ]; then # If you drop the -i parameter, lndconnect will use the external IP. - lndconnect -j -i + lndconnect -i else # when dynamic domain is set - lndconnect -j --host=${dynDomain} + lndconnect --host=${dynDomain} fi echo "(To shrink QR code: OSX->CMD- / LINUX-> CTRL-) Press ENTER when finished." From 7677f655cfc267b486cbccfdeaaef8f8a43f7655 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Fri, 1 Feb 2019 13:58:44 +0100 Subject: [PATCH 04/23] monitor progress --- home.admin/config.scripts/network.reindex.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/home.admin/config.scripts/network.reindex.sh b/home.admin/config.scripts/network.reindex.sh index 692d418..e46088a 100755 --- a/home.admin/config.scripts/network.reindex.sh +++ b/home.admin/config.scripts/network.reindex.sh @@ -41,6 +41,7 @@ fi # while loop to wait to finish finished=0 +progress=0 while [ ${finished} -eq 0 ] do clear @@ -51,9 +52,13 @@ while [ ${finished} -eq 0 ] echo "THIS CAN TAKE SOME LONG TIME" echo "If you dont see any progress after 24h keep X pressed to stop." - progress=0 + # get blockchain sync progress + blockchaininfo=$(sudo -u bitcoin ${network}-cli -datadir=/home/bitcoin/.${network} getblockchaininfo) + progress="$(echo "${blockchaininfo}" | jq -r '.verificationprogress')" + progress=$(echo "${progress}*100" | bc) + echo "" - echo "PROGRESS: ${progress}%" + echo "PROGRESS: ${progress}" echo "" #TODO: detect and display progress From 26cad6c6ef5cf908cd9d6bfea5d7e43c1fe2a546 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Fri, 1 Feb 2019 14:00:32 +0100 Subject: [PATCH 05/23] progress monitoring --- home.admin/config.scripts/network.reindex.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/home.admin/config.scripts/network.reindex.sh b/home.admin/config.scripts/network.reindex.sh index e46088a..55d924f 100755 --- a/home.admin/config.scripts/network.reindex.sh +++ b/home.admin/config.scripts/network.reindex.sh @@ -56,9 +56,11 @@ while [ ${finished} -eq 0 ] blockchaininfo=$(sudo -u bitcoin ${network}-cli -datadir=/home/bitcoin/.${network} getblockchaininfo) progress="$(echo "${blockchaininfo}" | jq -r '.verificationprogress')" progress=$(echo "${progress}*100" | bc) + inprogress="$(echo "${blockchaininfo}" | jq -r '.initialblockdownload')" echo "" echo "PROGRESS: ${progress}" + echo "running: ${inprogress}" echo "" #TODO: detect and display progress From c5e08620f656a517748ad6005ba89132543fcb74 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Fri, 1 Feb 2019 14:02:11 +0100 Subject: [PATCH 06/23] fix monitor progress --- home.admin/config.scripts/network.reindex.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home.admin/config.scripts/network.reindex.sh b/home.admin/config.scripts/network.reindex.sh index 55d924f..a4b4592 100755 --- a/home.admin/config.scripts/network.reindex.sh +++ b/home.admin/config.scripts/network.reindex.sh @@ -54,7 +54,7 @@ while [ ${finished} -eq 0 ] # get blockchain sync progress blockchaininfo=$(sudo -u bitcoin ${network}-cli -datadir=/home/bitcoin/.${network} getblockchaininfo) - progress="$(echo "${blockchaininfo}" | jq -r '.verificationprogress')" + progress=$(echo "${blockchaininfo}" | jq -r '.verificationprogress') progress=$(echo "${progress}*100" | bc) inprogress="$(echo "${blockchaininfo}" | jq -r '.initialblockdownload')" From 72dea6bceaf5115027ac01307212543149817453 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Fri, 1 Feb 2019 14:05:02 +0100 Subject: [PATCH 07/23] fix monitoring --- home.admin/config.scripts/network.reindex.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home.admin/config.scripts/network.reindex.sh b/home.admin/config.scripts/network.reindex.sh index a4b4592..24c7126 100755 --- a/home.admin/config.scripts/network.reindex.sh +++ b/home.admin/config.scripts/network.reindex.sh @@ -55,7 +55,7 @@ while [ ${finished} -eq 0 ] # get blockchain sync progress blockchaininfo=$(sudo -u bitcoin ${network}-cli -datadir=/home/bitcoin/.${network} getblockchaininfo) progress=$(echo "${blockchaininfo}" | jq -r '.verificationprogress') - progress=$(echo "${progress}*100" | bc) + #progress=$(echo "${progress}*100" | bc) inprogress="$(echo "${blockchaininfo}" | jq -r '.initialblockdownload')" echo "" From dc3ff2f0abc0a602d8ec2fdf39d96a0f600f38ac Mon Sep 17 00:00:00 2001 From: rootzoll Date: Fri, 1 Feb 2019 14:18:09 +0100 Subject: [PATCH 08/23] debug finsih condition --- home.admin/config.scripts/network.reindex.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/home.admin/config.scripts/network.reindex.sh b/home.admin/config.scripts/network.reindex.sh index 24c7126..40b5e53 100755 --- a/home.admin/config.scripts/network.reindex.sh +++ b/home.admin/config.scripts/network.reindex.sh @@ -57,6 +57,9 @@ while [ ${finished} -eq 0 ] progress=$(echo "${blockchaininfo}" | jq -r '.verificationprogress') #progress=$(echo "${progress}*100" | bc) inprogress="$(echo "${blockchaininfo}" | jq -r '.initialblockdownload')" + if [ "${inprogress}" = "true" ]; then + finished=1 + fi echo "" echo "PROGRESS: ${progress}" From f0335579575e68d08375c71864a06b386a19fc57 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Fri, 1 Feb 2019 14:22:34 +0100 Subject: [PATCH 09/23] added finish condition --- home.admin/config.scripts/network.reindex.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/home.admin/config.scripts/network.reindex.sh b/home.admin/config.scripts/network.reindex.sh index 40b5e53..ee11705 100755 --- a/home.admin/config.scripts/network.reindex.sh +++ b/home.admin/config.scripts/network.reindex.sh @@ -57,18 +57,15 @@ while [ ${finished} -eq 0 ] progress=$(echo "${blockchaininfo}" | jq -r '.verificationprogress') #progress=$(echo "${progress}*100" | bc) inprogress="$(echo "${blockchaininfo}" | jq -r '.initialblockdownload')" - if [ "${inprogress}" = "true" ]; then + if [ "${inprogress}" = "false" ]; then finished=1 fi echo "" + echo "RUNNING: ${inprogress}" echo "PROGRESS: ${progress}" - echo "running: ${inprogress}" 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." @@ -83,9 +80,14 @@ while [ ${finished} -eq 0 ] done + # trigger reboot when finished echo "*************************" -echo "Re-Index finished" +if [ ${finished} -eq 0 ]; then + echo "Re-Index CANCELED" +else + echo "Re-Index finished" +fi echo "Starting reboot ..." echo "*************************" # stop bitcoind From c20ee69beb78e6e347bf7ca80ac4d5fe0c2bdbb0 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Fri, 1 Feb 2019 14:28:35 +0100 Subject: [PATCH 10/23] update RTL to v0.1.13-alpha --- home.admin/config.scripts/bonus.rtl.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home.admin/config.scripts/bonus.rtl.sh b/home.admin/config.scripts/bonus.rtl.sh index 05ecb59..edc9733 100755 --- a/home.admin/config.scripts/bonus.rtl.sh +++ b/home.admin/config.scripts/bonus.rtl.sh @@ -45,7 +45,7 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then echo "*** Get the RTL Source Code ***" git clone https://github.com/ShahanaFarooqui/RTL.git cd RTL - git reset --hard v0.1.12-alpha + git reset --hard v0.1.13-alpha # install echo "*** Run: npm install ***" From 9d12c9f5aa49f9fc8afaea6a5ca6629cc801b0ee Mon Sep 17 00:00:00 2001 From: Rytis Bieliauskas Date: Sat, 2 Feb 2019 03:20:39 +0200 Subject: [PATCH 11/23] Fixed typos / punctuation. --- FAQ.md | 54 +++++++++++++++++++++++++----------------------------- 1 file changed, 25 insertions(+), 29 deletions(-) diff --git a/FAQ.md b/FAQ.md index 007a9ba..b4db9eb 100644 --- a/FAQ.md +++ b/FAQ.md @@ -2,7 +2,7 @@ ## How to update my RaspiBlitz (AFTER version 0.98)? -*Notice: Please be sure that your base image you started with was version 0.98 or greater. If you used the now deprecated XXupdateScripts.sh script to update before, you might have started with an older base image. If you never run that script, your good.* +*Notice: Please be sure that your base image you started with was version 0.98 or greater. If you used the now deprecated XXupdateScripts.sh script to update before, you might have started with an older base image. If you never run that script, you're good.* To prepare the RaspiBlitz update: @@ -10,80 +10,76 @@ To prepare the RaspiBlitz update: - remove power - remove SD card -Now download the new RaspiBlitz SD card image and write it to your SD card .. yes you simply overwrite the old one, its OK all your personal data is on the HDD (if you havent done any manual changes to the system). See details about latest SD card image here: https://github.com/rootzoll/raspiblitz#scenario-2-start-at-home +Now download the new RaspiBlitz SD card image and write it to your SD card .. yes you simply overwrite the old one, it's OK, all your personal data is on the HDD (if you haven't done any manual changes to the system). See details about latest SD card image here: https://github.com/rootzoll/raspiblitz#scenario-2-start-at-home -If done successful simple put the SD card into the RaspiBlitz and power on again. Then follow the instructions on the display ... and dont worry you dont need to redownload the blockchain again. +If done successfully, simply put the SD card into the RaspiBlitz and power on again. Then follow the instructions on the display ... and dont worry, you dont need to re-download the blockchain again. ## How to update my RaspiBlitz (BEFORE version 0.98)? -Before version 0.98 you need to setup a new RaspiBlitz. So close all channels. Remove all funds from your Raspiblitz (cash-out). Go into terminal and run: `sudo /home/admin/XXleanHDD.sh` and then `sudo shutdown now`. This way you keep your blockchain data on the HDD, but your HDD is cleaned. Now follow again: https://github.com/rootzoll/raspiblitz#scenario-2-start-at-home +You need to setup a new RaspiBlitz. So close all channels. Remove all funds from your Raspiblitz (cash-out). Go into terminal and run: `sudo /home/admin/XXleanHDD.sh` and then `sudo shutdown now`. This way you keep your blockchain data on the HDD, but your HDD is cleaned. Now follow again: https://github.com/rootzoll/raspiblitz#scenario-2-start-at-home ## Why do I need to re-burn my SD card for an update (AFTER version 0.98)? -I know it would be nicer to run just an update script and you are ready to go. But then the scripts would need to be written in a much more complex way to be able to work with any versions of LND and Bitcoind (they are already complex enough with all the edge cases) and testing would become even more time consuming as it is now already. Thats nothing a single developer can deliver. +I know it would be nicer to run just an update script and you are ready to go. But then the scripts would need to be written in a much more complex way to be able to work with any versions of LND and Bitcoind (they are already complex enough with all the edge cases) and testing would become even more time consuming than it is now already. That's nothing a single developer can deliver. -For some it might be a pain point to make a update by re-burning a new sd card - especially if you added own scripts or made changes to the system -> but thats by design. Its a way to enforce a "clean state" with every update - the same state that I tested and developed the scripts against. The reason for that pain: I simply cannot write and support scripts that run on every modified system forever - thats simply too much work. +For some, it might be a pain point to make an update by re-burning a new sd card - especially if you added your own scripts or made changes to the system - but thats by design. It's a way to enforce a "clean state" with every update - the same state that I tested and developed the scripts with. The reason for that pain: I simply cannot write and support scripts that run on every modified system forever - that's simply too much work. With the SD card update mechanism I reduce complexity, I deliver a "clean state" OS, LND/Bitcoind and the scripts tightly bundled together exactly in the dependency/combination like I tested them and its much easier to reproduce bug reports and give support that way. -Of course people should modify the system, add own scripts, etc ... but if you want also benefit of the updates of the RaspiBlitz you have two ways to do it: +Of course, people should modify the system, add own scripts, etc ... but if you want to also have the benefit of the updates of the RaspiBlitz, you have two ways to do it: 1. Contribute your changes back to the main project as pull requests so that they become part of the next update - the next SD card release. -2. Make your changes so that they survive an SD card update easily -> put all your scripts and extra data onto the HDD AND document for yourself how to activate them again after an update. +2. Make your changes so that they survive an SD card update easily - put all your scripts and extra data onto the HDD AND document for yourself how to activate them again after an update. -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 :) +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 :) ## 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. +CAUTION: Restoring a backup can lead to LOSS OF ALL CHANNEL FUNDS if it's not the latest channel state. There is no perfect backup solution for lightning nodes yet - this topic is in development by the community. But there is one safe way to start: Store your LND wallet seed (list of words you got on wallet creation) in a safe place. Its the key to recover access to your on-chain funds - your coins that are not bound in an active channel. -Recovering the coins that you have in a active channel is a bit more complicated. Because you have to be sure that you really have an up to date backup of your channel state data. The problem is: If you post an old state of your channel this looks to the network like you want to cheat and your channel partner is allowed claim all the funds in the channel. +Recovering the coins that you have in an active channel is a bit more complicated. Because you have to be sure that you really have an up to date backup of your channel state data. The problem is: If you post an old state of your channel, to the network this looks like an atempt to cheat, and your channel partner is allowed claim all the funds in the channel. -To really have a good backup to rely on such feature needs to be part of the LND software. Almost every other solution would not be perfect. Thats why RaspiBlitz is not trying to provide a backup feature at the moment. +To really have a reliable backup, such feature needs to be part of the LND software. Almost every other solution would not be perfect. Thats why RaspiBlitz is not trying to provide a backup feature at the moment. 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. +Use the "Change Name/Alias of Node" option in the main menu. The RaspiBlitz will make a reboot after this. ## What to do when on SSH I see "WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!" This means, that he public ssh key of the RaspiBlitz has changed to the one you logged in the last time under that IP. -Its OK when happening during an update - when you changed the sd card image. If its really happening out of the blue - check your local network setup for a second. Maybe the local IP of your RaspiBlitz changed? Is there a second RaspiBlitz connected? Its a security warning, so at least take some time to check if anything is strange. But also dont get to panic - when its in your local network, normally its some network thing - not an intruder. +It's OK when happening during an update - when you changed the sd card image. If it's really happening out of the blue - check your local network setup for a second. Maybe the local IP of your RaspiBlitz changed? Is there a second RaspiBlitz connected? It's a security warning, so at least take some time to check if anything is strange. But also don't get to panic - when it's in your local network, normally it's some network thing - not an intruder. -To fix this and to be able to login with SSH again, you have to remove the old public key for that IP from your local client computer. Just run the following command (with the replaced IP of your RaspiBlitz): `ssh-keygen -R IP-OF-YOUR-RASPIBLITZ` or remove the line for this IP manually from the known_hosts file (path see in warning message). +To fix this and to be able to login with SSH again, you have to remove the old public key for that IP from your local client computer. Just run the following command (with the replaced IP of your RaspiBlitz): `ssh-keygen -R IP-OF-YOUR-RASPIBLITZ` or remove the line for this IP manually from the known_hosts file (see the path to the file in the warning message). -After that you should be able to login with SSH again. +After that, you should be able to login with SSH again. -## When using Auto-Unlock, which security do I loose? +## When using Auto-Unlock, how much security do I lose? -The idea of the "wallet lock" in general is that your privatekey/seed/wallet is stored in a encrypted way on your HDD. On every you restart you have to input the password once manually (unlock your wallet), so that the LND can again read and write to the encrypted wallet. This gives you security if your RaspiBlitz gets stolen or taken away - it looses power and then your wallet is safe - the attacker cannot access your wallet. +The idea of the "wallet lock" in general, is that your private key / seed / wallet is stored in a encrypted way on your HDD. On every restart, you have to input the password once manually (unlock your wallet), so that the LND can read and write to the encrypted wallet again. This improves your security if your RaspiBlitz gets stolen or taken away - it loses power and then your wallet is safe - the attacker cannot access your wallet. -When you activate the "Auto-Unlock" feature of the RaspiBlitz, the password of the wallet gets stored on the RaspiBlitz. So for an attacker stealing the RaspiBlitz physically its now possible to find the password and unlock the wallet. +When you activate the "Auto-Unlock" feature of the RaspiBlitz, the password of the wallet gets stored on the RaspiBlitz. So if an attacker steals the RaspiBlitz physically, it's now possible for them to find the password and unlock the wallet. ## I connected my HDD but it still says 'Connect HDD' on the display? -Your HDD may have no partitions yet. SSH into the RaspiBlitz as admin (see command and password on display) and you should get offert the option to create a partition. If this is not the case: +Your HDD may have no partitions yet. SSH into the RaspiBlitz as admin (see command and password on display) and you should be offered the option to create a partition. If this is not the case: -Check/Exchange the USB cable. Connect the HDD to another computer and check if it shows up at all .. +Check/Exchange the USB cable. Connect the HDD to another computer and check if it shows up at all. OSX: https://www.howtogeek.com/212836/how-to-use-your-macs-disk-utility-to-partition-wipe-repair-restore-and-copy-drives/ -Windows: -https://www.lifewire.com/how-to-open-disk-management-2626080 +Windows: https://www.lifewire.com/how-to-open-disk-management-2626080 -Linux/Ubuntu (desktop): -https://askubuntu.com/questions/86724/how-do-i-open-the-disk-utility-in-unity +Linux/Ubuntu (desktop): https://askubuntu.com/questions/86724/how-do-i-open-the-disk-utility-in-unity -Linux/Raspbian (command line): -https://www.addictivetips.com/ubuntu-linux-tips/manually-partition-a-hard-drive-command-line-linux/ +Linux/Raspbian (command line): https://www.addictivetips.com/ubuntu-linux-tips/manually-partition-a-hard-drive-command-line-linux/ ## 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 From aef51566d302dc4e45315e115f265473a85f90ac Mon Sep 17 00:00:00 2001 From: rootzoll Date: Sat, 2 Feb 2019 23:21:29 +0100 Subject: [PATCH 12/23] #293 make sure raspiblitz.info has network/chain --- home.admin/_bootstrap.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/home.admin/_bootstrap.sh b/home.admin/_bootstrap.sh index ac4cab2..206154f 100644 --- a/home.admin/_bootstrap.sh +++ b/home.admin/_bootstrap.sh @@ -321,7 +321,30 @@ fi # SD INFOFILE BASICS ################################ +# state info sed -i "s/^state=.*/state=ready/g" ${infoFile} sed -i "s/^message=.*/message='waiting login'/g" ${infoFile} + +# determine network and chain from system + +# check for BITCOIN +loaded=$(sudo systemctl status bitcoind | grep -c 'loaded') +if [ ${loaded} -gt 0 ]; then + sed -i "s/^network=.*/chain=bitcoin/g" ${infoFile} + source /mnt/hdd/bitcoin/bitcoin.conf + if [ ${testnet} -gt 0 ]; then + sed -i "s/^chain=.*/chain=test/g" ${infoFile} + else + sed -i "s/^chain=.*/chain=main/g" ${infoFile} + fi +fi + +# check for LITECOIN +loaded=$(sudo systemctl status litecoind | grep -c 'loaded') +if [ ${loaded} -gt 0 ]; then + sed -i "s/^network=.*/chain=litecoin/g" ${infoFile} + sed -i "s/^chain=.*/chain=main/g" ${infoFile} +fi + echo "DONE BOOTSTRAP" >> $logFile exit 0 \ No newline at end of file From a5b0f542338e6d23665bb97c8127ad920c2abc63 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Sat, 2 Feb 2019 23:27:13 +0100 Subject: [PATCH 13/23] fix network/chain detection --- home.admin/_bootstrap.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/home.admin/_bootstrap.sh b/home.admin/_bootstrap.sh index 206154f..dcd01f2 100644 --- a/home.admin/_bootstrap.sh +++ b/home.admin/_bootstrap.sh @@ -330,7 +330,7 @@ sed -i "s/^message=.*/message='waiting login'/g" ${infoFile} # check for BITCOIN loaded=$(sudo systemctl status bitcoind | grep -c 'loaded') if [ ${loaded} -gt 0 ]; then - sed -i "s/^network=.*/chain=bitcoin/g" ${infoFile} + sed -i "s/^network=.*/network=bitcoin/g" ${infoFile} source /mnt/hdd/bitcoin/bitcoin.conf if [ ${testnet} -gt 0 ]; then sed -i "s/^chain=.*/chain=test/g" ${infoFile} @@ -342,7 +342,7 @@ fi # check for LITECOIN loaded=$(sudo systemctl status litecoind | grep -c 'loaded') if [ ${loaded} -gt 0 ]; then - sed -i "s/^network=.*/chain=litecoin/g" ${infoFile} + sed -i "s/^network=.*/network=litecoin/g" ${infoFile} sed -i "s/^chain=.*/chain=main/g" ${infoFile} fi From b29c65a72a560714535393daeec7bdb77b2d9dde Mon Sep 17 00:00:00 2001 From: rootzoll Date: Sat, 2 Feb 2019 23:49:04 +0100 Subject: [PATCH 14/23] #293 .info before .conf --- home.admin/00settingsMenuServices.sh | 2 ++ home.admin/20recoverDialog.sh | 1 + home.admin/80scanLND.sh | 3 +++ home.admin/97addMobileWallet.sh | 1 + home.admin/97addMobileWalletShango.sh | 3 ++- home.admin/97addMobileWalletZap.sh | 1 + home.admin/AAunlockLND.sh | 3 ++- home.admin/BBcashoutWallet.sh | 3 ++- home.admin/BBcloseAllChannels.sh | 3 ++- home.admin/BBconnectPeer.sh | 3 ++- home.admin/BBcreateInvoice.sh | 3 ++- home.admin/BBfundWallet.sh | 3 ++- home.admin/BBopenChannel.sh | 3 ++- home.admin/BBpayInvoice.sh | 3 ++- home.admin/XXdebugLogs.sh | 3 ++- home.admin/_background.sh | 2 ++ home.admin/config.scripts/blitz.setpassword.sh | 3 ++- home.admin/config.scripts/bonus.rtl.sh | 1 + home.admin/config.scripts/internet.tor.sh | 1 + home.admin/config.scripts/lnd.autonat.sh | 1 + home.admin/config.scripts/lnd.autopilot.sh | 1 + home.admin/config.scripts/lnd.export.sh | 3 ++- home.admin/config.scripts/network.chain.sh | 5 +++-- home.admin/config.scripts/network.reindex.sh | 3 ++- 24 files changed, 43 insertions(+), 15 deletions(-) diff --git a/home.admin/00settingsMenuServices.sh b/home.admin/00settingsMenuServices.sh index cae9b7d..4cf7b2f 100644 --- a/home.admin/00settingsMenuServices.sh +++ b/home.admin/00settingsMenuServices.sh @@ -2,7 +2,9 @@ # get raspiblitz config echo "get raspiblitz config" +source /home/admin/raspiblitz.info source /mnt/hdd/raspiblitz.conf + echo "services default values" if [ ${#autoPilot} -eq 0 ]; then autoPilot="off"; fi if [ ${#autoUnlock} -eq 0 ]; then autoUnlock="off"; fi diff --git a/home.admin/20recoverDialog.sh b/home.admin/20recoverDialog.sh index 52ecd89..d9cce91 100755 --- a/home.admin/20recoverDialog.sh +++ b/home.admin/20recoverDialog.sh @@ -1,6 +1,7 @@ #!/bin/bash ## get basic info +source /home/admin/raspiblitz.info source /mnt/hdd/raspiblitz.conf # show password info dialog diff --git a/home.admin/80scanLND.sh b/home.admin/80scanLND.sh index 81c6263..f3ba72e 100755 --- a/home.admin/80scanLND.sh +++ b/home.admin/80scanLND.sh @@ -1,3 +1,6 @@ +#!/bin/bash + +source /home/admin/raspiblitz.info source /mnt/hdd/raspiblitz.conf ### USER PI AUTOSTART (LCD Display) diff --git a/home.admin/97addMobileWallet.sh b/home.admin/97addMobileWallet.sh index 0d1992d..0d53805 100644 --- a/home.admin/97addMobileWallet.sh +++ b/home.admin/97addMobileWallet.sh @@ -1,6 +1,7 @@ #!/bin/bash # get raspiblitz config +source /home/admin/raspiblitz.info source /mnt/hdd/raspiblitz.conf # check if dynamic domain is set diff --git a/home.admin/97addMobileWalletShango.sh b/home.admin/97addMobileWalletShango.sh index bff9ec5..3070efb 100644 --- a/home.admin/97addMobileWalletShango.sh +++ b/home.admin/97addMobileWalletShango.sh @@ -1,6 +1,7 @@ #!/bin/bash -# load raspiblitz config data (with backup from old config) +# load raspiblitz config data +source /home/admin/raspiblitz.info source /mnt/hdd/raspiblitz.conf # make sure qrcode-encoder in installed diff --git a/home.admin/97addMobileWalletZap.sh b/home.admin/97addMobileWalletZap.sh index f1161c1..116db47 100755 --- a/home.admin/97addMobileWalletZap.sh +++ b/home.admin/97addMobileWalletZap.sh @@ -1,6 +1,7 @@ #!/bin/bash # load raspiblitz config data +source /home/admin/raspiblitz.info source /mnt/hdd/raspiblitz.conf # export go vars (if needed) diff --git a/home.admin/AAunlockLND.sh b/home.admin/AAunlockLND.sh index 6c37ff0..9698fca 100755 --- a/home.admin/AAunlockLND.sh +++ b/home.admin/AAunlockLND.sh @@ -1,7 +1,8 @@ #!/bin/bash # load raspiblitz config data (with backup from old config) -source /mnt/hdd/raspiblitz.conf 2>/dev/null +source /home/admin/raspiblitz.info +source /mnt/hdd/raspiblitz.conf if [ ${#network} -eq 0 ]; then network=`cat .network`; fi if [ ${#network} -eq 0 ]; then network="bitcoin"; fi if [ ${#chain} -eq 0 ]; then diff --git a/home.admin/BBcashoutWallet.sh b/home.admin/BBcashoutWallet.sh index c34f097..5766b29 100755 --- a/home.admin/BBcashoutWallet.sh +++ b/home.admin/BBcashoutWallet.sh @@ -5,7 +5,8 @@ _error="./.error.out" echo "please wait ..." # load raspiblitz config data (with backup from old config) -source /mnt/hdd/raspiblitz.conf 2>/dev/null +source /home/admin/raspiblitz.info +source /mnt/hdd/raspiblitz.conf if [ ${#network} -eq 0 ]; then network=`cat .network`; fi if [ ${#network} -eq 0 ]; then network="bitcoin"; fi if [ ${#chain} -eq 0 ]; then diff --git a/home.admin/BBcloseAllChannels.sh b/home.admin/BBcloseAllChannels.sh index 5d06697..af849a1 100755 --- a/home.admin/BBcloseAllChannels.sh +++ b/home.admin/BBcloseAllChannels.sh @@ -1,7 +1,8 @@ #!/bin/bash # load raspiblitz config data (with backup from old config) -source /mnt/hdd/raspiblitz.conf 2>/dev/null +source /home/admin/raspiblitz.info +source /mnt/hdd/raspiblitz.conf if [ ${#network} -eq 0 ]; then network=`cat .network`; fi if [ ${#network} -eq 0 ]; then network="bitcoin"; fi if [ ${#chain} -eq 0 ]; then diff --git a/home.admin/BBconnectPeer.sh b/home.admin/BBconnectPeer.sh index f721e89..3d3b67c 100755 --- a/home.admin/BBconnectPeer.sh +++ b/home.admin/BBconnectPeer.sh @@ -3,7 +3,8 @@ _temp="./download/dialog.$$" _error="./.error.out" # load raspiblitz config data (with backup from old config) -source /mnt/hdd/raspiblitz.conf 2>/dev/null +source /home/admin/raspiblitz.info +source /mnt/hdd/raspiblitz.conf if [ ${#network} -eq 0 ]; then network=`cat .network`; fi if [ ${#network} -eq 0 ]; then network="bitcoin"; fi if [ ${#chain} -eq 0 ]; then diff --git a/home.admin/BBcreateInvoice.sh b/home.admin/BBcreateInvoice.sh index 797070c..1f8fef8 100755 --- a/home.admin/BBcreateInvoice.sh +++ b/home.admin/BBcreateInvoice.sh @@ -4,7 +4,8 @@ _error="./.error.out" sudo chmod 7777 ${_error} # load raspiblitz config data (with backup from old config) -source /mnt/hdd/raspiblitz.conf 2>/dev/null +source /home/admin/raspiblitz.info +source /mnt/hdd/raspiblitz.conf if [ ${#network} -eq 0 ]; then network=`cat .network`; fi if [ ${#network} -eq 0 ]; then network="bitcoin"; fi if [ ${#chain} -eq 0 ]; then diff --git a/home.admin/BBfundWallet.sh b/home.admin/BBfundWallet.sh index 0278f2e..4e995f3 100755 --- a/home.admin/BBfundWallet.sh +++ b/home.admin/BBfundWallet.sh @@ -1,7 +1,8 @@ #!/bin/bash # load raspiblitz config data (with backup from old config) -source /mnt/hdd/raspiblitz.conf 2>/dev/null +source /home/admin/raspiblitz.info +source /mnt/hdd/raspiblitz.conf if [ ${#network} -eq 0 ]; then network=`cat .network`; fi if [ ${#network} -eq 0 ]; then network="bitcoin"; fi if [ ${#chain} -eq 0 ]; then diff --git a/home.admin/BBopenChannel.sh b/home.admin/BBopenChannel.sh index 559a599..c0804db 100755 --- a/home.admin/BBopenChannel.sh +++ b/home.admin/BBopenChannel.sh @@ -3,7 +3,8 @@ _temp="./download/dialog.$$" _error="./.error.out" # load raspiblitz config data (with backup from old config) -source /mnt/hdd/raspiblitz.conf 2>/dev/null +source /home/admin/raspiblitz.info +source /mnt/hdd/raspiblitz.conf if [ ${#network} -eq 0 ]; then network=`cat .network`; fi if [ ${#network} -eq 0 ]; then network="bitcoin"; fi if [ ${#chain} -eq 0 ]; then diff --git a/home.admin/BBpayInvoice.sh b/home.admin/BBpayInvoice.sh index f076bd2..a11af79 100755 --- a/home.admin/BBpayInvoice.sh +++ b/home.admin/BBpayInvoice.sh @@ -3,7 +3,8 @@ _temp="./download/dialog.$$" _error="./.error.out" # load raspiblitz config data (with backup from old config) -source /mnt/hdd/raspiblitz.conf 2>/dev/null +source /home/admin/raspiblitz.info +source /mnt/hdd/raspiblitz.conf if [ ${#network} -eq 0 ]; then network=`cat .network`; fi if [ ${#network} -eq 0 ]; then network="bitcoin"; fi if [ ${#chain} -eq 0 ]; then diff --git a/home.admin/XXdebugLogs.sh b/home.admin/XXdebugLogs.sh index 477d74f..c494ac2 100644 --- a/home.admin/XXdebugLogs.sh +++ b/home.admin/XXdebugLogs.sh @@ -6,7 +6,8 @@ source /home/admin/_version.info ## get basic info (its OK if not set yet) -source /mnt/hdd/raspiblitz.conf 2>/dev/null +source /home/admin/raspiblitz.info +source /mnt/hdd/raspiblitz.conf # for old nodes if [ ${#network} -eq 0 ]; then diff --git a/home.admin/_background.sh b/home.admin/_background.sh index 03d31bc..21d2153 100644 --- a/home.admin/_background.sh +++ b/home.admin/_background.sh @@ -16,6 +16,8 @@ configFile="/mnt/hdd/raspiblitz.conf" configExists=$(ls ${configFile} | grep -c '.conf') if [ ${configExists} -eq 1 ]; then source ${configFile} +else + source ${infoFile} fi echo "_background.sh STARTED" diff --git a/home.admin/config.scripts/blitz.setpassword.sh b/home.admin/config.scripts/blitz.setpassword.sh index 316b71e..21cd629 100644 --- a/home.admin/config.scripts/blitz.setpassword.sh +++ b/home.admin/config.scripts/blitz.setpassword.sh @@ -18,7 +18,8 @@ fi _temp="./dialog.$$" # load raspiblitz config (if available) -source /mnt/hdd/raspiblitz.conf 2>/dev/null +source /home/admin/raspiblitz.info +source /mnt/hdd/raspiblitz.conf if [ ${#network} -eq 0 ]; then network="bitcoin" fi diff --git a/home.admin/config.scripts/bonus.rtl.sh b/home.admin/config.scripts/bonus.rtl.sh index edc9733..8bc9183 100755 --- a/home.admin/config.scripts/bonus.rtl.sh +++ b/home.admin/config.scripts/bonus.rtl.sh @@ -9,6 +9,7 @@ fi # check and load raspiblitz config # to know which network is running +source /home/admin/raspiblitz.info source /mnt/hdd/raspiblitz.conf if [ ${#network} -eq 0 ]; then echo "FAIL - missing /mnt/hdd/raspiblitz.conf" diff --git a/home.admin/config.scripts/internet.tor.sh b/home.admin/config.scripts/internet.tor.sh index 3c331f7..9749e5b 100755 --- a/home.admin/config.scripts/internet.tor.sh +++ b/home.admin/config.scripts/internet.tor.sh @@ -14,6 +14,7 @@ fi # check and load raspiblitz config # to know which network is running +source /home/admin/raspiblitz.info source /mnt/hdd/raspiblitz.conf if [ ${#network} -eq 0 ]; then echo "FAIL - missing /mnt/hdd/raspiblitz.conf" diff --git a/home.admin/config.scripts/lnd.autonat.sh b/home.admin/config.scripts/lnd.autonat.sh index fe22886..f87eae1 100644 --- a/home.admin/config.scripts/lnd.autonat.sh +++ b/home.admin/config.scripts/lnd.autonat.sh @@ -27,6 +27,7 @@ echo "making sure services are not running" sudo systemctl stop lnd 2>/dev/null # add default value to raspi config if needed +source /home/admin/raspiblitz.info source /mnt/hdd/raspiblitz.conf if [ ${#autoNatDiscovery} -eq 0 ]; then echo "autoNatDiscovery=off" >> /mnt/hdd/raspiblitz.conf diff --git a/home.admin/config.scripts/lnd.autopilot.sh b/home.admin/config.scripts/lnd.autopilot.sh index 8a74bcf..42cbc05 100644 --- a/home.admin/config.scripts/lnd.autopilot.sh +++ b/home.admin/config.scripts/lnd.autopilot.sh @@ -28,6 +28,7 @@ if [ ${valueExists} -eq 0 ]; then fi # add default value to raspi config if needed +source /home/admin/raspiblitz.info source /mnt/hdd/raspiblitz.conf if [ ${#autoPilot} -eq 0 ]; then echo "autoPilot=off" >> /mnt/hdd/raspiblitz.conf diff --git a/home.admin/config.scripts/lnd.export.sh b/home.admin/config.scripts/lnd.export.sh index 2ec06f4..0201766 100644 --- a/home.admin/config.scripts/lnd.export.sh +++ b/home.admin/config.scripts/lnd.export.sh @@ -42,7 +42,8 @@ if [ "$1" = "" ] || [ $# -eq 0 ]; then fi # load data from config -source /mnt/hdd/raspiblitz.conf 2>/dev/null +source /home/admin/raspiblitz.info +source /mnt/hdd/raspiblitz.conf ######################## # CANCEL diff --git a/home.admin/config.scripts/network.chain.sh b/home.admin/config.scripts/network.chain.sh index 77323eb..d10568b 100755 --- a/home.admin/config.scripts/network.chain.sh +++ b/home.admin/config.scripts/network.chain.sh @@ -15,9 +15,10 @@ fi # check and load raspiblitz config # to know which network is running -source /mnt/hdd/raspiblitz.conf 2>/dev/null +source /home/admin/raspiblitz.info +source /mnt/hdd/raspiblitz.conf if [ ${#network} -eq 0 ]; then - echo "FAIL - missing /mnt/hdd/raspiblitz.conf" + echo "FAIL - missing network info" exit 1 fi diff --git a/home.admin/config.scripts/network.reindex.sh b/home.admin/config.scripts/network.reindex.sh index ee11705..881e753 100755 --- a/home.admin/config.scripts/network.reindex.sh +++ b/home.admin/config.scripts/network.reindex.sh @@ -9,7 +9,8 @@ fi # check and load raspiblitz config # to know which network is running -source /mnt/hdd/raspiblitz.conf 2>/dev/null +source /home/admin/raspiblitz.info +source /mnt/hdd/raspiblitz.conf if [ ${#network} -eq 0 ]; then echo "FAIL - missing /mnt/hdd/raspiblitz.conf" exit 1 From ca12fdfd7734ef1603c09a3ab7c1adca3875b14d Mon Sep 17 00:00:00 2001 From: rootzoll Date: Sun, 3 Feb 2019 00:08:25 +0100 Subject: [PATCH 15/23] #301 check dynDNS not static --- home.admin/00infoBlitz.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home.admin/00infoBlitz.sh b/home.admin/00infoBlitz.sh index 21d464d..da69057 100755 --- a/home.admin/00infoBlitz.sh +++ b/home.admin/00infoBlitz.sh @@ -192,7 +192,7 @@ else if [ ${#dynDomain} -gt 0 ]; then #check if dyndns resolves to correct IP - ipOfDynDNS=$(getent hosts rootzoll.chickenkiller.com | awk '{ print $1 }') + ipOfDynDNS=$(getent hosts ${dynDomain} | awk '{ print $1 }') if [ "${ipOfDynDNS}:${public_port}" != "${public_addr}" ]; then public_color="${color_red}" else From 79e075b206af52b653656f2805b30cb789e6b49c Mon Sep 17 00:00:00 2001 From: rootzoll Date: Sun, 3 Feb 2019 20:58:44 +0100 Subject: [PATCH 16/23] dont overwrite setupstep when loading raspiblitz.conf --- home.admin/00mainMenu.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/home.admin/00mainMenu.sh b/home.admin/00mainMenu.sh index 49705cb..ff87d81 100755 --- a/home.admin/00mainMenu.sh +++ b/home.admin/00mainMenu.sh @@ -91,9 +91,8 @@ fi if [ "${state}" = "ready" ]; then configExists=$(ls ${configFile} | grep -c '.conf') if [ ${configExists} -eq 1 ]; then - echo "setup is done - loading config data" + echo "loading config data" source ${configFile} - setupStep=100 else echo "setup still in progress - setupStep(${setupStep})" fi From 144789dd14dcb44aba5f2cedc9c48286945551c5 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Sun, 3 Feb 2019 22:55:26 +0100 Subject: [PATCH 17/23] info about long torrent download --- FAQ.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/FAQ.md b/FAQ.md index 661927b..d06b6f4 100644 --- a/FAQ.md +++ b/FAQ.md @@ -46,6 +46,10 @@ If everything of the above is prepared, start the setup of the new RaspiBlitz wi 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 taking my torrent download of the blockchain so long? + +Its a lot of data and torrent seeds can not be garantuued. Normally it should be done within 24 hours. If it takes longer then 2 days consider to abort the torrent download by pressing 'x' and choose FTP download as fallback ... will also take some time, but should be more stable. If even that is not working - choose SYNC option, which will take over a week, but is the classic way to get the blockchain thru the bitcoin peer2peer network. + ## 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. From ddb935bdec94faf1ec4643636d9cc451b6723eda Mon Sep 17 00:00:00 2001 From: rootzoll Date: Sun, 3 Feb 2019 23:22:58 +0100 Subject: [PATCH 18/23] #293 moving raspiblitz.conf creation after HDD gets added --- home.admin/40addHDD.sh | 16 +++++++++++++--- home.admin/95finalSetup.sh | 10 ---------- home.admin/_bootstrap.sh | 1 + 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/home.admin/40addHDD.sh b/home.admin/40addHDD.sh index 2d35c7b..7bdad82 100755 --- a/home.admin/40addHDD.sh +++ b/home.admin/40addHDD.sh @@ -2,7 +2,7 @@ echo "" ## get basic info -source /home/admin/raspiblitz.info 2>/dev/null +source /home/admin/raspiblitz.info echo "*** Adding HDD to the System ***" echo "started from state(${state})" @@ -14,7 +14,7 @@ if [ ${existsHDD} -gt 0 ]; then if [ ${mountOK} -eq 1 ]; then echo "FAIL - HDD is already mounted" echo "If you want to add HDD freshly to the system, then unmount the HDD first and try again" - else + else echo "" echo "*** Check HDD ***" formatExt4OK=$(lsblk -o UUID,NAME,FSTYPE,SIZE,LABEL,MODEL | grep BLOCKCHAIN | grep -c ext4) @@ -30,7 +30,7 @@ if [ ${existsHDD} -gt 0 ]; then echo ${fstabAdd} # adding the new line after line 3 to the /etc/fstab sudo sed "3 a ${fstabAdd}" -i /etc/fstab - else + else echo "UUID is already in /etc/fstab" fi fstabOK=$(cat /etc/fstab | grep -c ${uuid}) @@ -45,6 +45,16 @@ if [ ${existsHDD} -gt 0 ]; then echo "OK - HDD is mounted" echo "" + # init the RASPIBLITZ Config + source /home/admin/_version.info + configFile="/mnt/hdd/raspiblitz.conf" + echo "# RASPIBLITZ CONFIG FILE" > $configFile + echo "raspiBlitzVersion='${codeVersion}'" >> $configFile + echo "network=${network}" >> $configFile + echo "chain=${chain}" >> $configFile + echo "hostname=${hostname}" >> $configFile + sudo chmod 777 ${configFile} + # move SSH pub keys to HDD so that they survive an update echo "moving SSH pub keys to HDD" sudo cp -r /etc/ssh /mnt/hdd/ssh diff --git a/home.admin/95finalSetup.sh b/home.admin/95finalSetup.sh index b59676d..2dea167 100755 --- a/home.admin/95finalSetup.sh +++ b/home.admin/95finalSetup.sh @@ -19,16 +19,6 @@ dialog --backtitle "RaspiBlitz - Setup" --title " RaspiBlitz Setup is done :) " Press OK for a final reboot. " 10 42 -# init the RASPIBLITZ Config -echo "# RASPIBLITZ CONFIG FILE" > $configFile -echo "raspiBlitzVersion='${codeVersion}'" >> $configFile -sudo chmod 777 ${configFile} - -# transfer data from SD info file -echo "hostname=${hostname}" >> $configFile -echo "network=${network}" >> $configFile -echo "chain=${chain}" >> $configFile - # let migration/init script do the rest /home/admin/_bootstrap.migration.sh diff --git a/home.admin/_bootstrap.sh b/home.admin/_bootstrap.sh index dcd01f2..653b41e 100644 --- a/home.admin/_bootstrap.sh +++ b/home.admin/_bootstrap.sh @@ -51,6 +51,7 @@ echo "message=" >> $infoFile echo "network=${network}" >> $infoFile echo "chain=${chain}" >> $infoFile echo "setupStep=${setupStep}" >> $infoFile +echo "hostname=${hostname}" >> $infoFile sudo chmod 777 ${infoFile} ################################ From 8e32d9c346b2572b97c2c3d9136daa26a8077fcf Mon Sep 17 00:00:00 2001 From: rootzoll Date: Mon, 4 Feb 2019 02:36:00 +0100 Subject: [PATCH 19/23] test TOR fix --- build.sdcard/raspbianStretchDesktop.sh | 26 ++++++------- home.admin/config.scripts/internet.tor.sh | 46 +---------------------- 2 files changed, 15 insertions(+), 57 deletions(-) diff --git a/build.sdcard/raspbianStretchDesktop.sh b/build.sdcard/raspbianStretchDesktop.sh index 74516ee..1ed6d54 100644 --- a/build.sdcard/raspbianStretchDesktop.sh +++ b/build.sdcard/raspbianStretchDesktop.sh @@ -495,20 +495,20 @@ sudo cp ./assets/background.service /etc/systemd/system/background.service sudo systemctl enable background # Prepare for TOR service -echo "*** Adding Tor Sources to sources.list ***" -echo "deb http://deb.torproject.org/torproject.org stretch main" | sudo tee -a /etc/apt/sources.list -echo "deb-src http://deb.torproject.org/torproject.org stretch main" | sudo tee -a /etc/apt/sources.list -echo "OK" -echo "" -echo "*** Installing dirmngr ***" +#echo "*** Adding Tor Sources to sources.list ***" +#echo "deb https://deb.torproject.org/torproject.org stretch main" | sudo tee -a /etc/apt/sources.list +#echo "deb-src https://deb.torproject.org/torproject.org stretch main" | sudo tee -a /etc/apt/sources.list +#echo "OK" +#echo "" +#echo "*** Installing dirmngr ***" sudo apt install dirmngr -echo "" -echo "*** Fetching GPG key ***" -sudo gpg --keyserver keys.gnupg.net --recv 886DDD89 -sudo gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | sudo apt-key add - -sudo gpg --keyserver pgpkeys.mit.edu --recv-key 74A941BA219EC810 -sudo gpg -a --export 74A941BA219EC810 | sudo apt-key add - -echo "!!!!!! Please check if the above really worked!" +#echo "" +#echo "*** Fetching GPG key (for TOR install) ***" +#sudo gpg --keyserver keys.gnupg.net --recv 886DDD89 +#sudo gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | sudo apt-key add - +#sudo gpg --keyserver pgpkeys.mit.edu --recv-key 74A941BA219EC810 +#sudo gpg -a --export 74A941BA219EC810 | sudo apt-key add - +#echo "!!!!!! Please check if the above really worked!" # *** RASPIBLITZ IMAGE READY *** echo "" diff --git a/home.admin/config.scripts/internet.tor.sh b/home.admin/config.scripts/internet.tor.sh index 9749e5b..eee1559 100755 --- a/home.admin/config.scripts/internet.tor.sh +++ b/home.admin/config.scripts/internet.tor.sh @@ -61,7 +61,8 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then echo "" echo "*** Install Tor ***" - sudo apt install tor tor-arm -y + sudo apt-get install tor + #sudo apt install tor tor-arm -y echo "" echo "*** Tor Config ***" @@ -134,21 +135,6 @@ EOF sudo systemctl enable tor@default echo "" - #echo "*** Waiting for TOR to boostrap ***" - #torIsBootstrapped=0 - #while [ ${torIsBootstrapped} -eq 0 ] - #do - # echo "--- Checking 1 ---" - # date +%s - # sudo cat /mnt/hdd/tor/notice.log 2>/dev/null | grep "Bootstrapped" | tail -n 10 - # torIsBootstrapped=$(sudo cat /mnt/hdd/tor/notice.log 2>/dev/null | grep "Bootstrapped 100" -c) - # echo "torIsBootstrapped(${torIsBootstrapped})" - # echo "If this takes too long --> CTRL+c, reboot and check manually" - # sleep 5 - #done - #echo "OK - Tor Bootstrap is ready" - #echo "" - echo "*** Changing ${network} Config ***" networkIsTor=$(sudo cat /home/bitcoin/.${network}/${network}.conf | grep 'onlynet=onion' -c) if [ ${networkIsTor} -eq 0 ]; then @@ -172,34 +158,6 @@ EOF echo "Chain network already configured for TOR" fi - #echo "*** ${network} re-init - Waiting for Onion Address ***" - # restarting bitcoind to start with tor and generare onion.address - #echo "restarting ${network}d ..." - #sudo systemctl restart ${network}d - #sleep 8 - #onionAddress="" - #while [ ${#onionAddress} -eq 0 ] - #do - # echo "--- Checking 2 ---" - # date +%s - # testNetAdd="" - # if [ "${chain}" = "test" ];then - # testNetAdd="/testnet3" - # fi - # sudo cat /mnt/hdd/${network}${testNetAdd}/debug.log 2>/dev/null | grep "tor" | tail -n 10 - # onionAddress=$(sudo -u bitcoin ${network}-cli getnetworkinfo | grep '"address"' | cut -d '"' -f4) - # echo "Can take up to 20min - if this takes longer --> CTRL+c, reboot and check manually" - # sleep 5 - #done - #onionPort=$(sudo -u bitcoin ${network}-cli getnetworkinfo | grep '"port"' | tr -dc '0-9') - #echo "Your Chain Network Onion Address is: ${onionAddress}:${onionPort}" - #echo "" - - #echo "*** Setting your Onion Address ***" - #onionLND=$(sudo cat /mnt/hdd/tor/lnd9735/hostname) - #echo "Your Lightning Tor Onion Address is: ${onionLND}:9735" - #echo "" - # ACTIVATE LND OVER TOR echo "*** Putting LND behind TOR ***" echo "Make sutre LND is disabled" From c785a3d6d9b16c701474e9b6177de706e4fc19fc Mon Sep 17 00:00:00 2001 From: rootzoll Date: Mon, 4 Feb 2019 03:31:14 +0100 Subject: [PATCH 20/23] dont overwrite raspiblitz.conf on update --- home.admin/40addHDD.sh | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/home.admin/40addHDD.sh b/home.admin/40addHDD.sh index 7bdad82..0e5e5ff 100755 --- a/home.admin/40addHDD.sh +++ b/home.admin/40addHDD.sh @@ -42,18 +42,25 @@ if [ ${existsHDD} -gt 0 ]; then sudo mount -a mountOK=$(df | grep -c /mnt/hdd) if [ ${mountOK} -eq 1 ]; then + echo "OK - HDD is mounted" echo "" - # init the RASPIBLITZ Config - source /home/admin/_version.info - configFile="/mnt/hdd/raspiblitz.conf" - echo "# RASPIBLITZ CONFIG FILE" > $configFile - echo "raspiBlitzVersion='${codeVersion}'" >> $configFile - echo "network=${network}" >> $configFile - echo "chain=${chain}" >> $configFile - echo "hostname=${hostname}" >> $configFile - sudo chmod 777 ${configFile} + # init the RASPIBLITZ Config (if not exist on provision) + configExists=$(sudo ls /mnt/hdd/raspiblitz.conf | grep -c 'raspiblitz.conf') + if [ ${configExists} -eq 0 ]; then + echo "Creating raspiblitz.conf on HDD" + source /home/admin/_version.info + configFile="/mnt/hdd/raspiblitz.conf" + echo "# RASPIBLITZ CONFIG FILE" > $configFile + echo "raspiBlitzVersion='${codeVersion}'" >> $configFile + echo "network=${network}" >> $configFile + echo "chain=${chain}" >> $configFile + echo "hostname=${hostname}" >> $configFile + sudo chmod 777 ${configFile} + echo "OK" + echo "" + fi # move SSH pub keys to HDD so that they survive an update echo "moving SSH pub keys to HDD" From 4ed14930f341963938fe55698bb3e76d5da4160e Mon Sep 17 00:00:00 2001 From: rootzoll Date: Mon, 4 Feb 2019 11:33:35 +0100 Subject: [PATCH 21/23] make sure setup and upadte set setupstep=100 --- home.admin/90finishSetup.sh | 2 +- home.admin/95finalSetup.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/home.admin/90finishSetup.sh b/home.admin/90finishSetup.sh index b68ba08..3309840 100755 --- a/home.admin/90finishSetup.sh +++ b/home.admin/90finishSetup.sh @@ -87,4 +87,4 @@ sudo apt-get update echo "OK - System is now up to date" # mark setup is done -sudo sed -i "s/^setupStep=.*/setupStep=90/g" /home/admin/raspiblitz.info \ No newline at end of file +sudo sed -i "s/^setupStep=.*/setupStep=100/g" /home/admin/raspiblitz.info \ No newline at end of file diff --git a/home.admin/95finalSetup.sh b/home.admin/95finalSetup.sh index 2dea167..a9dca34 100755 --- a/home.admin/95finalSetup.sh +++ b/home.admin/95finalSetup.sh @@ -29,7 +29,7 @@ cp $logFile /home/admin/raspiblitz.setup.log echo "Setting the Name/Alias/Hostname .." sudo /home/admin/config.scripts/lnd.setname.sh ${hostname} -# mark setup is done (100%) +# mark setup is done sudo sed -i "s/^setupStep=.*/setupStep=100/g" /home/admin/raspiblitz.info clear From c775f823358099b7f3f72c9793f898e69caf5f0f Mon Sep 17 00:00:00 2001 From: rootzoll Date: Mon, 4 Feb 2019 11:40:17 +0100 Subject: [PATCH 22/23] hostname just during seup in raspibliz.info --- home.admin/_bootstrap.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/home.admin/_bootstrap.sh b/home.admin/_bootstrap.sh index 653b41e..2df4234 100644 --- a/home.admin/_bootstrap.sh +++ b/home.admin/_bootstrap.sh @@ -51,7 +51,9 @@ echo "message=" >> $infoFile echo "network=${network}" >> $infoFile echo "chain=${chain}" >> $infoFile echo "setupStep=${setupStep}" >> $infoFile -echo "hostname=${hostname}" >> $infoFile +if [ "${setupStep}" != "100" ]; then + echo "hostname=${hostname}" >> $infoFile +fi sudo chmod 777 ${infoFile} ################################ From 19c1f0394d9cba7485f6ba52ee6b059cae667732 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Mon, 4 Feb 2019 22:32:46 +0100 Subject: [PATCH 23/23] moving tor install prep into config script --- build.sdcard/raspbianStretchDesktop.sh | 16 --- home.admin/config.scripts/internet.tor.sh | 157 ++++++++++++++-------- 2 files changed, 102 insertions(+), 71 deletions(-) diff --git a/build.sdcard/raspbianStretchDesktop.sh b/build.sdcard/raspbianStretchDesktop.sh index 1ed6d54..ca8aca7 100644 --- a/build.sdcard/raspbianStretchDesktop.sh +++ b/build.sdcard/raspbianStretchDesktop.sh @@ -494,22 +494,6 @@ sudo chmod +x /home/admin/_background.sh sudo cp ./assets/background.service /etc/systemd/system/background.service sudo systemctl enable background -# Prepare for TOR service -#echo "*** Adding Tor Sources to sources.list ***" -#echo "deb https://deb.torproject.org/torproject.org stretch main" | sudo tee -a /etc/apt/sources.list -#echo "deb-src https://deb.torproject.org/torproject.org stretch main" | sudo tee -a /etc/apt/sources.list -#echo "OK" -#echo "" -#echo "*** Installing dirmngr ***" -sudo apt install dirmngr -#echo "" -#echo "*** Fetching GPG key (for TOR install) ***" -#sudo gpg --keyserver keys.gnupg.net --recv 886DDD89 -#sudo gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | sudo apt-key add - -#sudo gpg --keyserver pgpkeys.mit.edu --recv-key 74A941BA219EC810 -#sudo gpg -a --export 74A941BA219EC810 | sudo apt-key add - -#echo "!!!!!! Please check if the above really worked!" - # *** RASPIBLITZ IMAGE READY *** echo "" echo "**********************************************" diff --git a/home.admin/config.scripts/internet.tor.sh b/home.admin/config.scripts/internet.tor.sh index eee1559..340a966 100755 --- a/home.admin/config.scripts/internet.tor.sh +++ b/home.admin/config.scripts/internet.tor.sh @@ -56,25 +56,61 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then echo "" fi - echo "*** Updating System ***" - sudo apt-get update - echo "" + # check if TOR package is installed + packageInstalled=$(dpkg -s tor-arm | grep -c 'Status: install ok') + if [ ${packageInstalled} -eq 0 ]; then + + # Prepare for TOR service + echo "*** Install TOR repo keys ***" + + recvKeyResult=$(sudo gpg --keyserver keys.gnupg.net --recv 886DDD89 2>&1) + echo "${recvKeyResult}" + recvKeyFailed=$(echo "${recvKeyResult}" | grep -c 'Total number processed: 0') + if [ ${recvKeyFailed} -eq 1 ]; then + echo "FAILED: sudo gpg --keyserver keys.gnupg.net --recv 886DDD89" + exit 1 + fi + sudo gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | sudo apt-key add - + echo "" + + recvKeyResult=$(sudo gpg --keyserver pgpkeys.mit.edu --recv-key 74A941BA219EC810 2>&1) + echo "${recvKeyResult}" + recvKeyFailed=$(echo "${recvKeyResult}" | grep -c 'Total number processed: 0') + if [ ${recvKeyFailed} -eq 1 ]; then + echo "FAILED: sudo gpg --keyserver pgpkeys.mit.edu --recv-key 74A941BA219EC810" + exit 1 + fi + sudo gpg -a --export 74A941BA219EC810 | sudo apt-key add - + echo "" - echo "*** Install Tor ***" - sudo apt-get install tor - #sudo apt install tor tor-arm -y + echo "*** Adding Tor Sources to sources.list ***" + echo "deb https://deb.torproject.org/torproject.org stretch main" | sudo tee -a /etc/apt/sources.list + echo "deb-src https://deb.torproject.org/torproject.org stretch main" | sudo tee -a /etc/apt/sources.list + echo "OK" + echo "" - echo "" - echo "*** Tor Config ***" - sudo rm -r -f /mnt/hdd/tor 2>/dev/null - sudo mkdir /mnt/hdd/tor - sudo mkdir /mnt/hdd/tor/sys - sudo mkdir /mnt/hdd/tor/web80 - sudo mkdir /mnt/hdd/tor/lnd9735 - sudo mkdir /mnt/hdd/tor/lndrpc9735 - sudo chmod -R 700 /mnt/hdd/tor - sudo chown -R bitcoin:bitcoin /mnt/hdd/tor - cat > ./torrc </dev/null + sudo mkdir /mnt/hdd/tor 2>/dev/null + sudo mkdir /mnt/hdd/tor/sys 2>/dev/null + sudo mkdir /mnt/hdd/tor/web80 2>/dev/null + sudo mkdir /mnt/hdd/tor/lnd9735 2>/dev/null + sudo mkdir /mnt/hdd/tor/lndrpc9735 2>/dev/null + sudo chmod -R 700 /mnt/hdd/tor + sudo chown -R bitcoin:bitcoin /mnt/hdd/tor + cat > ./torrc </dev/null | grep 'nyx' -c) - if [ ${nyxInstalled} -eq 0 ]; then - sudo pip install nyx - else - echo "NYX already installed" - fi - echo "" + # NYX - Tor monitor tool + # https://nyx.torproject.org/#home + echo "*** Installing NYX - TOR monitoring Tool ***" + nyxInstalled=$(sudo pip list 2>/dev/null | grep 'nyx' -c) + if [ ${nyxInstalled} -eq 0 ]; then + sudo pip install nyx + else + echo "NYX already installed" + fi + echo "" - echo "*** Activating TOR system service ***" - echo "ReadWriteDirectories=-/mnt/hdd/tor" | sudo tee -a /lib/systemd/system/tor@default.service - sudo systemctl daemon-reload - sudo systemctl enable tor@default - echo "" + echo "*** Activating TOR system service ***" + echo "ReadWriteDirectories=-/mnt/hdd/tor" | sudo tee -a /lib/systemd/system/tor@default.service + sudo systemctl daemon-reload + sudo systemctl enable tor@default + echo "" - echo "*** Changing ${network} Config ***" - networkIsTor=$(sudo cat /home/bitcoin/.${network}/${network}.conf | grep 'onlynet=onion' -c) - if [ ${networkIsTor} -eq 0 ]; then - - echo "Only Connect thru TOR" - echo "onlynet=onion" | sudo tee --append /home/bitcoin/.${network}/${network}.conf - - if [ "${network}" = "bitcoin" ]; then - echo "Adding some bitcoin onion nodes to connect to" - echo "addnode=fno4aakpl6sg6y47.onion" | sudo tee --append /home/bitcoin/.${network}/${network}.conf - echo "addnode=toguvy5upyuctudx.onion" | sudo tee --append /home/bitcoin/.${network}/${network}.conf - echo "addnode=ndndword5lpb7eex.onion" | sudo tee --append /home/bitcoin/.${network}/${network}.conf - echo "addnode=6m2iqgnqjxh7ulyk.onion" | sudo tee --append /home/bitcoin/.${network}/${network}.conf - echo "addnode=5tuxetn7tar3q5kp.onion" | sudo tee --append /home/bitcoin/.${network}/${network}.conf - fi + echo "*** Changing ${network} Config ***" + networkIsTor=$(sudo cat /home/bitcoin/.${network}/${network}.conf | grep 'onlynet=onion' -c) + if [ ${networkIsTor} -eq 0 ]; then - sudo cp /home/bitcoin/.${network}/${network}.conf /home/admin/.${network}/${network}.conf - sudo chown admin:admin /home/admin/.${network}/${network}.conf + echo "Only Connect thru TOR" + echo "onlynet=onion" | sudo tee --append /home/bitcoin/.${network}/${network}.conf + + if [ "${network}" = "bitcoin" ]; then + echo "Adding some bitcoin onion nodes to connect to" + echo "addnode=fno4aakpl6sg6y47.onion" | sudo tee --append /home/bitcoin/.${network}/${network}.conf + echo "addnode=toguvy5upyuctudx.onion" | sudo tee --append /home/bitcoin/.${network}/${network}.conf + echo "addnode=ndndword5lpb7eex.onion" | sudo tee --append /home/bitcoin/.${network}/${network}.conf + echo "addnode=6m2iqgnqjxh7ulyk.onion" | sudo tee --append /home/bitcoin/.${network}/${network}.conf + echo "addnode=5tuxetn7tar3q5kp.onion" | sudo tee --append /home/bitcoin/.${network}/${network}.conf + fi + + sudo cp /home/bitcoin/.${network}/${network}.conf /home/admin/.${network}/${network}.conf + sudo chown admin:admin /home/admin/.${network}/${network}.conf + + else + echo "Chain network already configured for TOR" + fi else - echo "Chain network already configured for TOR" + + echo "TOR package/service is installed and was prepared earlier .. just activating again" + + echo "*** Enable TOR service ***" + sudo systemctl ensable tor@default + echo "" + fi + # ACTIVATE LND OVER TOR echo "*** Putting LND behind TOR ***" echo "Make sutre LND is disabled"