cln: remove spark wallet and sparko plugin (#4120)

* cln: remove sparko
* cln: remove spark wallet
This commit is contained in:
openoms 2023-08-25 22:09:49 +02:00 committed by GitHub
parent e33800c8e6
commit 43ee57d069
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 1 additions and 606 deletions

View file

@ -17,6 +17,7 @@
- Update: Specter Desktop 1.13.1 [details](https://github.com/cryptoadvance/specter-desktop/releases/tag/v1.13.1) - Update: Specter Desktop 1.13.1 [details](https://github.com/cryptoadvance/specter-desktop/releases/tag/v1.13.1)
- Update: Kindle-Display 0.5.1 [details](https://github.com/dennisreimann/kindle-display/) - Update: Kindle-Display 0.5.1 [details](https://github.com/dennisreimann/kindle-display/)
- Fix: Homebanking Interface FinTS/HBCI (experimental) [details](https://github.com/rootzoll/raspiblitz/issues/1186) - Fix: Homebanking Interface FinTS/HBCI (experimental) [details](https://github.com/rootzoll/raspiblitz/issues/1186)
- Remove: Spark Wallet and Sparko CLN plugin (not maintained anymore)
## What's new in Version 1.9.0 of RaspiBlitz? ## What's new in Version 1.9.0 of RaspiBlitz?

View file

@ -89,12 +89,6 @@ fi
if [ "${lndg}" == "on" ]; then if [ "${lndg}" == "on" ]; then
OPTIONS+=(LNDG "LNDg (auto-rebalance, auto-fees)") OPTIONS+=(LNDG "LNDg (auto-rebalance, auto-fees)")
fi fi
if [ "${sparko}" == "on" ]; then
OPTIONS+=(SPARKO "Sparko Webwallet")
fi
if [ "${spark}" == "on" ]; then
OPTIONS+=(SPARK "Spark Wallet")
fi
if [ "${ElectRS}" == "on" ]; then if [ "${ElectRS}" == "on" ]; then
OPTIONS+=(ELECTRS "Electrum Rust Server") OPTIONS+=(ELECTRS "Electrum Rust Server")
fi fi
@ -278,12 +272,6 @@ case $CHOICE in
LNDG) LNDG)
/home/admin/config.scripts/bonus.lndg.sh menu /home/admin/config.scripts/bonus.lndg.sh menu
;; ;;
SPARKO)
/home/admin/config.scripts/cl-plugin.sparko.sh menu mainnet
;;
SPARK)
/home/admin/config.scripts/cl.spark.sh menu mainnet
;;
LNBITS) LNBITS)
/home/admin/config.scripts/bonus.lnbits.sh menu /home/admin/config.scripts/bonus.lnbits.sh menu
;; ;;

View file

@ -13,8 +13,6 @@ if [ ${#rtlWebinterface} -eq 0 ]; then rtlWebinterface="off"; fi
if [ ${#lnd} -eq 0 ]; then lnd="off"; fi if [ ${#lnd} -eq 0 ]; then lnd="off"; fi
if [ ${#cl} -eq 0 ]; then cl="off"; fi if [ ${#cl} -eq 0 ]; then cl="off"; fi
if [ ${#crtlWebinterface} -eq 0 ]; then crtlWebinterface="off"; fi if [ ${#crtlWebinterface} -eq 0 ]; then crtlWebinterface="off"; fi
if [ ${#sparko} -eq 0 ]; then sparko="off"; fi
if [ ${#spark} -eq 0 ]; then spark="off"; fi
# show select dialog # show select dialog
echo "run dialog ..." echo "run dialog ..."
@ -24,8 +22,6 @@ OPTIONS+=(l "LND on $CHAIN" ${lnd})
OPTIONS+=(r "RTL for LND $CHAIN" ${rtlWebinterface}) OPTIONS+=(r "RTL for LND $CHAIN" ${rtlWebinterface})
OPTIONS+=(c "Core Lightning on $CHAIN" ${cl}) OPTIONS+=(c "Core Lightning on $CHAIN" ${cl})
OPTIONS+=(t "RTL for CL on $CHAIN" ${crtlWebinterface}) OPTIONS+=(t "RTL for CL on $CHAIN" ${crtlWebinterface})
OPTIONS+=(s "Sparko for CL on $CHAIN" ${sparko})
OPTIONS+=(m "Spark for CL on $CHAIN" ${spark})
CHOICES=$(dialog --title ' Additional Services ' \ CHOICES=$(dialog --title ' Additional Services ' \
--checklist ' use spacebar to activate/de-activate ' \ --checklist ' use spacebar to activate/de-activate ' \
@ -145,50 +141,6 @@ else
echo "RTL for CL $CHAIN Setting unchanged." echo "RTL for CL $CHAIN Setting unchanged."
fi fi
# sparko process choice
choice="off"; check=$(echo "${CHOICES}" | grep -c "s")
if [ ${check} -eq 1 ]; then choice="on"; fi
if [ "${sparko}" != "${choice}" ]; then
echo "# Sparko on $CHAIN Setting changed .."
anychange=1
/home/admin/config.scripts/cl-plugin.sparko.sh ${choice} $CHAIN
errorOnInstall=$?
if [ "${choice}" = "on" ]; then
if [ ${errorOnInstall} -eq 0 ]; then
/home/admin/config.scripts/cl-plugin.sparko.sh menu $CHAIN
else
l1="# FAIL on Sparko on $CHAIN install #"
l2="# Try manual install on terminal after reboot with:"
l3="/home/admin/config.scripts/cl-plugin.sparko.sh on $CHAIN"
dialog --title 'FAIL' --msgbox "${l1}\n${l2}\n${l3}" 7 65
fi
fi
else
echo "# Sparko on $CHAIN Setting unchanged."
fi
# spark process choice
choice="off"; check=$(echo "${CHOICES}" | grep -c "m")
if [ ${check} -eq 1 ]; then choice="on"; fi
if [ "${spark}" != "${choice}" ]; then
echo "# Spark Wallet on $CHAIN Setting changed .."
anychange=1
/home/admin/config.scripts/cl.spark.sh ${choice} $CHAIN
errorOnInstall=$?
if [ "${choice}" = "on" ]; then
if [ ${errorOnInstall} -eq 0 ]; then
/home/admin/config.scripts/cl.spark.sh menu $CHAIN
else
l1="# FAIL on Spark Wallet on $CHAIN install #"
l2="# Try manual install on terminal after reboot with:"
l3="/home/admin/config.scripts/cl.spark.sh on $CHAIN"
dialog --title 'FAIL' --msgbox "${l1}\n${l2}\n${l3}" 7 65
fi
fi
else
echo "# Spark Wallet on $CHAIN Setting unchanged."
fi
if [ ${anychange} -eq 0 ]; then if [ ${anychange} -eq 0 ]; then
dialog --msgbox "NOTHING CHANGED!\nUse Spacebar to check/uncheck services." 8 58 dialog --msgbox "NOTHING CHANGED!\nUse Spacebar to check/uncheck services." 8 58
exit 0 exit 0

View file

@ -13,8 +13,6 @@ if [ ${#trtlWebinterface} -eq 0 ]; then trtlWebinterface="off"; fi
if [ ${#tlnd} -eq 0 ]; then tlnd="off"; fi if [ ${#tlnd} -eq 0 ]; then tlnd="off"; fi
if [ ${#tcrtlWebinterface} -eq 0 ]; then tcrtlWebinterface="off"; fi if [ ${#tcrtlWebinterface} -eq 0 ]; then tcrtlWebinterface="off"; fi
if [ ${#tcl} -eq 0 ]; then tcl="off"; fi if [ ${#tcl} -eq 0 ]; then tcl="off"; fi
if [ ${#tsparko} -eq 0 ]; then tsparko="off"; fi
if [ ${#tspark} -eq 0 ]; then tspark="off"; fi
# show select dialog # show select dialog
echo "run dialog ..." echo "run dialog ..."
@ -24,8 +22,6 @@ OPTIONS+=(l "LND on $CHAIN" ${tlnd})
OPTIONS+=(r "RTL for LND $CHAIN" ${trtlWebinterface}) OPTIONS+=(r "RTL for LND $CHAIN" ${trtlWebinterface})
OPTIONS+=(c "Core Lightning on $CHAIN" ${tcl}) OPTIONS+=(c "Core Lightning on $CHAIN" ${tcl})
OPTIONS+=(t "RTL for CL on $CHAIN" ${tcrtlWebinterface}) OPTIONS+=(t "RTL for CL on $CHAIN" ${tcrtlWebinterface})
OPTIONS+=(s "Sparko for CL on $CHAIN" ${tsparko})
OPTIONS+=(m "Spark Wallet fro CL on $CHAIN" ${tspark})
CHOICES=$(dialog --title ' Additional Services ' \ CHOICES=$(dialog --title ' Additional Services ' \
--checklist ' use spacebar to activate/de-activate ' \ --checklist ' use spacebar to activate/de-activate ' \
@ -142,50 +138,6 @@ else
echo "RTL for CL $CHAIN Setting unchanged." echo "RTL for CL $CHAIN Setting unchanged."
fi fi
# tsparko process choice
choice="off"; check=$(echo "${CHOICES}" | grep -c "s")
if [ ${check} -eq 1 ]; then choice="on"; fi
if [ "${tsparko}" != "${choice}" ]; then
echo "# Sparko on $CHAIN Setting changed .."
anychange=1
/home/admin/config.scripts/cl-plugin.sparko.sh ${choice} $CHAIN
errorOnInstall=$?
if [ "${choice}" = "on" ]; then
if [ ${errorOnInstall} -eq 0 ]; then
/home/admin/config.scripts/cl-plugin.sparko.sh menu $CHAIN
else
l1="# FAIL on Sparko on $CHAIN install #"
l2="# Try manual install on terminal after reboot with:"
l3="/home/admin/config.scripts/cl-plugin.sparko.sh on $CHAIN"
dialog --title 'FAIL' --msgbox "${l1}\n${l2}\n${l3}" 7 65
fi
fi
else
echo "# Sparko on $CHAIN Setting unchanged."
fi
# tspark process choice
choice="off"; check=$(echo "${CHOICES}" | grep -c "m")
if [ ${check} -eq 1 ]; then choice="on"; fi
if [ "${tspark}" != "${choice}" ]; then
echo "# Spark Wallet on $CHAIN Setting changed .."
anychange=1
/home/admin/config.scripts/cl.spark.sh ${choice} $CHAIN
errorOnInstall=$?
if [ "${choice}" = "on" ]; then
if [ ${errorOnInstall} -eq 0 ]; then
/home/admin/config.scripts/cl.spark.sh menu $CHAIN
else
l1="# FAIL on Spark Wallet on $CHAIN install #"
l2="# Try manual install on terminal after reboot with:"
l3="/home/admin/config.scripts/cl.spark.sh on $CHAIN"
dialog --title 'FAIL' --msgbox "${l1}\n${l2}\n${l3}" 7 65
fi
fi
else
echo "# Spark Wallet on $CHAIN Setting unchanged."
fi
if [ ${anychange} -eq 0 ]; then if [ ${anychange} -eq 0 ]; then
dialog --msgbox "NOTHING CHANGED!\nUse Spacebar to check/uncheck services." 8 58 dialog --msgbox "NOTHING CHANGED!\nUse Spacebar to check/uncheck services." 8 58
exit 0 exit 0

View file

@ -28,8 +28,6 @@ if [ ${#lndg} -eq 0 ]; then lndg="off"; fi
if [ ${#whitepaper} -eq 0 ]; then whitepaper="off"; fi if [ ${#whitepaper} -eq 0 ]; then whitepaper="off"; fi
if [ ${#chantools} -eq 0 ]; then chantools="off"; fi if [ ${#chantools} -eq 0 ]; then chantools="off"; fi
if [ ${#homer} -eq 0 ]; then homer="off"; fi if [ ${#homer} -eq 0 ]; then homer="off"; fi
if [ ${#sparko} -eq 0 ]; then sparko="off"; fi
if [ ${#spark} -eq 0 ]; then spark="off"; fi
if [ ${#tallycoinConnect} -eq 0 ]; then tallycoinConnect="off"; fi if [ ${#tallycoinConnect} -eq 0 ]; then tallycoinConnect="off"; fi
if [ ${#helipad} -eq 0 ]; then helipad="off"; fi if [ ${#helipad} -eq 0 ]; then helipad="off"; fi
if [ ${#bitcoinminds} -eq 0 ]; then bitcoinminds="off"; fi if [ ${#bitcoinminds} -eq 0 ]; then bitcoinminds="off"; fi
@ -82,8 +80,6 @@ fi
# just available for CL # just available for CL
if [ "${lightning}" == "cl" ] || [ "${cl}" == "on" ]; then if [ "${lightning}" == "cl" ] || [ "${cl}" == "on" ]; then
OPTIONS+=(ca 'Core Lightning RTL Webinterface' ${crtlWebinterface}) OPTIONS+=(ca 'Core Lightning RTL Webinterface' ${crtlWebinterface})
OPTIONS+=(ka 'Core Lightning Sparko WebWallet' ${sparko})
OPTIONS+=(na 'Core Lightning Spark Wallet' ${spark})
fi fi
OPTIONS+=(ma 'Homer Dashboard' ${homer}) OPTIONS+=(ma 'Homer Dashboard' ${homer})
@ -662,50 +658,6 @@ else
echo "BitcoinMinds setting unchanged." echo "BitcoinMinds setting unchanged."
fi fi
# sparko process choice
choice="off"; check=$(echo "${CHOICES}" | grep -c "ka")
if [ ${check} -eq 1 ]; then choice="on"; fi
if [ "${sparko}" != "${choice}" ]; then
echo "# Sparko on mainnet Setting changed .."
anychange=1
/home/admin/config.scripts/cl-plugin.sparko.sh ${choice} mainnet
errorOnInstall=$?
if [ "${choice}" = "on" ]; then
if [ ${errorOnInstall} -eq 0 ]; then
/home/admin/config.scripts/cl-plugin.sparko.sh menu mainnet
else
l1="# FAIL on Sparko on mainnet install #"
l2="# Try manual install on terminal after reboot with:"
l3="/home/admin/config.scripts/cl-plugin.sparko.sh on mainnet"
dialog --title 'FAIL' --msgbox "${l1}\n${l2}\n${l3}" 7 65
fi
fi
else
echo "# Sparko on mainnet Setting unchanged."
fi
# spark wallet process choice
choice="off"; check=$(echo "${CHOICES}" | grep -c "na")
if [ ${check} -eq 1 ]; then choice="on"; fi
if [ "${spark}" != "${choice}" ]; then
echo "# Spark Wallet on mainnet Setting changed .."
anychange=1
/home/admin/config.scripts/cl.spark.sh ${choice} mainnet
errorOnInstall=$?
if [ "${choice}" = "on" ]; then
if [ ${errorOnInstall} -eq 0 ]; then
/home/admin/config.scripts/cl.spark.sh menu mainnet
else
l1="# FAIL on Spark Wallet on mainnet install #"
l2="# Try manual install on terminal after reboot with:"
l3="/home/admin/config.scripts/cl.spark.sh on mainnet"
dialog --title 'FAIL' --msgbox "${l1}\n${l2}\n${l3}" 7 65
fi
fi
else
echo "# Spark Wallet on mainnet Setting unchanged."
fi
# squeaknode process choice # squeaknode process choice
choice="off"; check=$(echo "${CHOICES}" | grep -c "qa") choice="off"; check=$(echo "${CHOICES}" | grep -c "qa")
if [ ${check} -eq 1 ]; then choice="on"; fi if [ ${check} -eq 1 ]; then choice="on"; fi

View file

@ -81,8 +81,6 @@ fi
if [ "${lightning}" == "cl" ] || [ "${cl}" == "on" ]; then if [ "${lightning}" == "cl" ] || [ "${cl}" == "on" ]; then
OPTIONS+=(ZEUS_CLREST "Zeus to Core LightningREST (Android or iOS)") OPTIONS+=(ZEUS_CLREST "Zeus to Core LightningREST (Android or iOS)")
OPTIONS+=(ZEUS_SPARK "Zeus to Sparko (Android or iOS)")
OPTIONS+=(SPARK "Spark Wallet to Sparko (Android - EXPERIMENTAL)" )
OPTIONS+=(FULLYNODED_CL "Fully Noded to CL REST (iOS+Tor)") OPTIONS+=(FULLYNODED_CL "Fully Noded to CL REST (iOS+Tor)")
fi fi
@ -283,37 +281,4 @@ ZEUS_CLREST)
/home/admin/config.scripts/cl.rest.sh connect /home/admin/config.scripts/cl.rest.sh connect
exit 0; exit 0;
;; ;;
ZEUS_SPARK)
sudo /home/admin/config.scripts/blitz.display.sh image /home/admin/raspiblitz/pictures/app_zeus.png
whiptail --title "Install Zeus on your Android or iOS Phone" \
--yes-button "Continue" \
--no-button "Cancel" \
--yesno "Open the https://zeusln.app/ on your mobile phone to find the App Store link or binary for your phone.\n\nWhen the app is installed and started --> Continue." 12 65
if [ $? -eq 1 ]; then
exit 0
fi
sudo /home/admin/config.scripts/blitz.display.sh hide
/home/admin/config.scripts/cl-plugin.sparko.sh connect
exit 0;
;;
SPARK)
appstoreLink="https://github.com/shesek/spark-wallet#mobile-app"
sudo /home/admin/config.scripts/blitz.display.sh image /home/admin/raspiblitz/pictures/app_zeus.png
whiptail --title "Install Zeus on your Android Phone" \
--yes-button "Continue" \
--no-button "GitHub link" \
--yesno "Open the ${appstoreLink} on Android to find the App Store link or binary for your phone.\n\nWhen the app is installed and started --> Continue." 12 65
if [ $? -eq 1 ]; then
sudo /home/admin/config.scripts/blitz.display.sh qr ${appstoreLink}
whiptail --title " GitHub link " --msgbox "\
To install app open the following link:\n
${appstoreLink}\n
Or scan the QR code on the LCD with your mobile phone.
" 11 70
fi
sudo /home/admin/config.scripts/blitz.display.sh hide
/home/admin/config.scripts/cl-plugin.sparko.sh connect
exit 0;
;;
esac esac

View file

@ -399,15 +399,6 @@ else
echo "Provisioning RTL CL - keep default" >> ${logFile} echo "Provisioning RTL CL - keep default" >> ${logFile}
fi fi
# SPARKO
if [ "${sparko}" = "on" ]; then
echo "Provisioning Sparko - run config script" >> ${logFile}
/home/admin/_cache.sh set message "Setup SPARKO"
sudo -u admin /home/admin/config.scripts/cl-plugin.sparko.sh on mainnet >> ${logFile} 2>&1
else
echo "Provisioning Sparko - keep default" >> ${logFile}
fi
# clHTTPplugin # clHTTPplugin
if [ "${clHTTPplugin}" = "on" ]; then if [ "${clHTTPplugin}" = "on" ]; then
echo "Provisioning clHTTPplugin - run config script" >> ${logFile} echo "Provisioning clHTTPplugin - run config script" >> ${logFile}
@ -435,15 +426,6 @@ else
echo "Provisioning clWatchtowerClient - keep default" >> ${logFile} echo "Provisioning clWatchtowerClient - keep default" >> ${logFile}
fi fi
# SPARK
if [ "${spark}" = "on" ]; then
echo "Provisioning Spark Wallet - run config script" >> ${logFile}
/home/admin/_cache.sh set message "Setup SPARK WALLET"
sudo -u admin /home/admin/config.scripts/cl.spark.sh on mainnet >> ${logFile} 2>&1
else
echo "Provisioning Spark Wallet - keep default" >> ${logFile}
fi
#LOOP - install only if LiT won't be installed #LOOP - install only if LiT won't be installed
if [ "${loop}" = "on" ] && [ "${lit}" != "on" ]; then if [ "${loop}" = "on" ] && [ "${lit}" != "on" ]; then
echo "Provisioning Lightning Loop - run config script" >> ${logFile} echo "Provisioning Lightning Loop - run config script" >> ${logFile}

View file

@ -1,205 +0,0 @@
#!/bin/bash
# explanation on paths https://github.com/ElementsProject/lightning/issues/4223
# built-in path dir: /usr/local/libexec/c-lightning/plugins/
# added --plugin-dir=/home/bitcoin/${netprefix}cl-plugins-enabled
SPARKOVERSION="v2.8"
# command info
if [ $# -lt 1 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ];then
echo
echo "Install, remove, connect or get info about the Sparko plugin for Core Lightning"
echo "version: $SPARKOVERSION"
echo "Usage:"
echo "cl-plugin.sparko.sh [on|off|menu|connect] [testnet|mainnet|signet] [norestart]"
echo
exit 1
fi
# source <(/home/admin/config.scripts/network.aliases.sh getvars cl <mainnet|testnet|signet>)
source <(/home/admin/config.scripts/network.aliases.sh getvars cl $2)
# show info menu
if [ "$1" = "menu" ]; then
# get network info
localip=$(hostname -I | awk '{print $1}')
toraddress=$(sudo cat /mnt/hdd/tor/${netprefix}sparko/hostname)
toraddresstext="Hidden Service address for the Tor Browser (QRcode on LCD):\n$toraddress"
if [ ${#toraddress} -eq 0 ];then
toraddresstext="Activate Tor to access the web interface from outside of the local network."
else
sudo /home/admin/config.scripts/blitz.display.sh qr "${toraddress}"
fi
fingerprint=$(openssl x509 -in /home/bitcoin/.lightning/sparko-tls/cert.pem -fingerprint -noout | cut -d"=" -f2)
whiptail --title "\
Sparko - $CHAIN" --msgbox "Open in your local web browser:
https://${localip}:${portprefix}9000\n
username: blitz
password: 'your Password B'\n
Accept the self-signed SSL certificate with the fingerprint:
${fingerprint}\n
${toraddresstext}
" 17 67
sudo /home/admin/config.scripts/blitz.display.sh hide
echo "# please wait ..."
exit 0
fi
if [ $1 = connect ];then
localip=$(hostname -I | awk '{print $1}')
toraddress=$(sudo cat /mnt/hdd/tor/${netprefix}sparko/hostname)
accesskey=$(sudo cat ${CLCONF} | grep "^sparko-keys=" | cut -d= -f2 | cut -d';' -f1)
url="https://${localip}:${portprefix}9000/"
#string="${url}?access-key=${accesskey}"
#sudo /home/admin/config.scripts/blitz.display.sh qr "$string"
#clear
#echo "connection string (shown as a QRcode on the top and on the LCD):"
#echo "$string"
#qrencode -t ANSIUTF8 "${string}"
clear
echo
sudo /home/admin/config.scripts/blitz.display.sh qr "${toraddress}"
echo "The Tor address is shown as a QRcode below and on the LCD"
echo "Scan it to your phone with a QR scanner app and paste it to: 'Host'"
echo
echo "Host: ${toraddress}"
echo
qrencode -t ANSIUTF8 "${toraddress}"
echo
echo
echo "Alternatively to connect through the LAN the address is:"
echo "${url}"
echo
echo "# Press enter to continue to show the access key"
read key
sudo /home/admin/config.scripts/blitz.display.sh hide
sudo /home/admin/config.scripts/blitz.display.sh qr "${accesskey}"
clear
echo
echo "The Access Key is shown as a QRcode below and on the LCD"
echo "Scan it to your phone with a QR scanner app and paste it to: 'Access Key'"
echo
echo "Acces Key: ${accesskey}"
echo
qrencode -t ANSIUTF8 "${accesskey}"
echo
echo "# Press enter to hide the QRcode from the LCD"
read key
sudo /home/admin/config.scripts/blitz.display.sh hide
exit 0
fi
if [ "$1" = "on" ];then
echo "# Detect CPU architecture ..."
isARM=$(uname -m | grep -c 'arm')
isAARCH64=$(uname -m | grep -c 'aarch64')
isX86_64=$(uname -m | grep -c 'x86_64')
if [ ${isARM} -eq 1 ] ; then
DISTRO="linux-arm"
elif [ ${isAARCH64} -eq 1 ] ; then
DISTRO="linux_arm"
elif [ ${isX86_64} -eq 1 ] ; then
DISTRO="linux_amd64"
fi
if [ ! -f /home/bitcoin/cl-plugins-available/sparko ];then
sudo -u bitcoin mkdir /home/bitcoin/cl-plugins-available
# download binary
sudo -u bitcoin wget https://github.com/fiatjaf/sparko/releases/download/${SPARKOVERSION}/sparko_${DISTRO}\
-O /home/bitcoin/cl-plugins-available/sparko || exit 1
# make executable
sudo chmod +x /home/bitcoin/cl-plugins-available/sparko
fi
if [ ! -L /home/bitcoin/${netprefix}cl-plugins-enabled/sparko ];then
sudo ln -s /home/bitcoin/cl-plugins-available/sparko \
/home/bitcoin/${netprefix}cl-plugins-enabled
fi
if [ ! -f /home/bitcoin/.lightning/sparko-tls/key.pem ];then
# create a self signed cert https://github.com/fiatjaf/sparko#how-to-use
/home/admin/config.scripts/internet.selfsignedcert.sh
# sparko looks for specific filenames
sudo -u bitcoin mkdir /home/bitcoin/.lightning/sparko-tls
sudo ln -sf /mnt/hdd/app-data/selfsignedcert/selfsigned.key \
/home/bitcoin/.lightning/sparko-tls/key.pem
sudo ln -sf /mnt/hdd/app-data/selfsignedcert/selfsigned.cert \
/home/bitcoin/.lightning/sparko-tls/cert.pem
fi
##########
# Config #
##########
if ! grep -Eq "^sparko" ${CLCONF};then
echo "# Editing ${CLCONF}"
echo "# See: https://github.com/fiatjaf/sparko#how-to-use"
PASSWORD_B=$(sudo cat /mnt/hdd/bitcoin/bitcoin.conf | grep rpcpassword | cut -c 13-)
# Spark wallet only allows alphanumeric characters
masterkeythatcandoeverything=$(< /dev/urandom tr -dc a-zA-Z0-9 | head -c20)
secretaccesskeythatcanreadstuff=$(< /dev/urandom tr -dc a-zA-Z0-9 | head -c20)
verysecretkeythatcanpayinvoices=$(< /dev/urandom tr -dc a-zA-Z0-9 | head -c20)
keythatcanlistentoallevents=$(< /dev/urandom tr -dc a-zA-Z0-9 | head -c20)
echo "
sparko-host=0.0.0.0
sparko-port=${portprefix}9000
sparko-tls-path=/home/bitcoin/.lightning/sparko-tls
sparko-login=blitz:$PASSWORD_B
sparko-keys=${masterkeythatcandoeverything}; ${secretaccesskeythatcanreadstuff}: getinfo, listchannels, listnodes; ${verysecretkeythatcanpayinvoices}: pay; ${keythatcanlistentoallevents}: stream
" | sudo tee -a ${CLCONF}
else
echo "# Sparko is already configured in ${CLCONF}"
fi
echo "# Allowing port ${portprefix}9000 through the firewall"
sudo ufw allow "${portprefix}9000" comment "${netprefix}sparko"
# hidden service to https://xx.onion
/home/admin/config.scripts/tor.onion-service.sh ${netprefix}sparko 443 ${portprefix}9000
# setting value in raspi blitz config
/home/admin/config.scripts/blitz.conf.sh set ${netprefix}sparko "on"
source <(/home/admin/_cache.sh get state)
if [ "${state}" == "ready" ] && [ "$3" != "norestart" ]; then
echo "# Restart the ${netprefix}lightningd.service to activate Sparko"
sudo systemctl restart ${netprefix}lightningd
fi
echo "# Sparko was installed"
echo "# Monitor with:"
echo "sudo journalctl | grep sparko | tail -n5"
echo "sudo tail -n 100 -f /home/bitcoin/.lightning/${CLNETWORK}/cl.log | grep sparko"
fi
if [ "$1" = "off" ];then
# delete symlink
sudo rm -rf /home/bitcoin/${netprefix}cl-plugins-enabled/sparko
echo "# Editing ${CLCONF}"
sudo sed -i "/^sparko/d" ${CLCONF}
echo "# Restart the ${netprefix}lightningd.service to deactivate Sparko"
sudo systemctl restart ${netprefix}lightningd
echo "# Deny port ${portprefix}9000 through the firewall"
sudo ufw deny "${portprefix}9000"
/home/admin/config.scripts/tor.onion-service.sh off ${netprefix}sparko
# purge
if [ "$(echo "$@" | grep -c purge)" -gt 0 ];then
echo "# Delete plugin"
sudo rm -rf /home/bitcoin/cl-plugins-available/sparko
fi
# setting value in raspi blitz config
/home/admin/config.scripts/blitz.conf.sh set ${netprefix}sparko "off"
echo "# Sparko was uninstalled"
fi

View file

@ -34,15 +34,6 @@ if [ "$1" == "prestart" ]; then
sed -i "/^announce-addr=127.0.0.1/d" ${CLCONF} sed -i "/^announce-addr=127.0.0.1/d" ${CLCONF}
fi fi
if [ $(grep -c "^sparko" < ${CLCONF}) -gt 0 ];then
if [ ! -f /home/bitcoin/${netprefix}cl-plugins-enabled/sparko ]\
|| [ "$(eval echo \$${netprefix}sparko)" != "on" ]; then
echo "# The Sparko plugin is not present but in config"
sed -i "/^sparko/d" ${CLCONF}
rm -rf /home/bitcoin/${netprefix}cl-plugins-enabled/sparko
fi
fi
if [ $(grep -c "^clboss" < ${CLCONF}) -gt 0 ];then if [ $(grep -c "^clboss" < ${CLCONF}) -gt 0 ];then
if [ ! -f /home/bitcoin/${netprefix}cl-plugins-enabled/clboss ]\ if [ ! -f /home/bitcoin/${netprefix}cl-plugins-enabled/clboss ]\
|| [ "$(eval echo \$${netprefix}clboss)" != "on" ]; then || [ "$(eval echo \$${netprefix}clboss)" != "on" ]; then

View file

@ -13,13 +13,6 @@ fi
# source <(/home/admin/config.scripts/network.aliases.sh getvars cl <mainnet|testnet|signet>) # source <(/home/admin/config.scripts/network.aliases.sh getvars cl <mainnet|testnet|signet>)
source <(/home/admin/config.scripts/network.aliases.sh getvars cl $1) source <(/home/admin/config.scripts/network.aliases.sh getvars cl $1)
if [ $(sudo -u bitcoin cat ${CLCONF} | grep -c "^sparko") -gt 0 ];then
if [ ! -f /home/bitcoin/${netprefix}cl-plugins-enabled/sparko ];then
echo "# The Sparko plugin is not present but in config"
/home/admin/config.scripts/cl-plugin.sparko.sh on $CHAIN norestart
fi
fi
if [ $(sudo -u bitcoin cat ${CLCONF} | grep -c "^http-pass") -gt 0 ];then if [ $(sudo -u bitcoin cat ${CLCONF} | grep -c "^http-pass") -gt 0 ];then
if [ ! -f /home/bitcoin/cl-plugins-enabled/c-lightning-http-plugin ]; then if [ ! -f /home/bitcoin/cl-plugins-enabled/c-lightning-http-plugin ]; then
echo "# The clHTTPplugin is not present but in config" echo "# The clHTTPplugin is not present but in config"

View file

@ -367,9 +367,6 @@ alias ${netprefix}clconf=\"sudo nano ${CLCONF}\"
# setting values in the raspiblitz.conf # setting values in the raspiblitz.conf
/home/admin/config.scripts/blitz.conf.sh set ${netprefix}cl on /home/admin/config.scripts/blitz.conf.sh set ${netprefix}cl on
# blitz.conf.sh needs sudo access - cannot be run in cl.check.sh # blitz.conf.sh needs sudo access - cannot be run in cl.check.sh
if [ ! -f /home/bitcoin/${netprefix}cl-plugins-enabled/sparko ]; then
/home/admin/config.scripts/blitz.conf.sh set ${netprefix}sparko "off"
fi
if [ ! -f /home/bitcoin/cl-plugins-enabled/c-lightning-http-plugin ]; then if [ ! -f /home/bitcoin/cl-plugins-enabled/c-lightning-http-plugin ]; then
/home/admin/config.scripts/blitz.conf.sh set clHTTPplugin "off" /home/admin/config.scripts/blitz.conf.sh set clHTTPplugin "off"
fi fi

View file

@ -1,173 +0,0 @@
#!/bin/bash
#https://github.com/shesek/spark-wallet/releases
SPARKVERSION="v0.3.1"
# command info
if [ $# -lt 1 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ];then
echo
echo "Install, remove or get info about the Spark Wallet for Core Lightning"
echo "version: $SPARKVERSION"
echo "Usage:"
echo "cl.spark.sh [on|off|menu] <testnet|mainnet|signet> "
echo
exit 1
fi
# source <(/home/admin/config.scripts/network.aliases.sh getvars cl <mainnet|testnet|signet>)
source <(/home/admin/config.scripts/network.aliases.sh getvars cl $2)
systemdService="${netprefix}spark"
# show info menu
if [ "$1" = "menu" ]; then
# get network info
localip=$(hostname -I | awk '{print $1}')
toraddress=$(sudo cat /mnt/hdd/tor/${netprefix}spark-wallet/hostname)
toraddresstext="Hidden Service address for the Tor Browser (QRcode on LCD):\n$toraddress"
if [ ${#toraddress} -eq 0 ];then
toraddresstext="Activate Tor to access the web interface from outside of the local network."
else
sudo /home/admin/config.scripts/blitz.display.sh qr "${toraddress}"
fi
fingerprint=$(openssl x509 -in /home/bitcoin/.spark-wallet/tls/cert.pem -fingerprint -noout | cut -d"=" -f2)
whiptail --title "\
spark - $CHAIN" --msgbox "Open in your local web browser:
https://${localip}:${portprefix}8000\n
username: blitz
password: 'your Password B'\n
Accept the self-signed SSL certificate with the fingerprint:
${fingerprint}\n
${toraddresstext}
" 17 67
sudo /home/admin/config.scripts/blitz.display.sh hide
echo "# please wait ..."
exit 0
fi
if [ $1 = on ];then
# check and install NodeJS
/home/admin/config.scripts/bonus.nodejs.sh on
# set up npm-global
sudo -u bitcoin mkdir /home/bitcoin/.npm-global
sudo -u bitcoin npm config set prefix '/home/bitcoin/.npm-global'
sudo bash -c "echo 'PATH=$PATH:/home/bitcoin/.npm-global/bin' >> /home/bitcoin/.bashrc"
echo "# Create data folder on the disk"
echo "# make sure the data directory exists"
sudo mkdir -p /mnt/hdd/app-data/.spark-wallet
echo "# symlink"
sudo rm -rf /home/bitcoin/.spark-wallet # not a symlink.. delete it silently
sudo ln -s /mnt/hdd/app-data/.spark-wallet/ /home/bitcoin/.spark-wallet
sudo chown bitcoin:bitcoin -R /mnt/hdd/app-data/.spark-wallet
cd /home/bitcoin || exit 1
sudo -u bitcoin git clone https://github.com/shesek/spark-wallet
cd spark-wallet || exit 1
sudo -u bitcoin git reset --hard ${SPARKVERSION} || exit 1
sudo -u bitcoin npm install @babel/cli
sudo -u bitcoin npm run dist:npm || exit 1
if [ ! -f /home/bitcoin/.spark-wallet/tls/key.pem ];then
echo "# creating /home/bitcoin/.spark-wallet/tls/key.pem"
# create a self signed cert https://github.com/fiatjaf/spark#how-to-use
/home/admin/config.scripts/internet.selfsignedcert.sh
# spark looks for specific filenames
sudo -u bitcoin mkdir -p /home/bitcoin/.spark-wallet/tls/
sudo ln -sf /mnt/hdd/app-data/selfsignedcert/selfsigned.key \
/home/bitcoin/.spark-wallet/tls/key.pem
sudo ln -sf /mnt/hdd/app-data/selfsignedcert/selfsigned.cert \
/home/bitcoin/.spark-wallet/tls/cert.pem
else
echo "# exists /home/bitcoin/.spark-wallet/tls/key.pem"
fi
##########
# Config #
##########
if [ -f /home/bitcoin/.spark-wallet/${netprefix}config ];then
echo "# ${netprefix}spark config is already present"
else
PASSWORD_B=$(sudo cat /mnt/hdd/bitcoin/bitcoin.conf | grep rpcpassword | cut -c 13-)
echo "\
login=blitz:${PASSWORD_B}
host=0.0.0.0
proxy=socks5h://127.0.0.1:9050
tls-path=/home/bitcoin/.lightning/spark-tls
onion
" | sudo -u bitcoin tee /home/bitcoin/.spark-wallet/${netprefix}config
fi
#################
# SYSTEMD SERVICE
#################
# https://raw.githubusercontent.com/shesek/spark-wallet/master/scripts/spark-wallet.service
echo "# Create Systemd Service: ${systemdService}.service"
echo "
# Systemd unit for ${systemdService}
[Unit]
Description=${systemdService} Lightning Wallet
Wants=${netprefix}lightningd.service
After=${netprefix}lightningd.service
[Service]
WorkingDirectory=/home/bitcoin/spark-wallet
ExecStart=/home/bitcoin/spark-wallet/dist/cli.js\
--ln-path /home/bitcoin/.lightning/${CLNETWORK} --port 8000\
--config /home/bitcoin/.spark-wallet/config
User=bitcoin
Restart=on-failure
TimeoutSec=120
RestartSec=30
StandardOutput=null
StandardError=journal
# Hardening measures
PrivateTmp=true
ProtectSystem=full
NoNewPrivileges=true
PrivateDevices=true
[Install]
WantedBy=multi-user.target
" | sudo tee /etc/systemd/system/${systemdService}.service
sudo chown root:root /etc/systemd/system/${systemdService}.service
echo "# Allowing port ${portprefix}8000 through the firewall"
sudo ufw allow "${portprefix}8000" comment "${netprefix}spark-wallet"
/home/admin/config.scripts/tor.onion-service.sh ${netprefix}spark-wallet 443 ${portprefix}8000
# setting value in raspi blitz config
/home/admin/config.scripts/blitz.conf.sh set ${netprefix}spark "on"
sudo systemctl enable ${systemdService}
sudo systemctl start ${systemdService}
echo "# OK - the ${systemdService}.service is now enabled & started"
echo "# Monitor with: sudo journalctl -f -u ${systemdService}"
exit 0
fi
if [ $1 = off ];then
sudo systemctl stop ${systemdService} 2>/dev/null
sudo systemctl disable ${systemdService} 2>/dev/null
/home/admin/config.scripts/tor.onion-service.sh off ${netprefix}spark-wallet
# purge
if [ "$(echo "$@" | grep -c purge)" -gt 0 ];then
echo "# Delete install directory"
sudo rm -rf /home/bitcoin/spark-wallet
fi
# setting value in raspi blitz config
/home/admin/config.scripts/blitz.conf.sh set ${netprefix}spark "off"
echo "# ${netprefix}spark was uninstalled"
fi