diff --git a/README.md b/README.md index 740d091..d52dec9 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ # RaspiBlitz Fastest and cheapest way to get your own Lightning Node running - on a RaspberryPi with a nice LCD. -`Latest Version with lnd 0.5-betaRC1 and experimental TOR integration.` +`Latest Version with lnd 0.5 and bitcoin 0.17.0rc4 & litecoin 0.16.3 (both with dos bugfix).` ![RaspiBlitz](pictures/raspiblitz.jpg) @@ -63,7 +63,7 @@ If you are at an event, ask for a ready-2-go set or if you have your own hardwar 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: -http://wiki.fulmo.org/downloads/raspiblitz-2018-08-28.img.gz (or [build your own](#build-the-sd-card-image)) +https://wiki.fulmo.org/downloads/raspiblitz-2018-09-22.img.gz (or [build your own](#build-the-sd-card-image)) 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 @@ -312,7 +312,7 @@ The whole build process takes a while. And the end the LCD drives get installed At the beginning of this README you can find the newest SD card we provide. Or you can build the newest SD card image yourself like in the chapter above. The SD card image is used to setup a fresh install of the RaspiBlitz. So what to do if you already have an older version running and you want to upgrade? Until we reach version 1.0 the update process will be a bit rough .. so what you do is: -* close all open lightning channels you have (`lncli --force closeallchannels`) +* close all open lightning channels you have (`lncli closeallchannels --force`) * wait until all closing transactions are done * move all on-chain funds to a wallet outside raspiblitz (`lncli --conf_target 3 sendcoins [ADDRESS]`) * run the script `./XXcleanHDD.sh` in admin home directory (Blockchain will stay on HDD) @@ -336,4 +336,4 @@ Everybody is welcome to join, improve and extend the RaspiBlitz - its a work in Join me on twitter [@rootzoll](https://twitter.com/rootzoll), visit us at a [#lightninghackday](https://twitter.com/hashtag/LightningHackday?src=hash) in Berlin or drop by the Bitcoin Assembly at the [#35C3](https://twitter.com/hashtag/35C3). -IRC channel on Freenode `irc://irc.freenode.net/raspiblitz` +IRC channel on Freenode `irc://irc.freenode.net/raspiblitz` (unmoderated) diff --git a/build.sdcard/raspbianStretchDesktop.sh b/build.sdcard/raspbianStretchDesktop.sh index c20b2ad..21fad76 100644 --- a/build.sdcard/raspbianStretchDesktop.sh +++ b/build.sdcard/raspbianStretchDesktop.sh @@ -10,7 +10,7 @@ echo "" echo "***************************************" -echo "* RASPIBLITZ SD CARD IMAGE SETUP v0.9 *" +echo "* RASPIBLITZ SD CARD IMAGE SETUP v0.93*" echo "***************************************" echo "" @@ -109,7 +109,7 @@ echo "*** BITCOIN ***" # based on https://github.com/Stadicus/guides/blob/master/raspibolt/raspibolt_30_bitcoin.md#installation # set version (change if update is available) -bitcoinVersion="0.16.2" +bitcoinVersion="0.17.0" laanwjPGP="01EA5486DE18A882D4C2684590C8019E36C2E964" # prepare directories @@ -117,13 +117,13 @@ sudo -u admin mkdir /home/admin/download cd /home/admin/download # download resources -sudo -u admin wget https://bitcoin.org/bin/bitcoin-core-${bitcoinVersion}/bitcoin-${bitcoinVersion}-arm-linux-gnueabihf.tar.gz -if [ ! -f "./bitcoin-${bitcoinVersion}-arm-linux-gnueabihf.tar.gz" ] +sudo -u admin wget https://bitcoin.org/bin/bitcoin-core-${bitcoinVersion}/test.rc4/bitcoin-${bitcoinVersion}rc4-arm-linux-gnueabihf.tar.gz +if [ ! -f "./bitcoin-${bitcoinVersion}rc4-arm-linux-gnueabihf.tar.gz" ] then echo "!!! FAIL !!! Download BITCOIN BINARY not success." exit 1 fi -sudo -u admin wget https://bitcoin.org/bin/bitcoin-core-${bitcoinVersion}/SHA256SUMS.asc +sudo -u admin wget https://bitcoin.org/bin/bitcoin-core-${bitcoinVersion}/test.rc4/SHA256SUMS.asc if [ ! -f "./SHA256SUMS.asc" ] then echo "!!! FAIL !!! Download SHA256SUMS.asc not success." @@ -164,7 +164,7 @@ if [ ${correctKey} -lt 1 ] || [ ${goodSignature} -lt 1 ]; then fi # install -sudo -u admin tar -xvf bitcoin-${bitcoinVersion}-arm-linux-gnueabihf.tar.gz +sudo -u admin tar -xvf bitcoin-${bitcoinVersion}rc4-arm-linux-gnueabihf.tar.gz sudo install -m 0755 -o root -g root -t /usr/local/bin bitcoin-${bitcoinVersion}/bin/* sleep 3 installed=$(sudo -u admin bitcoind --version | grep "${bitcoinVersion}" -c) @@ -179,7 +179,7 @@ echo "*** LITECOIN ***" # based on https://medium.com/@jason.hcwong/litecoin-lightning-with-raspberry-pi-3-c3b931a82347 # set version (change if update is available) -litecoinVersion="0.16.2" +litecoinVersion="0.16.3" cd /home/admin/download sudo -u admin wget https://download.litecoin.org/litecoin-${litecoinVersion}/linux/litecoin-${litecoinVersion}-arm-linux-gnueabihf.tar.gz sudo -u admin tar -xvf litecoin-${litecoinVersion}-arm-linux-gnueabihf.tar.gz @@ -244,7 +244,7 @@ echo "*** LND ***" ##### Build from Source # To quickly catch up get latest patches if needed repo="github.com/lightningnetwork/lnd" -commit="a1f549754b61c1ba84466f0226997687127f7fc0" +commit="25145acc46cc5d18e4e348eed097300b1391d2a7" # BUILDING LND FROM SOURCE echo "*** Installing Go ***" wget https://storage.googleapis.com/golang/go1.10.linux-armv6l.tar.gz @@ -309,7 +309,7 @@ sudo bash -c "echo 'net.core.wmem_max = 1048576' >> /etc/sysctl.conf" # move files from gitclone cd /home/admin/ sudo -u admin git clone https://github.com/rootzoll/raspiblitz.git -sudo -u admin cp /home/admin/raspiblitz/home.admin/*.sh /home/admin +sudo -u admin cp /home/admin/raspiblitz/home.admin/*.* /home/admin sudo -u admin chmod +x *.sh sudo -u admin cp -r /home/admin/raspiblitz/home.admin/assets /home/admin/ diff --git a/home.admin/00infoBlitz.sh b/home.admin/00infoBlitz.sh index 4413cd7..cd64285 100755 --- a/home.admin/00infoBlitz.sh +++ b/home.admin/00infoBlitz.sh @@ -214,7 +214,7 @@ ${color_yellow} ${color_gray}${ln_channelInfo} ${color_yellow} ${color_yellow}${ln_external} " \ -"RaspiBlitz v0.9" \ +"RaspiBlitz v0.93" \ "-------------------------------------------" \ "load average:${load##up*, }" "${temp}" \ "${hdd}" "${sync_percentage}" diff --git a/home.admin/10setupBlitz.sh b/home.admin/10setupBlitz.sh index 851960e..691eb4e 100755 --- a/home.admin/10setupBlitz.sh +++ b/home.admin/10setupBlitz.sh @@ -106,6 +106,11 @@ if [ ${mountOK} -eq 1 ]; then # are there any signs of blockchain data if [ -d "/mnt/hdd/${network}" ]; then + + echo "TAIL Chain Network Log" + sudo tail /mnt/hdd/${network}/debug.log + echo "" + echo "UNKOWN STATE - there is blockain data folder, but blockchaind is not running" echo "It seems that something went wrong during sync/download/copy of the blockchain." echo "If you want start fresh --> sudo rm -r /mnt/hdd/${network}" diff --git a/home.admin/20initDialog.sh b/home.admin/20initDialog.sh index 85b7106..3e5d1c1 100755 --- a/home.admin/20initDialog.sh +++ b/home.admin/20initDialog.sh @@ -11,7 +11,7 @@ while [ ${#result} -eq 0 ] 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 - result=$( cat $_temp | tr -d [:space:] ) + result=$( cat $_temp | tr -d [:space:] ) shred $_temp done @@ -40,7 +40,7 @@ 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 -result=$( cat $_temp | tr -d [:space:] ) +result=$( cat $_temp ) shred $_temp # check input (check for more later) @@ -67,7 +67,7 @@ while [ ${#result} -lt 8 ] do dialog --backtitle "RaspiBlitz - Setup"\ --inputbox "Enter your RPC Password B (min 8 chars):" 9 52 2>$_temp - result=$( cat $_temp | tr -d [:space:] ) + result=$( cat $_temp ) shred $_temp done diff --git a/home.admin/50downloadHDD.sh b/home.admin/50downloadHDD.sh index 388ae8b..ab87ac5 100755 --- a/home.admin/50downloadHDD.sh +++ b/home.admin/50downloadHDD.sh @@ -1,10 +1,11 @@ #!/bin/bash echo "" -# *** BITCOIN *** +# *** BITCOIN (just mainnet) *** bitcoinList="" # url to list with other sources -bitcoinUrl="ftp://anonymous:anonymous@91.83.237.185:21/raspiblitz-bitcoin-2018-07-16" -bitcoinSize=231000000 # 231235816-tolerance +#bitcoinUrl="ftp://anonymous:anonymous@91.83.237.185:21/raspiblitz-bitcoin-2018-07-16" +bitcoinUrl="ftp://f00f278f:download@w0189aba.kasserver.com/" +bitcoinSize=222000000 # 225096419-tolerance # *** LITECOIN *** litecoinList="" # url to list with other sources @@ -14,10 +15,6 @@ litecoinSize=19180000 # 19184960-tolerance # load network network=`cat .network` -# make sure lftp is available -sudo apt-get install lftp -y -echo "" - # settings based on network list=$bitcoinList url=$bitcoinUrl @@ -32,7 +29,6 @@ fi name="Download" targetDir="/mnt/hdd/download/" targetSize=$size -maxTimeoutLoops=100000 command="sudo wget -c -r -P ${targetDir} -q --show-progress ${url}" # starting session if needed @@ -52,8 +48,6 @@ sleep 3 # monitor session screenDump="... started ..." actualSize=0 -timeout=1 -timeoutInfo="-" while : do @@ -61,7 +55,6 @@ while : screen -wipe 1>/dev/null isRunning=$( screen -S ${name} -ls | grep "${name}" -c ) if [ ${isRunning} -eq 0 ]; then - timeout=0 echo "OK - session finished" break fi @@ -74,28 +67,13 @@ while : progress=$(echo "scale=2; $freshSize*100/$targetSize" | bc) echo $progress > ".${name}.progress" - # detect if since last loop any progress occured - if [ ${actualSize} -eq ${freshSize} ]; then - timeoutInfo="${timeout}/${maxTimeoutLoops}" - timeout=$(( $timeout + 1 )) - else - timeout=1 - timeoutInfo="no timeout detected" - fi actualSize=$freshSize - # detect if mx timeout loop limit is reached - if [ ${timeout} -gt ${maxTimeoutLoops} ]; then - echo "FAIL - download hit timeout" - break - fi - # display info screen clear echo "****************************************************" echo "Monitoring Screen Session: ${name}" echo "Progress: ${progress}% (${actualSize} of ${targetSize})" - echo "Timeout: ${timeoutInfo}" echo "If needed press key x to stop ${name}" echo "NOTICE: This can take multiple hours or days !!" echo "Its OK to close terminal now and SSH back in later." diff --git a/home.admin/50torrentHDD.bitcoin.sh b/home.admin/50torrentHDD.bitcoin.sh new file mode 100755 index 0000000..562a846 --- /dev/null +++ b/home.admin/50torrentHDD.bitcoin.sh @@ -0,0 +1,228 @@ +#!/bin/bash +echo "" + +# get blockchain from https://getbitcoinblockchain.com torrents. +# those ore two torrents: +# 1) "blockchain" = blocks up to last month +# 2) "update" = daily block/index update +# this scripts will download both these torrents + +# make sure rtorrent is available +sudo apt-get install rtorrent -y +echo "" + +targetDir="/mnt/hdd/getbitcoinblockchain" +sessionDir="/home/admin/.rtorrent.session" +sudo mkdir ${sessionDir} 2>/dev/null + +############################## +# CHECK TORRENT 1 "BLOCKCHAIN" +############################## + +echo "*** checking torrent 1: blockchain" +torrentComplete1=$(cat ${sessionDir}/blockchain/*.torrent.rtorrent | grep ':completei1' -c) +echo "torrentComplete1(${torrentComplete1})" +if [ ${torrentComplete1} -eq 0 ]; then + + # check if screen session for this torrent + isRunning1=$( screen -S blockchain -ls | grep "blockchain" -c ) + echo "isRunning1(${isRunning1})" + if [ ${isRunning1} -eq 0 ]; then + + # start torrent download in screen session + echo "starting torrent: blockchain" + command1="sudo rtorrent -n -d ${targetDir} -s ${sessionDir}/blockchain/ https://getbitcoinblockchain.com/blockchain.torrent" + sudo mkdir ${targetDir} 2>/dev/null + sudo mkdir ${sessionDir}/blockchain/ 2>/dev/null + screenCommand="screen -S blockchain -L screen.log -dm ${command1}" + echo "${screenCommand}" + bash -c "${screenCommand}" + + fi +fi + +############################## +# CHECK TORRENT 2 "UPDATE" +############################## + +echo "*** checking torrent 2: update" +torrentComplete2=$(cat ${sessionDir}/update/*.torrent.rtorrent | grep ':completei1' -c) +echo "torrentComplete2(${torrentComplete2})" +if [ ${torrentComplete2} -eq 0 ]; then + + # check if screen session for this torrent + isRunning2=$( screen -S update -ls | grep "update" -c ) + echo "isRunning2(${isRunning2})" + if [ ${isRunning2} -eq 0 ]; then + + # start torrent download in screen session + echo "starting torrent: update" + command2="sudo rtorrent -n -d ${targetDir} -s ${sessionDir}/update/ https://getbitcoinblockchain.com/update.torrent" + sudo mkdir ${targetDir} 2>/dev/null + sudo mkdir ${sessionDir}/update/ 2>/dev/null + screenCommand="screen -S update -L screen.log -dm ${command2}" + echo "${screenCommand}" + bash -c "${screenCommand}" + + fi +fi + +############################## +# MONITOR PROGRESS +############################## + +sleep 3 + +# monitor screen session +screenDump1="... started ..." +screenDump2="... started ..." +torrentComplete1=0 +torrentComplete2=0 +while : + do + + # display info screen + clear + echo "****************************************************" + echo "Monitoring Screen Session: getbitcoinblockchain.com" + echo "If needed press key x to stop TORRENT download" + echo "NOTICE: This can take multiple hours or days !!" + echo "Its OK to close terminal now and SSH back in later." + echo "****************************************************" + echo "" + + # display torrent 1 info + echo "*** 1) Status Torrent 'blockchain':" + torrentComplete1=$(cat ${sessionDir}/blockchain/*.torrent.rtorrent | grep ':completei1' -c) + if [ ${torrentComplete1} -eq 0 ]; then + screen -S blockchain -X hardcopy .blockchain.out + newScreenDump=$(cat .blockchain.out | head -6 | tail -3 ) + if [ ${#newScreenDump} -gt 0 ]; then + screenDump1=$newScreenDump + fi + echo "$screenDump1" + else + echo "Completed" + fi + echo "" + + # display torrent 2 info + echo "*** 2) Status Torrent 'update':" + torrentComplete2=$(cat ${sessionDir}/update/*.torrent.rtorrent | grep ':completei1' -c) + if [ ${torrentComplete2} -eq 0 ]; then + screen -S update -X hardcopy .update.out + newScreenDump=$(cat .update.out| head -6 | tail -3 ) + if [ ${#newScreenDump} -gt 0 ]; then + screenDump2=$newScreenDump + fi + echo "$screenDump2" + else + echo "Completed" + fi + echo "" + + # check if both torrents completed + if [ ${torrentComplete1} -eq 1 ]; then + if [ ${torrentComplete2} -eq 1 ]; then + echo "OK - all torrents finished" + break + fi + fi + + # wait 2 seconds for key input + read -n 1 -t 2 keyPressed + + # check if user wants to abort session + if [ "${keyPressed}" = "x" ]; then + echo "" + echo "Aborting getbitcoinblockchain.com" + break + fi + + done + +# clean up +rm -f .blockchain.out +rm -f .update.out + +############################## +# AFTER PARTY & CLEAN UP +############################## + +# quit session1 +isRunning=$( screen -S blockchain -ls | grep "blockchain" -c ) +if [ ${isRunning} -eq 1 ]; then + # get the PID of screen session + sessionPID=$(screen -ls | grep "blockchain" | cut -d "." -f1 | xargs) + echo "killing screen session PID(${sessionPID})" + # kill all child processes of screen sceesion + sudo pkill -P ${sessionPID} + echo "proccesses killed" + sleep 3 + # tell the screen session to quit and wait a bit + screen -S blockchain -X quit 1>/dev/null + sleep 3 + echo "cleaning screen" + screen -wipe 1>/dev/null + sleep 3 +fi + +# quit session2 +isRunning=$( screen -S update -ls | grep "update" -c ) +if [ ${isRunning} -eq 1 ]; then + # get the PID of screen session + sessionPID=$(screen -ls | grep "update" | cut -d "." -f1 | xargs) + echo "killing screen session PID(${sessionPID})" + # kill all child processes of screen sceesion + sudo pkill -P ${sessionPID} + echo "proccesses killed" + sleep 3 + # tell the screen session to quit and wait a bit + screen -S update -X quit 1>/dev/null + sleep 3 + echo "cleaning screen" + screen -wipe 1>/dev/null + sleep 3 +fi + +# check result +torrentComplete=0 +torrentComplete1=$(cat ${sessionDir}/blockchain/*.torrent.rtorrent | grep ':completei1' -c) +torrentComplete2=$(cat ${sessionDir}/update/*.torrent.rtorrent | grep ':completei1' -c) +if [ ${torrentComplete1} -eq 1 ]; then + if [ ${torrentComplete2} -eq 1 ]; then + torrentComplete=1 + fi +fi +if [ ${torrentComplete} -eq 0 ]; then + + # User Cancel --> Torrent incomplete + sleep 3 + echo -ne '\007' + dialog --title " WARNING " --yesno "The download failed or is not complete. Maybe try again (later). Do you want keep already downloaded data for next try?" 8 57 + response=$? + case $response in + 1) sudo rm -rf ${targetDir} ;; + esac + ./00mainMenu.sh + exit 1; + +fi + +# the path torrent will download to +targetPath1="${targetDir}/blockchain" +targetPath2="${targetDir}/update/blockchain" + +# Download worked / just move, copy on USB2 >4h +echo "*** Moving Files ***" +echo "can take some minutes ..." +date +%s +sudo mkdir /mnt/hdd/bitcoin +sudo mv ${targetPath1}/* /mnt/hdd/bitcoin/ +sudo cp -r ${targetPath2}/* /mnt/hdd/bitcoin/ +sudo rm -r ${targetDir} +echo "OK" +date +%s + +# continue setup +./60finishHDD.sh diff --git a/home.admin/50torrentHDD.sh b/home.admin/50torrentHDD.sh index 11c8cff..98a36e7 100755 --- a/home.admin/50torrentHDD.sh +++ b/home.admin/50torrentHDD.sh @@ -1,9 +1,11 @@ #!/bin/bash echo "" +# --> TODO: Check https://getbitcoinblockchain.com/ + # *** BITCOIN Torrent *** bitcoinTorrent="raspiblitz-bitcoin-2018-07-16" -bitcoinTorrentsize=231230512 +bitcoinTorrentsize=231230404 # *** LITECOIN Torrent *** litecoinTorrent="raspiblitz-litecoin-2018-07-29" @@ -12,8 +14,15 @@ litecoinTorrentsize=10240000 # load network network=`cat .network` -# make sure lftp is available -sudo apt-get install lftp -y + +## experimental redirect if bitcoin +#if [ "$network" = "bitcoin" ]; then +# ./50torrentHDD.sh +# exit 1 +#fi + +# make sure rtorrent is available +sudo apt-get install rtorrent -y echo "" # settings based on network @@ -28,10 +37,13 @@ fi name="Torrent" targetDir="/mnt/hdd/torrent" targetSize=$size -maxTimeoutLoops=100000 -command="sudo lftp -c \"torrent -O ${targetDir} /home/admin/assets/${torrent}.torrent; bye\"" +sessionDir="/home/admin/.rtorrent.session/" +command="sudo rtorrent -n -d ${targetDir} -s ${sessionDir} /home/admin/assets/${torrent}.torrent" +# 2 screen sessions - differnt rtorrent session dir? +#sudo rtorrent -n -d /mnt/hdd/torrent -s /home/admin/.rtorrent.session/ https://getbitcoinblockchain.com/blockchain.torrent +#sudo rtorrent -n -d /mnt/hdd/torrent -s /home/admin/.rtorrent.session/ https://getbitcoinblockchain.com/update.torrent -# starting session if needed +# starting screen session if needed echo "checking if ${name} has a running screen session" screen -wipe 1>/dev/null isRunning=$( screen -S ${name} -ls | grep "${name}" -c ) @@ -39,6 +51,7 @@ echo "isRunning(${isRunning})" if [ ${isRunning} -eq 0 ]; then echo "Starting screen session" sudo mkdir ${targetDir} 2>/dev/null + sudo mkdir ${sessionDir} 2>/dev/null screenCommand="screen -S ${name} -L screen.log -dm ${command}" echo "${screenCommand}" bash -c "${screenCommand}" @@ -47,20 +60,17 @@ else fi sleep 3 -# monitor session +# monitor screen session screenDump="... started ..." actualSize=0 -timeout=1 -timeoutInfo="-" +torrentComplete=0 while : do - # check if session is still running - screen -wipe 1>/dev/null - isRunning=$( screen -S ${name} -ls | grep "${name}" -c ) - if [ ${isRunning} -eq 0 ]; then - timeout=0 - echo "OK - session finished" + # check if completed by inspecting rtorrent session files + torrentComplete=$(cat /home/admin/.rtorrent.session/*.torrent.rtorrent | grep ':completei1' -c) + if [ ${torrentComplete} -eq 1 ]; then + echo "OK - torrent finished" break fi @@ -70,30 +80,15 @@ while : freshSize=0 fi progress=$(echo "scale=2; $freshSize*100/$targetSize" | bc) - echo $progress > '.${name}.progress' - - # detect if since last loop any progress occured - if [ ${actualSize} -eq ${freshSize} ]; then - timeoutInfo="${timeout}/${maxTimeoutLoops}" - timeout=$(( $timeout + 1 )) - else - timeout=1 - timeoutInfo="no timeout detected" - fi - actualSize=$freshSize + echo $progress > ".${name}.progress" - # detect if mx timeout loop limit is reached - if [ ${timeout} -gt ${maxTimeoutLoops} ]; then - echo "FAIL - download hit timeout" - break - fi + actualSize=$freshSize # display info screen clear echo "****************************************************" echo "Monitoring Screen Session: ${name}" echo "Progress: ${progress}% (${actualSize} of ${targetSize})" - echo "Timeout: ${timeoutInfo}" echo "If needed press key x to stop ${name}" echo "NOTICE: This can take multiple hours or days !!" echo "Its OK to close terminal now and SSH back in later." @@ -122,6 +117,7 @@ rm -f .${name}.out rm -f .${name}.progress # quit session if still running +isRunning=$( screen -S ${name} -ls | grep "${name}" -c ) if [ ${isRunning} -eq 1 ]; then # get the PID of screen session sessionPID=$(screen -ls | grep "${name}" | cut -d "." -f1 | xargs) @@ -165,10 +161,13 @@ if [ ${finalSize} -lt ${targetSize} ]; then else - # Download worked + # Download worked / just move, copy on USB2 >4h echo "*** Moving Files ***" + echo "START" + date +%s sudo mv ${targetPath} /mnt/hdd/${network} echo "OK" + date +%s # continue setup ./60finishHDD.sh diff --git a/home.admin/60finishHDD.sh b/home.admin/60finishHDD.sh index 2d7e68c..0998a8d 100755 --- a/home.admin/60finishHDD.sh +++ b/home.admin/60finishHDD.sh @@ -24,7 +24,7 @@ if [ ${mountOK} -eq 1 ]; then exit 1 fi sudo cp /home/admin/assets/${network}.conf /mnt/hdd/${network}/${network}.conf - sudo mkdir /home/admin/.${network} + sudo mkdir /home/admin/.${network} 2>/dev/null sudo cp /home/admin/assets/${network}.conf /home/admin/.${network}/${network}.conf sudo ln -s /mnt/hdd/${network} /home/bitcoin/.${network} sudo mkdir /mnt/hdd/lnd diff --git a/home.admin/70initLND.sh b/home.admin/70initLND.sh index 1b467c7..44c1202 100755 --- a/home.admin/70initLND.sh +++ b/home.admin/70initLND.sh @@ -27,34 +27,32 @@ fi echo "OK - ${network}d is running" echo "" -###### Wait for Blochain Sync --> LET DO THIS LATER ON LND SCAN -#echo "*** Syncing Blockchain ***" -#ready=0 -#while [ ${ready} -eq 0 ] -# do -# progress="$(sudo -u bitcoin ${network}-cli getblockchaininfo | jq -r '.verificationprogress')" -# verySmallProgress=$(echo $progress | grep -c 'e-'); -# if [ ${verySmallProgress} -eq 1 ]; then -# progress="0.00"; -# fi -# ready=$(echo $progress'>0.99' | bc -l) -# sync_percentage=$(printf "%.2f%%" "$(echo $progress | awk '{print 100 * $1}')") -# #echo "progress($progress) verySmallProgress($verySmallProgress) ready($ready) sync_percentage($sync_percentage)" -# if [ ${#ready} -eq 0 ]; then -# echo "waiting for init ... can take a while" -# ready=0 -# elif [ "$sync_percentage" = "0.00%" ]; then -# echo "waiting for network ... can take a while" -# ready=0 -# elif [ ${ready} -eq 0 ]; then -# echo "${sync_percentage}" -# else -# echo "finishing sync ... can take a while" -# fi -# sleep 3 -# done -#echo "OK - Blockchain is synced" -#echo "" +# verify that chainnetwork is ready +chainIsReady=0 +while [ ${chainIsReady} -eq 0 ] + do + echo "*** Test if chaninnetwork is ready ..." + date +%s + result=$(${network}-cli getblockchaininfo 2>error.out) + error=`cat error.out` + rm error.out + echo "result(${result})" + echo "error(${error})" + if [ ${#error} -gt 0 ]; then + testnetAdd="" + if [ "${chain}" = "test" ]; then + testnetAdd="testnet3/" + fi + sudo tail -n 5 /mnt/hdd/bitcoin/${testnetAdd}debug.log + echo "Waiting 1 minute and then trying again ..." + sleep 60 + echo "" + else + echo "OK - chainnetwork is working" + chainIsReady=1 + break + fi + done ###### LND Config echo "*** LND Config ***" diff --git a/home.admin/95switchMainTest.sh b/home.admin/95switchMainTest.sh index 0548be0..37d3d30 100755 --- a/home.admin/95switchMainTest.sh +++ b/home.admin/95switchMainTest.sh @@ -65,7 +65,7 @@ if [ ${lndInstalled} -gt 0 ]; then if [ ${openChannels} -gt 0 ]; then echo "" echo "!!!!!!!!!!!!!!!!!!!" - echo "FAIL - You have still open channels and could loose funds !! - close those first with 'lncli --chain=${network} closeallchannels' or main menu option." + echo "FAIL - You have still open channels and could loose funds !! - close those first with 'lncli closeallchannels' or main menu option." echo "!!!!!!!!!!!!!!!!!!!" exit 1 else diff --git a/home.admin/BBcashoutWallet.sh b/home.admin/BBcashoutWallet.sh index 7d71d8f..912e36e 100755 --- a/home.admin/BBcashoutWallet.sh +++ b/home.admin/BBcashoutWallet.sh @@ -43,8 +43,9 @@ fi # TODO: check address is valid for network and chain # TODO: check if fees are getting done right so that transaction will get processed +amount=$((amount - 10000)) +command="lncli --chain=${network} sendcoins --addr ${address} --amt ${amount} --conf_target 3" -command="lncli --chain=${network} --conf_target 3 sendcoins ${address} ${amount}" clear echo "******************************" diff --git a/home.admin/BBcloseAllChannels.sh b/home.admin/BBcloseAllChannels.sh index 6312ae9..6510783 100755 --- a/home.admin/BBcloseAllChannels.sh +++ b/home.admin/BBcloseAllChannels.sh @@ -4,7 +4,7 @@ network=`cat .network` chain=$(${network}-cli -datadir=/home/bitcoin/.${network} getblockchaininfo | jq -r '.chain') -command="lncli --chain=${network} closeallchannels --force" +command="lncli closeallchannels --force" clear echo "***********************************" diff --git a/home.admin/XXupdateScripts.sh b/home.admin/XXupdateScripts.sh index 1698949..ec98bf2 100755 --- a/home.admin/XXupdateScripts.sh +++ b/home.admin/XXupdateScripts.sh @@ -8,7 +8,7 @@ git pull cd .. rm *.sh rm -r assets -sudo -u admin cp /home/admin/raspiblitz/home.admin/*.sh /home/admin +sudo -u admin cp /home/admin/raspiblitz/home.admin/*.* /home/admin sudo -u admin chmod +x *.sh sudo -u admin cp -r /home/admin/raspiblitz/home.admin/assets /home/admin/ echo "******************************************" diff --git a/home.admin/assets/lnd.bitcoin.conf b/home.admin/assets/lnd.bitcoin.conf index be7c46e..c33a01e 100755 --- a/home.admin/assets/lnd.bitcoin.conf +++ b/home.admin/assets/lnd.bitcoin.conf @@ -13,15 +13,15 @@ rpclisten=0.0.0.0:10009 [Bitcoin] bitcoin.active=1 - +bitcoin.node=bitcoind # enable either testnet or mainnet #bitcoin.testnet=1 bitcoin.mainnet=1 -bitcoin.node=bitcoind -bitcoind.rpchost=127.0.0.1 +[Bitcoind] bitcoind.rpcuser=raspibolt bitcoind.rpcpass=passwordB +bitcoind.rpchost=127.0.0.1 bitcoind.zmqpubrawblock=tcp://127.0.0.1:28332 bitcoind.zmqpubrawtx=tcp://127.0.0.1:28333 diff --git a/home.admin/assets/lnd.litecoin.conf b/home.admin/assets/lnd.litecoin.conf index bc93d7a..c8c5f45 100755 --- a/home.admin/assets/lnd.litecoin.conf +++ b/home.admin/assets/lnd.litecoin.conf @@ -15,6 +15,8 @@ rpclisten=0.0.0.0:10009 litecoin.active=1 litecoin.mainnet=1 litecoin.node=litecoind + +[Litecoind] litecoind.rpchost=127.0.0.1 litecoind.rpcuser=raspibolt litecoind.rpcpass=passwordB diff --git a/shoppinglist_usa.md b/shoppinglist_usa.md index 1815326..ae2ca91 100644 --- a/shoppinglist_usa.md +++ b/shoppinglist_usa.md @@ -2,11 +2,11 @@ *The RaspiBlitz software is build and tested for the following Hardware set that you can buy cheap on Amazon.com:* -* RaspBerry Pi 3 ($41.00 USD) http://a.co/ahl7RIp -* Micro SD-Card 16GB ($6.75 USD) http://a.co/6R49HZz -* Power ($7.99 USD) https://www.amazon.com/Yuconn-Switch-Charger-Adapter-Raspberry/dp/B071YC2T9S +* RaspBerry Pi 3 ($39.70 USD) http://a.co/ahl7RIp +* Micro SD-Card 16GB ($5.99 USD) http://a.co/d/710f4oJ +* Power ($8.88 USD) http://a.co/d/fVVOYZZ * 1TB Hard Drive ($49.99 USD) http://a.co/eUgVfLd * Case ($7.99 USD) http://a.co/1774Hwl * LCD-Display ($19.99 USD) http://a.co/65p2wu6 -**Total Price: $145.95 USD** +**Total Price: $132.54 USD**