diff --git a/home.admin/00raspiblitz.sh b/home.admin/00raspiblitz.sh index e9dd94a72..e75e6af70 100755 --- a/home.admin/00raspiblitz.sh +++ b/home.admin/00raspiblitz.sh @@ -400,14 +400,30 @@ case $CHOICE in exit 1; ;; BITCOIN) + # set network info sed -i "s/^network=.*/network=bitcoin/g" ${infoFile} sed -i "s/^chain=.*/chain=main/g" ${infoFile} + ###### OPTIMIZE IF RAM >1GB + kbSizeRAM=$(cat /proc/meminfo | grep "MemTotal" | sed 's/[^0-9]*//g') + if [ ${kbSizeRAM} -gt 1500000 ]; then + echo "Detected RAM >1GB --> optimizing ${network}.conf" + sudo sed -i "s/^dbcache=.*/dbcache=1024/g" /home/admin/assets/bitcoin.conf + sudo sed -i "s/^maxmempool=.*/maxmempool=300/g" /home/admin/assets/bitcoin.conf + fi /home/admin/10setupBlitz.sh exit 1; ;; LITECOIN) + # set network info sed -i "s/^network=.*/network=litecoin/g" ${infoFile} sed -i "s/^chain=.*/chain=main/g" ${infoFile} + ###### OPTIMIZE IF RAM >1GB + kbSizeRAM=$(cat /proc/meminfo | grep "MemTotal" | sed 's/[^0-9]*//g') + if [ ${kbSizeRAM} -gt 1500000 ]; then + echo "Detected RAM >1GB --> optimizing ${network}.conf" + sudo sed -i "s/^dbcache=.*/dbcache=1024/g" /home/admin/assets/litecoin.conf + sudo sed -i "s/^maxmempool=.*/maxmempool=300/g" /home/admin/assets/litecoin.conf + fi /home/admin/10setupBlitz.sh exit 1; ;; diff --git a/home.admin/10setupBlitz.sh b/home.admin/10setupBlitz.sh index 45a14379c..c983497fb 100755 --- a/home.admin/10setupBlitz.sh +++ b/home.admin/10setupBlitz.sh @@ -191,9 +191,6 @@ if [ ${mountOK} -eq 1 ]; then syncComment="BEST+SLOW" fi - # set default dbcache in asset - sudo sed -i "s/^dbcache=.*/dbcache=128/g" /home/admin/assets/${network}.conf - #Bitcoin if [ ${network} = "bitcoin" ]; then echo "Bitcoin Options" diff --git a/home.admin/60finishHDD.sh b/home.admin/60finishHDD.sh index 480f5b408..e42e5a4fd 100755 --- a/home.admin/60finishHDD.sh +++ b/home.admin/60finishHDD.sh @@ -35,14 +35,6 @@ if [ ${mountOK} -eq 1 ]; then sudo chown -R bitcoin:bitcoin /home/bitcoin/.lnd echo "OK - ${network} setup ready" - ###### OPTIMIZE IF RAM >1GB - kbSizeRAM=$(cat /proc/meminfo | grep "MemTotal" | sed 's/[^0-9]*//g') - if [ ${kbSizeRAM} -gt 1500000 ]; then - echo "Detected RAM >1GB --> optimizing ${network}.conf" - sudo sed -i "s/^dbcache=.*/dbcache=1024/g" /mnt/hdd/${network}/${network}.conf - sudo sed -i "s/^maxmempool=.*/maxmempool=300/g" /mnt/hdd/${network}/${network}.conf - fi - ###### ACTIVATE TOR IF SET DURING SETUP if [ "${runBehindTor}" = "on" ]; then echo "TOR was selected ..." diff --git a/home.admin/70initLND.sh b/home.admin/70initLND.sh index 67bfb4696..68f4e7017 100755 --- a/home.admin/70initLND.sh +++ b/home.admin/70initLND.sh @@ -110,7 +110,7 @@ if [ ${lndRunning} -eq 0 ]; then ###### ACTIVATE TOR IF SET DURING SETUP if [ "${runBehindTor}" = "on" ]; then echo "TOR was selected ..." - sudo /home/admin/config.scripts/internet.tor.sh lndconf + sudo /home/admin/config.scripts/internet.tor.sh lndconf-on else echo "TOR was not selected" fi diff --git a/home.admin/_background.sh b/home.admin/_background.sh index 947c04dc3..82febb5c2 100644 --- a/home.admin/_background.sh +++ b/home.admin/_background.sh @@ -274,7 +274,7 @@ do finishedIBD=$(${network}-cli getblockchaininfo | grep "initialblockdownload" | grep -c "false") if [ ${finishedIBD} -eq 1 ]; then - echo "CHECK FOR END OF IBD --> reduce RAM and restart ${network}d" + echo "CHECK FOR END OF IBD --> reduce RAM, check TOR and restart ${network}d" # remove flag rm /home/admin/selfsync.flag @@ -292,6 +292,14 @@ do sudo sed -i "s/^dbcache=.*/dbcache=128/g" /mnt/hdd/${network}/${network}.conf fi + # if TOR was activated during setup make sure bitcoin runs behind TOR latest from now on + if [ "${runBehindTor}" = "on" ]; then + echo "TOR is ON -> make sure bitcoin is running behind TOR after IBD" + /home/admin/config.scripts/internet.tor.sh btcconf-on + else + echo "TOR is OFF after IBD" + fi + # restart bitcoind sudo systemctl start ${network}d diff --git a/home.admin/config.scripts/internet.tor.sh b/home.admin/config.scripts/internet.tor.sh index a05a72ac3..109e4a66e 100755 --- a/home.admin/config.scripts/internet.tor.sh +++ b/home.admin/config.scripts/internet.tor.sh @@ -8,7 +8,16 @@ # command info if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then echo "small config script to switch TOR on or off" - echo "internet.tor.sh [on|off|prepare|btcconf|lndconf]" + echo "internet.tor.sh [on|off|prepare|btcconf-on|btcconf-off|lndconf-on]" + exit 1 +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" exit 1 fi @@ -114,11 +123,21 @@ activateBitcoinOverTOR() echo "Chain network already configured for TOR" fi else - echo "BTC config does not found (yet) - try with 'internet.tor.sh btcconf' again later" + echo "BTC config does not found (yet) - try with 'internet.tor.sh btcconf-on' again later" fi } +deactivateBitcoinOverTOR() +{ + echo "*** Changing ${network} Config ***" + sudo sed -i "s/^onlynet=.*//g" /home/bitcoin/.${network}/${network}.conf + sudo sed -i "s/^addnode=.*//g" /home/bitcoin/.${network}/${network}.conf + sudo sed -i '/^ *$/d' /home/bitcoin/.${network}/${network}.conf + sudo cp /home/bitcoin/.${network}/${network}.conf /home/admin/.${network}/${network}.conf + sudo chown admin:admin /home/admin/.${network}/${network}.conf +} + activateLndOverTOR() { echo "*** Putting LND behind TOR ***" @@ -139,7 +158,7 @@ activateLndOverTOR() echo "" else - echo "LND service not found (yet) - try with 'internet.tor.sh lndconf' again later" + echo "LND service not found (yet) - try with 'internet.tor.sh lndconf-on' again later" fi } @@ -151,24 +170,21 @@ if [ "$1" = "prepare" ] || [ "$1" = "-prepare" ]; then fi # if started with prepare -if [ "$1" = "btcconf" ]; then +if [ "$1" = "btcconf-on" ]; then activateBitcoinOverTOR exit 0 fi # if started with prepare -if [ "$1" = "lndconf" ]; then - activateLndOverTOR +if [ "$1" = "btcconf-off" ]; then + deactivateBitcoinOverTOR exit 0 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" - exit 1 +# if started with prepare +if [ "$1" = "lndconf-on" ]; then + activateLndOverTOR + exit 0 fi # add default value to raspi config if needed @@ -323,12 +339,8 @@ if [ "$1" = "0" ] || [ "$1" = "off" ]; then sudo systemctl disable tor@default echo "" - echo "*** Changing ${network} Config ***" - sudo sed -i "s/^onlynet=.*//g" /home/bitcoin/.${network}/${network}.conf - sudo sed -i "s/^addnode=.*//g" /home/bitcoin/.${network}/${network}.conf - sudo sed -i '/^ *$/d' /home/bitcoin/.${network}/${network}.conf - sudo cp /home/bitcoin/.${network}/${network}.conf /home/admin/.${network}/${network}.conf - sudo chown admin:admin /home/admin/.${network}/${network}.conf + # DEACTIVATE BITCOIN OVER TOR (function call) + deactivateBitcoinOverTOR echo "" echo "*** Removing TOR from LND ***" diff --git a/shoppinglist_de.md b/shoppinglist_de.md index 84b37601d..c5639a2bd 100644 --- a/shoppinglist_de.md +++ b/shoppinglist_de.md @@ -1,8 +1,8 @@ -## Shopping List: Germany +# Shopping List: Germany The new shopping list comes in three different packages: Minimal, Standard & Maximal: -### Standard Shopping list (under 200 EUR) +## Standard Shopping list (under 200 EUR) *The "Standard Package" is most tested and recommended if you can effort it. It aims to give you the best economic value to run all the RaspiBlitz features at a good performance and even allows you to self-validate your blockchain in under 3 days.* @@ -37,4 +37,4 @@ Or if you order new go with the RaspberryPi 4 1GB and the following parts: ## Package: Maximal -*The maximal package is still in the works ... if you want to prepare for it, take the standard package as a base and choose the RaspberryPi4 with 4GB and a high quality 1TB SSD.* +*The maximal package is still in the works ... if you want to prepare for it, take the standard package as a base and choose the RaspberryPi4 with 4GB and a high quality 1TB SSD instead of 500GB.*