add SWITCHLN to lndMenu and clnMenu

This commit is contained in:
openoms 2021-05-28 20:28:56 +01:00
parent 8d0dae14c7
commit 7291e54174
No known key found for this signature in database
GPG key ID: 5BFB77609B081B65
4 changed files with 153 additions and 124 deletions

View file

@ -1,5 +1,7 @@
#!/bin/bash
# 00infoBlitz.sh <cln|lnd> <testnet|mainnet|signet>
# load code software version
source /home/admin/_version.info
@ -14,10 +16,6 @@ color_gray='\033[0;37m'
source /home/admin/raspiblitz.info 2>/dev/null
source /mnt/hdd/raspiblitz.conf 2>/dev/null
if [ $# -gt 0 ];then
CHAIN=$1
chain=${CHAIN::-3}
fi
source <(/home/admin/config.scripts/network.aliases.sh getvars $1 $2)
shopt -s expand_aliases
alias bitcoincli_alias="$bitcoincli_alias"

View file

@ -45,6 +45,11 @@ if [ ${#openChannels} -gt 0 ] && [ ${openChannels} -gt 0 ]; then
HEIGHT=$((HEIGHT+1))
CHOICE_HEIGHT=$((CHOICE_HEIGHT+1))
fi
if [ ${#LNdefault} -gt 0 ]&&[ $LNdefault = lnd ];then
OPTIONS+=(SWITCHLN "Use C-lightning as default")
HEIGHT=$((HEIGHT+1))
CHOICE_HEIGHT=$((CHOICE_HEIGHT+1))
fi
#TODO OPTIONS+=(CASHOUT "Remove Funds from LND")
@ -59,64 +64,74 @@ CHOICE=$(dialog --clear \
2>&1 >/dev/tty)
case $CHOICE in
lnbalance)
clear
echo "*** YOUR SATOSHI BALANCES ***"
/home/admin/config.scripts/lnd.balance.sh ${network}
echo "Press ENTER to return to main menu."
read key
;;
lnchannels)
clear
echo "*** YOUR LIGHTNING CHANNELS ***"
echo ""
echo "Capacity -> total sats in the channel (their side + your side)"
echo "Commit-Fee -> the fee that's charged if either side of the channel closes"
echo "Balance-Local -> sats on your side of the channel (outbound liquidity)"
echo "Balance-Remote -> sats on their side of the channel (inbound liquidity)"
echo "Fee-Base -> fixed fee (in millisatoshis) per forwarding on channel"
echo "Fee-PerMil -> amount based fee (millisatoshis per 1 satoshi) on forwarding"
/home/admin/config.scripts/lnd.channels.sh ${network}
echo "Press ENTER to return to main menu."
read key
;;
lnfwdreport)
/home/admin/config.scripts/lnd.fwdreport.sh -menu
echo "Press ENTER to return to main menu."
read key
;;
PEERING)
/home/admin/BBconnectPeer.sh cln $NETWORK
;;
FUNDING)
/home/admin/BBfundWallet.sh cln $NETWORK
;;
CASHOUT)
/home/admin/BBcashoutWallet.sh
;;
CHANNEL)
/home/admin/BBopenChannel.sh cln $NETWORK
;;
SEND)
/home/admin/BBpayInvoice.sh cln $NETWORK
;;
RECEIVE)
/home/admin/BBcreateInvoice.sh cln $NETWORK
;;
NAME)
sudo /home/admin/config.scripts/lnd.setname.sh
noreboot=$?
if [ "${noreboot}" = "0" ]; then
sudo -u bitcoin ${network}-cli stop
echo "Press ENTER to Reboot."
read key
sudo /home/admin/XXshutdown.sh reboot
exit 0
fi
;;
CLOSEALL)
/home/admin/BBcloseAllChannels.sh
echo "Press ENTER to return to main menu."
read key
;;
lnbalance)
clear
echo "*** YOUR SATOSHI BALANCES ***"
/home/admin/config.scripts/lnd.balance.sh ${network}
echo "Press ENTER to return to main menu."
read key
;;
lnchannels)
clear
echo "*** YOUR LIGHTNING CHANNELS ***"
echo ""
echo "Capacity -> total sats in the channel (their side + your side)"
echo "Commit-Fee -> the fee that's charged if either side of the channel closes"
echo "Balance-Local -> sats on your side of the channel (outbound liquidity)"
echo "Balance-Remote -> sats on their side of the channel (inbound liquidity)"
echo "Fee-Base -> fixed fee (in millisatoshis) per forwarding on channel"
echo "Fee-PerMil -> amount based fee (millisatoshis per 1 satoshi) on forwarding"
/home/admin/config.scripts/lnd.channels.sh ${network}
echo "Press ENTER to return to main menu."
read key
;;
lnfwdreport)
/home/admin/config.scripts/lnd.fwdreport.sh -menu
echo "Press ENTER to return to main menu."
read key
;;
PEERING)
/home/admin/BBconnectPeer.sh cln $NETWORK
;;
FUNDING)
/home/admin/BBfundWallet.sh cln $NETWORK
;;
CASHOUT)
/home/admin/BBcashoutWallet.sh
;;
CHANNEL)
/home/admin/BBopenChannel.sh cln $NETWORK
;;
SEND)
/home/admin/BBpayInvoice.sh cln $NETWORK
;;
RECEIVE)
/home/admin/BBcreateInvoice.sh cln $NETWORK
;;
NAME)
sudo /home/admin/config.scripts/lnd.setname.sh
noreboot=$?
if [ "${noreboot}" = "0" ]; then
sudo -u bitcoin ${network}-cli stop
echo "Press ENTER to Reboot."
read key
sudo /home/admin/XXshutdown.sh reboot
exit 0
fi
;;
CLOSEALL)
/home/admin/BBcloseAllChannels.sh
echo "Press ENTER to return to main menu."
read key
;;
SWITCHLN)
clear
echo
# setting value in raspi blitz config
sudo sed -i "s/^LNdefault=.*/LNdefault=cln/g" /mnt/hdd/raspiblitz.conf
echo "# OK - LNdefault=cln is set in /mnt/hdd/raspiblitz.conf"
echo
echo "Press ENTER to return to main menu."
read key
;;
esac

View file

@ -41,6 +41,11 @@ if [ ${#openChannels} -gt 0 ] && [ ${openChannels} -gt 0 ]; then
fi
OPTIONS+=(CASHOUT "Remove Funds from LND")
if [ ${#LNdefault} -gt 0 ]&&[ $LNdefault = cln ];then
OPTIONS+=(SWITCHLN "Use LND as default")
HEIGHT=$((HEIGHT+1))
CHOICE_HEIGHT=$((CHOICE_HEIGHT+1))
fi
CHOICE=$(dialog --clear \
--backtitle "$BACKTITLE" \
@ -53,64 +58,74 @@ CHOICE=$(dialog --clear \
2>&1 >/dev/tty)
case $CHOICE in
lnbalance)
clear
echo "*** YOUR SATOSHI BALANCES ***"
/home/admin/config.scripts/lnd.balance.sh ${network}
echo "Press ENTER to return to main menu."
read key
;;
lnchannels)
clear
echo "*** YOUR LIGHTNING CHANNELS ***"
echo ""
echo "Capacity -> total sats in the channel (their side + your side)"
echo "Commit-Fee -> the fee that's charged if either side of the channel closes"
echo "Balance-Local -> sats on your side of the channel (outbound liquidity)"
echo "Balance-Remote -> sats on their side of the channel (inbound liquidity)"
echo "Fee-Base -> fixed fee (in millisatoshis) per forwarding on channel"
echo "Fee-PerMil -> amount based fee (millisatoshis per 1 satoshi) on forwarding"
/home/admin/config.scripts/lnd.channels.sh ${network}
echo "Press ENTER to return to main menu."
read key
;;
lnfwdreport)
/home/admin/config.scripts/lnd.fwdreport.sh -menu
echo "Press ENTER to return to main menu."
read key
;;
PEERING)
/home/admin/BBconnectPeer.sh
;;
FUNDING)
/home/admin/BBfundWallet.sh
;;
CASHOUT)
/home/admin/BBcashoutWallet.sh
;;
CHANNEL)
/home/admin/BBopenChannel.sh
;;
SEND)
/home/admin/BBpayInvoice.sh
;;
RECEIVE)
/home/admin/BBcreateInvoice.sh
;;
NAME)
sudo /home/admin/config.scripts/lnd.setname.sh
noreboot=$?
if [ "${noreboot}" = "0" ]; then
sudo -u bitcoin ${network}-cli stop
echo "Press ENTER to Reboot."
read key
sudo /home/admin/XXshutdown.sh reboot
exit 0
fi
;;
CLOSEALL)
/home/admin/BBcloseAllChannels.sh
echo "Press ENTER to return to main menu."
read key
;;
lnbalance)
clear
echo "*** YOUR SATOSHI BALANCES ***"
/home/admin/config.scripts/lnd.balance.sh ${network}
echo "Press ENTER to return to main menu."
read key
;;
lnchannels)
clear
echo "*** YOUR LIGHTNING CHANNELS ***"
echo ""
echo "Capacity -> total sats in the channel (their side + your side)"
echo "Commit-Fee -> the fee that's charged if either side of the channel closes"
echo "Balance-Local -> sats on your side of the channel (outbound liquidity)"
echo "Balance-Remote -> sats on their side of the channel (inbound liquidity)"
echo "Fee-Base -> fixed fee (in millisatoshis) per forwarding on channel"
echo "Fee-PerMil -> amount based fee (millisatoshis per 1 satoshi) on forwarding"
/home/admin/config.scripts/lnd.channels.sh ${network}
echo "Press ENTER to return to main menu."
read key
;;
lnfwdreport)
/home/admin/config.scripts/lnd.fwdreport.sh -menu
echo "Press ENTER to return to main menu."
read key
;;
PEERING)
/home/admin/BBconnectPeer.sh
;;
FUNDING)
/home/admin/BBfundWallet.sh
;;
CASHOUT)
/home/admin/BBcashoutWallet.sh
;;
CHANNEL)
/home/admin/BBopenChannel.sh
;;
SEND)
/home/admin/BBpayInvoice.sh
;;
RECEIVE)
/home/admin/BBcreateInvoice.sh
;;
NAME)
sudo /home/admin/config.scripts/lnd.setname.sh
noreboot=$?
if [ "${noreboot}" = "0" ]; then
sudo -u bitcoin ${network}-cli stop
echo "Press ENTER to Reboot."
read key
sudo /home/admin/XXshutdown.sh reboot
exit 0
fi
;;
CLOSEALL)
/home/admin/BBcloseAllChannels.sh
echo "Press ENTER to return to main menu."
read key
;;
SWITCHLN)
clear
echo
# setting value in raspi blitz config
sudo sed -i "s/^LNdefault=.*/LNdefault=lnd/g" /mnt/hdd/raspiblitz.conf
echo "# OK - LNdefault=lnd is set in /mnt/hdd/raspiblitz.conf"
echo
echo "Press ENTER to return to main menu."
read key
;;
esac

View file

@ -129,6 +129,7 @@ function status() {
while :
do
# show the same info as on LCD screen
# 00infoBlitz.sh <cln|lnd> <testnet|mainnet|signet>
/home/admin/00infoBlitz.sh $1 $2
# wait 6 seconds for user exiting loop
#echo