From ce36c99daee0f3b441bb17f7a39f5e9284645a90 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Wed, 25 Jul 2018 14:57:07 +0200 Subject: [PATCH 1/4] download fix --- home.admin/50downloadHDD.sh | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/home.admin/50downloadHDD.sh b/home.admin/50downloadHDD.sh index 4e06049..fc2310d 100755 --- a/home.admin/50downloadHDD.sh +++ b/home.admin/50downloadHDD.sh @@ -2,6 +2,8 @@ # name of torrentfile = name of directory in torrent torrent="raspiblitz-hdd-2018-07-16" +# size of a valid download (run on seed directory 'du -s ./[TORRENTDIRECTORY]') +torrentsize=462470200 echo "" echo "*** Checking HDD ***" @@ -21,10 +23,33 @@ if [ ${mountOK} -eq 1 ]; then echo "killall transmission-cli" > $tmpfile sudo transmission-cli ./assets/$torrent.torrent -D -w /mnt/hdd -f $tmpfile echo "" + echo "*** Checking Download ***" + echo "wait a moment" + sleep 5 + downloadsize=$(sudo du -s /mnt/hdd/$torrent/ | awk '{print $1}' | tr -dc '0-9') + if [ ${#downloadsize} -eq 0 ]; then + downloadsize=0 + fi + # add some tolerance for checking + torrentsize="$(($torrentsize-1024000))" + echo "download size is(${downloadsize})" + if [ ${downloadsize} -lt ${torrentsize} ]; then + echo "FAIL - download is not ${torrentsize}" + sleep 3 + dialog --title " WARNING " --yesno "The download failed or is not complete. Do you want to clean all download data before you continue?" 6 57 + response=$? + case $response in + 0) sudo rm -rf /mnt/hdd/$torrent ; sudo rm -rf /root/.config/transmission ;; + esac + # + ./00mainMenu.sh + exit 1; + fi + echo "" + echo "*** Moving Files ***" echo "moving files ..." - mv /mnt/hdd/$torrent/* /mnt/hdd - rm -R /mnt/hdd/$torrent + sudo mv /mnt/hdd/$torrent /mnt/hdd/bitcoin echo "" # set SetupState From ca3e551a265be95db2dd3734a96d64ed396ec897 Mon Sep 17 00:00:00 2001 From: -k Date: Wed, 25 Jul 2018 11:40:50 -0400 Subject: [PATCH 2/4] rename setup mode --- README.md | 4 ++-- home.admin/00infoLCD.sh | 2 +- home.admin/00mainMenu.sh | 8 ++++---- home.admin/20initDialog.sh | 8 ++++---- home.admin/70initLND.sh | 2 +- home.admin/90finishSetup.sh | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 4540ed0..53909ce 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ If you organizing an educational event where you want to support people learning *There are two ways to start:* ### Scenario 1: “At a Hackathon/Event” -If you are at an event, ask for a ready-2-go set or if you have your own hardware ask for assistance to prepare your SD-Card and HDD. Then you are all set and and you can proceed with "SetUp your RaspiBlitz". +If you are at an event, ask for a ready-2-go set or if you have your own hardware ask for assistance to prepare your SD-Card and HDD. Then you are all set and and you can proceed with "Setup your RaspiBlitz". ### Scenario 2 “Start at Home” You got all the hardware of the shopping list above and you have no further assistance. Then you need to prepare your SD-Card yourself .. this scenario is still experimental, feedback needed and can take some time. @@ -221,7 +221,7 @@ Already integrated features of the RaspiBlitz are/willbe listed as part of the m ## Educational Tutorials -*Once the SetUp Process is done, the learning and building should begin ... more detailed educational content should be added in this section in the future.* +*Once the Setup Process is done, the learning and building should begin ... more detailed educational content should be added in this section in the future.* A good way to start for now is to get some Testnet coins, connect to other peers and make your first transactions. You find tutorials for this at the original RaspiBolt guide: https://github.com/Stadicus/guides/blob/master/raspibolt/raspibolt_40_lnd.md#get-some-testnet-bitcoin diff --git a/home.admin/00infoLCD.sh b/home.admin/00infoLCD.sh index 673e19a..7fd2aa6 100755 --- a/home.admin/00infoLCD.sh +++ b/home.admin/00infoLCD.sh @@ -60,7 +60,7 @@ if [ "$USER" = "pi" ]; then l1="Login to your RaspiBlitz with:\n" l2="ssh admin@${localip}\n" l3="Use your Password A\n" - dialog --backtitle "RaspiBlitz - SetUp Mode" --infobox "$l1$l2$l3" 5 34 + dialog --backtitle "RaspiBlitz - Setup Mode" --infobox "$l1$l2$l3" 5 34 sleep 10 fi diff --git a/home.admin/00mainMenu.sh b/home.admin/00mainMenu.sh index 26d4ca4..9121201 100755 --- a/home.admin/00mainMenu.sh +++ b/home.admin/00mainMenu.sh @@ -18,19 +18,19 @@ fi if [ ${setupState} -eq 0 ]; then # start setup - BACKTITLE="RaspiBlitz - SetUp" + BACKTITLE="RaspiBlitz - Setup" TITLE="⚡ Welcome to your RaspiBlitz ⚡" MENU="\nYou need to setup and init Bitcoin and Lightning services: \n " - OPTIONS+=(1 "Start the SetUp of your RaspiBlitz") + OPTIONS+=(1 "Start the Setup of your RaspiBlitz") HEIGHT=10 elif [ ${setupState} -lt 100 ]; then # continue setup - BACKTITLE="RaspiBlitz - SetUp" + BACKTITLE="RaspiBlitz - Setup" TITLE="⚡ Welcome to your RaspiBlitz ⚡" MENU="\nContinue setup and init of Bitcoin and Lightning services: \n " - OPTIONS+=(1 "Continue SetUp of your RaspiBlitz") + OPTIONS+=(1 "Continue Setup of your RaspiBlitz") HEIGHT=10 else diff --git a/home.admin/20initDialog.sh b/home.admin/20initDialog.sh index e89df47..95c1f81 100755 --- a/home.admin/20initDialog.sh +++ b/home.admin/20initDialog.sh @@ -7,7 +7,7 @@ while [ ${#result} -eq 0 ] do l1="Please enter the name of your new RaspiBlitz:\n" l2="one word, keep characters basic & not too long" - dialog --backtitle "RaspiBlitz - SetUp" --inputbox "$l1$l2" 11 52 2>$_temp + dialog --backtitle "RaspiBlitz - Setup" --inputbox "$l1$l2" 11 52 2>$_temp result=`cat $_temp` shred $_temp done @@ -20,7 +20,7 @@ sed -i "7s/.*/alias=$result/" ./assests/lnd.conf echo $result >> /home/admin/.hostname # show password info dialog -dialog --backtitle "RaspiBlitz - SetUp" --msgbox "RaspiBlitz uses 4 different passwords. +dialog --backtitle "RaspiBlitz - Setup" --msgbox "RaspiBlitz uses 4 different passwords. Referenced as password A, B, C and D. A) Master User Password @@ -33,7 +33,7 @@ Write them down & store them in a safe place. " 14 52 # ask user for new password A -dialog --backtitle "RaspiBlitz - SetUp"\ +dialog --backtitle "RaspiBlitz - Setup"\ --inputbox "Please enter your Master/Admin Password A:\n!!! This is new password to login per SSH !!!" 10 52 2>$_temp # get user input @@ -62,7 +62,7 @@ dialog --backtitle "RaspiBlitz" --msgbox "OK - password changed to '$result'\nfo result="" while [ ${#result} -lt 8 ] do - dialog --backtitle "RaspiBlitz - SetUp"\ + dialog --backtitle "RaspiBlitz - Setup"\ --inputbox "Enter your RPC Password B (min 8 chars):" 9 52 2>$_temp result=`cat $_temp` shred $_temp diff --git a/home.admin/70initLND.sh b/home.admin/70initLND.sh index 363d039..0c8ccfb 100755 --- a/home.admin/70initLND.sh +++ b/home.admin/70initLND.sh @@ -175,5 +175,5 @@ fi # set SetupState (scan is done - so its 80%) echo "80" > /home/admin/.setup -###### finishSetUp +###### finishSetup ./90finishSetup.sh diff --git a/home.admin/90finishSetup.sh b/home.admin/90finishSetup.sh index 8df8c58..2b73aa7 100755 --- a/home.admin/90finishSetup.sh +++ b/home.admin/90finishSetup.sh @@ -38,7 +38,7 @@ echo "Setting new network hostname '$hostname'" sudo hostnamectl set-hostname ${hostname} # show info to user -dialog --backtitle "RaspiBlitz - SetUp" --title " RaspiBlitz Setup is done :) " --msgbox " +dialog --backtitle "RaspiBlitz - Setup" --title " RaspiBlitz Setup is done :) " --msgbox " Press OK for a final reboot. Remember: After every reboot From d9efbd5d2ae1615a2a5a552d637549cf37d6ed3e Mon Sep 17 00:00:00 2001 From: rootzoll Date: Wed, 25 Jul 2018 17:58:27 +0200 Subject: [PATCH 3/4] torrent fix --- home.admin/50downloadHDD.sh | 55 +++++++++++++++++++++++++------------ 1 file changed, 38 insertions(+), 17 deletions(-) diff --git a/home.admin/50downloadHDD.sh b/home.admin/50downloadHDD.sh index fc2310d..c753d9a 100755 --- a/home.admin/50downloadHDD.sh +++ b/home.admin/50downloadHDD.sh @@ -17,24 +17,45 @@ if [ ${mountOK} -eq 1 ]; then # HDD is empty - download HDD content echo "OK - HDD is ready." echo "" - echo "*** Downloading HDD ***" - tmpfile=$(mktemp) - chmod a+x $tmpfile - echo "killall transmission-cli" > $tmpfile - sudo transmission-cli ./assets/$torrent.torrent -D -w /mnt/hdd -f $tmpfile - echo "" - echo "*** Checking Download ***" - echo "wait a moment" - sleep 5 - downloadsize=$(sudo du -s /mnt/hdd/$torrent/ | awk '{print $1}' | tr -dc '0-9') - if [ ${#downloadsize} -eq 0 ]; then - downloadsize=0 - fi - # add some tolerance for checking - torrentsize="$(($torrentsize-1024000))" - echo "download size is(${downloadsize})" + + downloading=1 + retry=0 + while [ $downloading -eq 1 ] + do + echo "*** Downloading HDD ***" + tmpfile=$(mktemp) + chmod a+x $tmpfile + echo "killall transmission-cli" > $tmpfile + sudo transmission-cli ./assets/$torrent.torrent -D -et -w /mnt/hdd -f $tmpfile + echo "" + echo "*** Checking Download ***" + echo "wait a moment" + sleep 5 + downloadsize=$(sudo du -s /mnt/hdd/$torrent/ | awk '{print $1}' | tr -dc '0-9') + if [ ${#downloadsize} -eq 0 ]; then + downloadsize=0 + fi + # add some tolerance for checking + torrentsize="$(($torrentsize-1024000))" + echo "download size is(${downloadsize})" + if [ ${downloadsize} -lt ${torrentsize} ]; then + echo "" + echo "FAIL - download is not ${torrentsize}" + retry=$(($retry+1)) + if [ ${retry} -gt 2 ]; then + echo "All Retry FAILED" + downloading=0 + else + echo "--> RETRY(${retry}) in 10 secs" + sleep 10 + echo "" + fi + else + echo "OK - Download is complete" + downloading=0 + fi + done if [ ${downloadsize} -lt ${torrentsize} ]; then - echo "FAIL - download is not ${torrentsize}" sleep 3 dialog --title " WARNING " --yesno "The download failed or is not complete. Do you want to clean all download data before you continue?" 6 57 response=$? From 1802fa1daf86972c3cc80ac621593985f5cf926e Mon Sep 17 00:00:00 2001 From: rootzoll Date: Wed, 25 Jul 2018 20:49:37 +0200 Subject: [PATCH 4/4] Updated SD image with bugfix #9 --- README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 53909ce..fb12443 100644 --- a/README.md +++ b/README.md @@ -58,10 +58,8 @@ If you are at an event, ask for a ready-2-go set or if you have your own hardwar ### Scenario 2 “Start at Home” You got all the hardware of the shopping list above and you have no further assistance. Then you need to prepare your SD-Card yourself .. this scenario is still experimental, feedback needed and can take some time. -1. Download SD-Card image with [bittorrent](https://www.utorrent.com/intl/en/downloads/): -https://wiki.fulmo.org/downloads/raspiblitz-2018-07-17b.torrent -or try this HTTP-Link for direct download: -http://wiki.fulmo.org/downloads/raspiblitz-2018-07-17b.img.gz +1. Download SD-Card image: +http://wiki.fulmo.org/downloads/raspiblitz-2018-07-25.img.gz 2. Write the SD-Card image to your SD Card - if you need details, see here: https://www.raspberrypi.org/documentation/installation/installing-images/README.md