diff --git a/home.admin/00chainMenu.sh b/home.admin/00chainMenu.sh index ba7f5aec9..044387bee 100644 --- a/home.admin/00chainMenu.sh +++ b/home.admin/00chainMenu.sh @@ -1,7 +1,7 @@ #!/bin/bash # Usage: -# 00chainMenu.sh +# 00testnetMenu.sh source /home/admin/raspiblitz.info # add default value to raspi config if needed @@ -21,17 +21,6 @@ else nonDefaultChain=0 CHAIN=${chain}net fi -# prefix for parallel services -if [ ${CHAIN} = testnet ];then - chainprefix="t" - portprefix=1 -elif [ ${CHAIN} = signet ];then - chainprefix="s" - portprefix=3 -elif [ ${CHAIN} = mainnet ];then - chainprefix="" - portprefix="" -fi # LNTYPE is lnd | cln if [ $# -gt 1 ]&&[ $2 != $LNdefault ];then @@ -42,11 +31,6 @@ else LNTYPE=$LNdefault fi -if [ ${LNTYPE} != lnd ]&&[ ${LNTYPE} != cln ];then - echo "# ${LNTYPE} is not a supported LNTYPE" - exit 1 -fi - # get the local network IP to be displayed on the LCD source <(/home/admin/config.scripts/internet.sh status local) @@ -69,26 +53,34 @@ fi BACKTITLE="${localip} / ${hostname} / ${network} / ${chain}${plus}" # Put Activated Apps on top -if [ "${chainprefix}rtlWebinterface}" == "on" ]; then +if [ $chain = test ]&&[ "$trtlWebinterface" = "on" ]||\ + [ $chain = sig ]&& [ "$srtlWebinterface" = "on" ]||\ + [ $chain = main ]&&[ "$rtlWebinterface" = "on" ]; then OPTIONS+=(RTL "RTL Web Node Manager for LND ${CHAIN}") HEIGHT=$((HEIGHT+1)) CHOICE_HEIGHT=$((CHOICE_HEIGHT+1)) fi -if [ "${chainprefix}lnd" == "on" ]; then +if [ $chain = test ]&&[ "$tlnd" = "on" ]||\ + [ $chain = sig ]&& [ "$slnd" = "on" ]||\ + [ $chain = main ]&&[ "$lnd" = "on" ]; then #TODO OPTIONS+=(LND "LND options for ${CHAIN}") HEIGHT=$((HEIGHT+1)) CHOICE_HEIGHT=$((CHOICE_HEIGHT+1)) fi -if [ "${chainprefix}crtlWebinterface}" == "on" ]; then +if [ "$chain" = "test" ]&&[ "$tcrtlWebinterface" = "on" ]||\ + [ "$chain" = "sig" ]&& [ "$scrtlWebinterface" = "on" ]||\ + [ "$chain" = "main" ]&&[ "$crtlWebinterface" = "on" ]; then OPTIONS+=(cRTL "RTL Web Node Manager for C-lightning ${CHAIN}") HEIGHT=$((HEIGHT+1)) CHOICE_HEIGHT=$((CHOICE_HEIGHT+1)) fi -if [ "${chainprefix}cln" == "on" ]; then - #TODO OPTIONS+=(CLN "C-lightning options for ${CHAIN}") +if [ "$chain" = "test" ]&&[ "$tcln" = "on" ]||\ + [ "$chain" = "sig" ]&& [ "$scln" = "on" ]||\ + [ "$chain" = "main" ]&&[ "$cln" = "on" ]; then + OPTIONS+=(CLN "C-lightning options for ${CHAIN}") HEIGHT=$((HEIGHT+1)) CHOICE_HEIGHT=$((CHOICE_HEIGHT+1)) fi @@ -153,7 +145,7 @@ case $CHOICE in # exit 0 # fi /home/admin/00infoBlitz.sh $CHAIN - ;; + ;; RTL) /home/admin/config.scripts/bonus.rtl.sh menu lnd $CHAIN ;; @@ -162,23 +154,18 @@ case $CHOICE in ;; LND) /home/admin/99lndMenu.sh $CHAIN - # TODO ;; CLN) - /home/admin/99CLNmenu.sh $CHAIN - # TODO + /home/admin/99clnMenu.sh $CHAIN ;; SERVICES) /home/admin/00testnetServices.sh $CHAIN - # TODO ;; SYSTEM) /home/admin/99systemMenu.sh $CHAIN - # TODO ;; CONNECT) /home/admin/99connectMenu.sh $CHAIN - # TODO ;; SWITCHLN) # setting value in raspi blitz config diff --git a/home.admin/00mainMenu.sh b/home.admin/00mainMenu.sh index f5e6048f5..6766644c8 100755 --- a/home.admin/00mainMenu.sh +++ b/home.admin/00mainMenu.sh @@ -171,20 +171,28 @@ if [ "${circuitbreaker}" == "on" ]; then CHOICE_HEIGHT=$((CHOICE_HEIGHT+1)) fi -if [ "${testnet}" == "on" ]; then +if [ "${testnet}" == "on" ]&&[ ${chain} != test ];then OPTIONS+=(TESTNET "Testnet Service Options") HEIGHT=$((HEIGHT+1)) CHOICE_HEIGHT=$((CHOICE_HEIGHT+1)) fi +if [ "${mainnet}" == "on" ]&&[ ${chain} != main ];then + OPTIONS+=(MAINNET "Mainnet Service Options") + HEIGHT=$((HEIGHT+1)) + CHOICE_HEIGHT=$((CHOICE_HEIGHT+1)) +fi + # Basic Options OPTIONS+=(INFO "RaspiBlitz Status Screen") OPTIONS+=(LND "LND Wallet Options") -if [ "${${netprefix}cln}" == "on" ]; then + +if [ "$cln" == "on" ]||[ $chain = test ]&&[ "$tcln" == "on" ]; then OPTIONS+=(CLN "C-lightning Wallet Options") HEIGHT=$((HEIGHT+1)) CHOICE_HEIGHT=$((CHOICE_HEIGHT+1)) fi + OPTIONS+=(SETTINGS "Node Settings & Options") OPTIONS+=(SERVICES "Additional Apps & Services") OPTIONS+=(SYSTEM "Monitoring & Configuration") @@ -324,6 +332,9 @@ case $CHOICE in TESTNET) /home/admin/00chainMenu.sh testnet ;; + MAINNET) + /home/admin/00chainMenu.sh mainnet + ;; SUBSCRIBE) /home/admin/config.scripts/blitz.subscriptions.py ;; diff --git a/home.admin/BBfundWallet.sh b/home.admin/BBfundWallet.sh index 002a43b41..2470b03e5 100755 --- a/home.admin/BBfundWallet.sh +++ b/home.admin/BBfundWallet.sh @@ -48,7 +48,6 @@ alias lncli_alias="$lncli_alias" alias bitcoincli_alias="$bitcoincli_alias" alias lightningcli_alias="$lightningcli_alias" - # PRECHECK) check if chain is in sync if [ $LNTYPE = cln ];then BLOCKHEIGHT=$(bitcoincli_alias getblockchaininfo|grep blocks|awk '{print $2}'|cut -d, -f1) @@ -58,7 +57,7 @@ if [ $LNTYPE = cln ];then else chainOutSync=1 fi -else +elif [ $LNTYPE = lnd ];then chainOutSync=$(lncli_alias getinfo | grep '"synced_to_chain": false' -c) fi if [ ${chainOutSync} -eq 1 ]; then @@ -78,7 +77,7 @@ fi # execute command if [ $LNTYPE = cln ];then command="$lightningcli_alias newaddr bech32" -else +elif [ $LNTYPE = lnd ];then command="$lncli_alias newaddress p2wkh" fi echo "# Calling:" @@ -134,7 +133,7 @@ fi # follow up info if [ $LNTYPE = cln ];then string="Wait for confirmations." -else +elif [ $LNTYPE = lnd ];then string="Wait for confirmations. \n\nYou can use info on LCD to check if funds have arrived. \n\nIf you want your lighting node to open channels automatically, activate the 'Autopilot' under 'Activate/Deactivate Services'" fi whiptail --backtitle "Fund your onchain wallet" \ diff --git a/home.admin/config.scripts/lnd.chain.sh b/home.admin/config.scripts/lnd.chain.sh index 97373c99c..2ce8a483b 100644 --- a/home.admin/config.scripts/lnd.chain.sh +++ b/home.admin/config.scripts/lnd.chain.sh @@ -26,7 +26,7 @@ fi if [ ${CHAIN} = testnet ];then prefix="t" portprefix=1 - rpcportprefix=1 + rpcportmod=1 zmqprefix=21 elif [ ${CHAIN} = signet ];then prefix="s"