diff --git a/home.admin/00mainMenu.sh b/home.admin/00mainMenu.sh index 1a825dcf1..5cb589461 100755 --- a/home.admin/00mainMenu.sh +++ b/home.admin/00mainMenu.sh @@ -83,7 +83,7 @@ fi if [ "${loop}" == "on" ]; then OPTIONS+=(LOOP "Loop In/Out Service") fi -if [ "${Mempool}" == "on" ]; then +if [ "${mempoolExplorer}" == "on" ]; then OPTIONS+=(MEMPOOL "Mempool Space") fi if [ "${specter}" == "on" ]; then diff --git a/home.admin/00settingsMenuServices.sh b/home.admin/00settingsMenuServices.sh index 999a9e88c..443eb34e7 100755 --- a/home.admin/00settingsMenuServices.sh +++ b/home.admin/00settingsMenuServices.sh @@ -15,7 +15,7 @@ if [ ${#ElectRS} -eq 0 ]; then ElectRS="off"; fi if [ ${#lndmanage} -eq 0 ]; then lndmanage="off"; fi if [ ${#joinmarket} -eq 0 ]; then joinmarket="off"; fi if [ ${#LNBits} -eq 0 ]; then LNBits="off"; fi -if [ ${#Mempool} -eq 0 ]; then Mempool="off"; fi +if [ ${#mempoolExplorer} -eq 0 ]; then mempoolExplorer="off"; fi if [ ${#faraday} -eq 0 ]; then faraday="off"; fi if [ ${#bos} -eq 0 ]; then bos="off"; fi if [ ${#thunderhub} -eq 0 ]; then thunderhub="off"; fi @@ -24,19 +24,19 @@ if [ ${#thunderhub} -eq 0 ]; then thunderhub="off"; fi echo "run dialog ..." OPTIONS=() -OPTIONS+=(l 'Lightning Loop' ${loop}) +OPTIONS+=(e 'Electrum Rust Server' ${ElectRS}) OPTIONS+=(r 'RTL Webinterface' ${rtlWebinterface}) +OPTIONS+=(t 'ThunderHub' ${thunderhub}) +OPTIONS+=(p 'BTCPayServer' ${BTCPayServer}) +OPTIONS+=(i 'LNbits' ${LNBits}) OPTIONS+=(b 'BTC-RPC-Explorer' ${BTCRPCexplorer}) OPTIONS+=(s 'Cryptoadvance Specter' ${specter}) -OPTIONS+=(e 'Electrum Rust Server' ${ElectRS}) -OPTIONS+=(p 'BTCPayServer' ${BTCPayServer}) -OPTIONS+=(m 'lndmanage' ${lndmanage}) -OPTIONS+=(f 'Faraday' ${faraday}) -OPTIONS+=(o 'Balance of Satoshis' ${bos}) -OPTIONS+=(t 'ThunderHub' ${thunderhub}) -OPTIONS+=(i 'LNbits' ${LNBits}) -OPTIONS+=(a 'Mempool Space' ${Mempool}) +OPTIONS+=(a 'Mempool Explorer' ${mempoolExplorer}) OPTIONS+=(j 'JoinMarket' ${joinmarket}) +OPTIONS+=(l 'Lightning Loop' ${loop}) +OPTIONS+=(o 'Balance of Satoshis' ${bos}) +OPTIONS+=(f 'Faraday' ${faraday}) +OPTIONS+=(m 'lndmanage' ${lndmanage}) CHOICES=$(dialog --title ' Additional Services ' --checklist ' use spacebar to activate/de-activate ' 20 45 12 "${OPTIONS[@]}" 2>&1 >/dev/tty) @@ -362,8 +362,8 @@ fi # Mempool process choice choice="off"; check=$(echo "${CHOICES}" | grep -c "a") if [ ${check} -eq 1 ]; then choice="on"; fi -if [ "${Mempool}" != "${choice}" ]; then - echo "Mempool settings changed .." +if [ "${mempoolExplorer}" != "${choice}" ]; then + echo "Mempool Explorer settings changed .." anychange=1 /home/admin/config.scripts/bonus.mempool.sh ${choice} errorOnInstall=$? @@ -376,14 +376,14 @@ This can take ~7 hours on a RPi4 with SSD. Monitor the progress on the LCD.\n When finished use the new 'EXPLORE' entry in Main Menu for more info.\n " 14 50 else - l1="!!! FAIL on Mempool install !!!" + l1="!!! FAIL on Mempool Explorer install !!!" l2="Try manual install on terminal after reboot with:" l3="/home/admin/config.scripts/bonus.mempool.sh on" dialog --title 'FAIL' --msgbox "${l1}\n${l2}\n${l3}" 7 65 fi fi else - echo "Mempool Setting unchanged." + echo "Mempool Explorer Setting unchanged." fi if [ ${anychange} -eq 0 ]; then diff --git a/home.admin/_bootstrap.provision.sh b/home.admin/_bootstrap.provision.sh index 2bfd91d5c..4d3ec686a 100755 --- a/home.admin/_bootstrap.provision.sh +++ b/home.admin/_bootstrap.provision.sh @@ -458,6 +458,15 @@ else echo "Provisioning ThunderHub - keep default" >> ${logFile} fi +# mempool explorer +if [ "${mempoolExplorer}" = "on" ]; then + echo "Provisioning MempoolExplorer - run config script" >> ${logFile} + sudo sed -i "s/^message=.*/message='Setup Mempool Explorer'/g" ${infoFile} + sudo -u admin /home/admin/config.scripts/bonus.mempool.sh on >> ${logFile} 2>&1 +else + echo "Provisioning Mempool Explorer - keep default" >> ${logFile} +fi + # letsencrypt if [ "${letsencrypt}" = "on" ]; then echo "Provisioning letsencrypt - run config script" >> ${logFile} diff --git a/home.admin/config.scripts/bonus.angular_cli.sh b/home.admin/config.scripts/bonus.angular_cli.sh index 1a2848db4..493212c4f 100644 --- a/home.admin/config.scripts/bonus.angular_cli.sh +++ b/home.admin/config.scripts/bonus.angular_cli.sh @@ -42,8 +42,14 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then fi # install + echo "# try to suppress question on statistics report" + export NG_CLI_ANALYTICS=ci + NG_CLI_ANALYTICS=ci + echo "# install angular CLI" npm install -g @angular/cli + echo "# link ng" sudo ln -sf /usr/local/lib/nodejs/node-$VERSION-$DISTRO/bin/ng /usr/bin/ng + echo "# explicit trun off statistics report" ng analytics off # check if nodeJS was installed diff --git a/home.admin/config.scripts/bonus.mempool.sh b/home.admin/config.scripts/bonus.mempool.sh index fb6eb7abb..e1963da02 100644 --- a/home.admin/config.scripts/bonus.mempool.sh +++ b/home.admin/config.scripts/bonus.mempool.sh @@ -61,14 +61,14 @@ Activate TOR to access the web block explorer from outside your local network. fi # add default value to raspi config if needed -if ! grep -Eq "^Mempool=" /mnt/hdd/raspiblitz.conf; then - echo "Mempool=off" >> /mnt/hdd/raspiblitz.conf +if ! grep -Eq "^mempoolExplorer=" /mnt/hdd/raspiblitz.conf; then + echo "mempoolExplorer=off" >> /mnt/hdd/raspiblitz.conf fi # status if [ "$1" = "status" ]; then - if [ "${Mempool}" = "on" ]; then + if [ "${mempoolExplorer}" = "on" ]; then echo "configured=1" # check indexing @@ -118,6 +118,11 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then cd /home/mempool sudo -u mempool git clone https://github.com/mempool/mempool.git cd mempool + sudo -u mempool git reset --hard v1.0.0 + + # modify an + #echo "# try to suppress question on statistics report .." + #sudo sed -i "s/^}/,\"cli\": {\"analytics\": false}}/g" /home/mempool/mempool/frontend/angular.json sudo mariadb -e "DROP DATABASE mempool;" sudo mariadb -e "CREATE DATABASE mempool;" @@ -125,10 +130,15 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then sudo mariadb -e "FLUSH PRIVILEGES;" mariadb -umempool -pmempool mempool < mariadb-structure.sql - sudo -u mempool git reset --hard v1.0.0 + echo "# npm install for mempool explorer (frontend)" + cd frontend + sudo -u mempool ng analytics off sudo -u mempool npm install sudo -u mempool npm run build + + echo "# npm install for mempool explorer (backend)" + cd ../backend/ sudo -u mempool npm install sudo -u mempool npm run build @@ -259,7 +269,7 @@ EOF fi # setting value in raspi blitz config - sudo sed -i "s/^Mempool=.*/Mempool=on/g" /mnt/hdd/raspiblitz.conf + sudo sed -i "s/^mempoolExplorer=.*/mempoolExplorer=on/g" /mnt/hdd/raspiblitz.conf echo "# needs to finish creating txindex to be functional" echo "# monitor with: sudo tail -n 20 -f /mnt/hdd/bitcoin/debug.log" @@ -278,7 +288,7 @@ fi if [ "$1" = "0" ] || [ "$1" = "off" ]; then # setting value in raspi blitz config - sudo sed -i "s/^Mempool=.*/Mempool=off/g" /mnt/hdd/raspiblitz.conf + sudo sed -i "s/^mempoolExplorer=.*/mempoolExplorer=off/g" /mnt/hdd/raspiblitz.conf isInstalled=$(sudo ls /etc/systemd/system/mempool.service 2>/dev/null | grep -c 'mempool.service') if [ ${isInstalled} -eq 1 ]; then