mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-09-26 11:37:19 +02:00
show node address in main menu
This commit is contained in:
@@ -60,6 +60,9 @@ else
|
|||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
|
# set node address as backtitle
|
||||||
|
BACKTITLE=$(lncli getinfo | grep "uris" -A 2 | tr -d '\n' | cut -d '"' -f4)
|
||||||
|
|
||||||
chain=$(${network}-cli -datadir=/home/bitcoin/.${network} getblockchaininfo | jq -r '.chain')
|
chain=$(${network}-cli -datadir=/home/bitcoin/.${network} getblockchaininfo | jq -r '.chain')
|
||||||
switchOption="to MAINNET"
|
switchOption="to MAINNET"
|
||||||
if [ "${chain}" = "main" ]; then
|
if [ "${chain}" = "main" ]; then
|
||||||
@@ -86,7 +89,7 @@ else
|
|||||||
fi
|
fi
|
||||||
torInstalled=$(sudo ls /mnt/hdd/tor/lnd9735/hostname 2>/dev/null | grep 'hostname' -c)
|
torInstalled=$(sudo ls /mnt/hdd/tor/lnd9735/hostname 2>/dev/null | grep 'hostname' -c)
|
||||||
if [ ${torInstalled} -eq 0 ]; then
|
if [ ${torInstalled} -eq 0 ]; then
|
||||||
OPTIONS+=(TOR "Make reachable thru TOR")
|
OPTIONS+=(TOR "Make reachable thru TOR")
|
||||||
else
|
else
|
||||||
OPTIONS+=(NYX "Monitor TOR")
|
OPTIONS+=(NYX "Monitor TOR")
|
||||||
fi
|
fi
|
||||||
|
@@ -75,7 +75,6 @@ while [ ${#result} -lt 8 ]
|
|||||||
sed -i "s/^rpcpassword=.*/rpcpassword=${result}/g" /home/admin/assets/${network}.conf
|
sed -i "s/^rpcpassword=.*/rpcpassword=${result}/g" /home/admin/assets/${network}.conf
|
||||||
sed -i "s/^${network}d.rpcpass=.*/${network}d.rpcpass=${result}/g" /home/admin/assets/lnd.${network}.conf
|
sed -i "s/^${network}d.rpcpass=.*/${network}d.rpcpass=${result}/g" /home/admin/assets/lnd.${network}.conf
|
||||||
|
|
||||||
|
|
||||||
# success info dialog
|
# success info dialog
|
||||||
dialog --backtitle "RaspiBlitz - SetUP" --msgbox "OK - RPC password changed to '$result'\n\nNow starting the Setup of your RaspiBlitz." 7 52
|
dialog --backtitle "RaspiBlitz - SetUP" --msgbox "OK - RPC password changed to '$result'\n\nNow starting the Setup of your RaspiBlitz." 7 52
|
||||||
clear
|
clear
|
||||||
|
@@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
# load network
|
# load network
|
||||||
network=`cat .network`
|
network=`cat .network`
|
||||||
|
chain="$(${network}-cli getblockchaininfo | jq -r '.chain')"
|
||||||
|
|
||||||
# location of TOR config
|
# location of TOR config
|
||||||
torrc="/etc/tor/torrc"
|
torrc="/etc/tor/torrc"
|
||||||
@@ -64,7 +65,7 @@ sudo mkdir /mnt/hdd/tor/sys
|
|||||||
sudo mkdir /mnt/hdd/tor/web80
|
sudo mkdir /mnt/hdd/tor/web80
|
||||||
sudo mkdir /mnt/hdd/tor/lnd9735
|
sudo mkdir /mnt/hdd/tor/lnd9735
|
||||||
sudo chmod -R 700 /mnt/hdd/tor
|
sudo chmod -R 700 /mnt/hdd/tor
|
||||||
sudo chown -R debian-tor:debian-tor /mnt/hdd/tor
|
sudo chown -R bitcoin:bitcoin /mnt/hdd/tor
|
||||||
cat > ./torrc <<EOF
|
cat > ./torrc <<EOF
|
||||||
### See 'man tor', or https://www.torproject.org/docs/tor-manual.html
|
### See 'man tor', or https://www.torproject.org/docs/tor-manual.html
|
||||||
|
|
||||||
@@ -77,8 +78,9 @@ Log notice file /mnt/hdd/tor/notice.log
|
|||||||
Log info file /mnt/hdd/tor/info.log
|
Log info file /mnt/hdd/tor/info.log
|
||||||
|
|
||||||
RunAsDaemon 1
|
RunAsDaemon 1
|
||||||
|
User bitcoin
|
||||||
PortForwarding 1
|
PortForwarding 1
|
||||||
ControlPort 905
|
ControlPort 9051
|
||||||
SocksPort 9050
|
SocksPort 9050
|
||||||
|
|
||||||
CookieAuthFile /mnt/hdd/tor/sys/control_auth_cookie
|
CookieAuthFile /mnt/hdd/tor/sys/control_auth_cookie
|
||||||
@@ -121,11 +123,11 @@ echo ""
|
|||||||
|
|
||||||
echo "*** Setting Permissions ***"
|
echo "*** Setting Permissions ***"
|
||||||
# so that chain network can create Tor hidden service
|
# so that chain network can create Tor hidden service
|
||||||
echo "setting bitcoind permissions"
|
#echo "setting bitcoind permissions"
|
||||||
sudo usermod -a -G debian-tor bitcoin
|
#sudo usermod -a -G debian-tor bitcoin
|
||||||
# so that you can run `arm` as user
|
# so that you can run `arm` as user
|
||||||
echo "setting pi permissions"
|
#echo "setting pi permissions"
|
||||||
sudo usermod -a -G debian-tor pi
|
#sudo usermod -a -G debian-tor pi
|
||||||
|
|
||||||
echo "*** Waiting for TOR to boostrap ***"
|
echo "*** Waiting for TOR to boostrap ***"
|
||||||
torIsBootstrapped=0
|
torIsBootstrapped=0
|
||||||
@@ -171,7 +173,11 @@ if [ "${network}" = "bitcoin" ]; then
|
|||||||
do
|
do
|
||||||
echo "--- Checking ---"
|
echo "--- Checking ---"
|
||||||
date +%s
|
date +%s
|
||||||
sudo cat /mnt/hdd/${network}/debug.log | grep "tor" | tail -n 10
|
testNetAdd=""
|
||||||
|
if [ "${chain}" = "test" ];then
|
||||||
|
testNetAdd="/testnet3"
|
||||||
|
fi
|
||||||
|
sudo cat /mnt/hdd/${network}${testNetAdd}/debug.log 2>/dev/null | grep "tor" | tail -n 10
|
||||||
onionAddress=$(${network}-cli getnetworkinfo | grep '"address"' | cut -d '"' -f4)
|
onionAddress=$(${network}-cli getnetworkinfo | grep '"address"' | cut -d '"' -f4)
|
||||||
echo "If this takes too long --> CTRL+c, reboot and check manually"
|
echo "If this takes too long --> CTRL+c, reboot and check manually"
|
||||||
sleep 5
|
sleep 5
|
||||||
@@ -184,15 +190,14 @@ else
|
|||||||
fi
|
fi
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
echo "*** Setting your Onion Address ***"
|
#echo "*** Setting your Onion Address ***"
|
||||||
onionLND=$(sudo cat /mnt/hdd/tor/lnd9735/hostname)
|
#onionLND=$(sudo cat /mnt/hdd/tor/lnd9735/hostname)
|
||||||
echo "Your Lightning Tor Onion Address is: ${onionLND}:9735"
|
#echo "Your Lightning Tor Onion Address is: ${onionLND}:9735"
|
||||||
echo ""
|
#echo ""
|
||||||
|
|
||||||
# ACTIVATE LND OVER TOR
|
# ACTIVATE LND OVER TOR
|
||||||
sudo systemctl disable lnd
|
sudo systemctl disable lnd
|
||||||
echo "Writing Public Onion Address to /run/publicip"
|
|
||||||
echo "PUBLICIP=${onionLND}" | sudo tee /run/publicip
|
|
||||||
sed -i "5s/.*/Wants=${network}d.service/" ./assets/lnd.tor.service
|
sed -i "5s/.*/Wants=${network}d.service/" ./assets/lnd.tor.service
|
||||||
sed -i "6s/.*/After=${network}d.service/" ./assets/lnd.tor.service
|
sed -i "6s/.*/After=${network}d.service/" ./assets/lnd.tor.service
|
||||||
sudo cp /home/admin/assets/lnd.tor.service /etc/systemd/system/lnd.service
|
sudo cp /home/admin/assets/lnd.tor.service /etc/systemd/system/lnd.service
|
||||||
|
@@ -5,10 +5,11 @@
|
|||||||
echo 'getpublicip.sh started, writing public IP address every 10 minutes into /run/publicip'
|
echo 'getpublicip.sh started, writing public IP address every 10 minutes into /run/publicip'
|
||||||
while [ 0 ];
|
while [ 0 ];
|
||||||
do
|
do
|
||||||
torExists=$(sudo ls /mnt/hdd/tor/lnd9735/hostname 2>/dev/null | grep hostname -c)
|
torExists=$(sudo ls /mnt/hdd/tor/web80/hostname 2>/dev/null | grep hostname -c)
|
||||||
if [ ${torExists} -eq 1 ]; then
|
if [ ${torExists} -eq 1 ]; then
|
||||||
# use tor onion address
|
# use tor onion address
|
||||||
printf "PUBLICIP=$(sudo cat /mnt/hdd/tor/lnd9735/hostname)\n" > /run/publicip;
|
# printf "PUBLICIP=$(sudo cat /mnt/hdd/tor/lnd9735/hostname)\n" > /run/publicip;
|
||||||
|
# just leave /run/publicip
|
||||||
else
|
else
|
||||||
# get public IP
|
# get public IP
|
||||||
printf "PUBLICIP=$(curl -vv ipinfo.io/ip 2> /run/publicip.log)\n" > /run/publicip;
|
printf "PUBLICIP=$(curl -vv ipinfo.io/ip 2> /run/publicip.log)\n" > /run/publicip;
|
||||||
|
@@ -12,7 +12,14 @@ After=bitcoind.service
|
|||||||
# get var PUBIP from file
|
# get var PUBIP from file
|
||||||
EnvironmentFile=/run/publicip
|
EnvironmentFile=/run/publicip
|
||||||
|
|
||||||
|
# TOR Hidden Service v2
|
||||||
|
# had bad memory performance with raspi with lnd 0.4.2
|
||||||
|
# ExecStart=/usr/local/bin/lnd --tor.active --tor.v2 --listen=127.0.0.1:9735
|
||||||
|
# --tor.V2PrivateKeyPath=/mnt/hdd/bitcoin/[testnet3/]onion_private_key
|
||||||
|
|
||||||
|
# TOR Hidden Service v3
|
||||||
ExecStart=/usr/local/bin/lnd --tor.active --tor.v3 --externalip=${PUBLICIP} --listen=127.0.0.1:9735
|
ExecStart=/usr/local/bin/lnd --tor.active --tor.v3 --externalip=${PUBLICIP} --listen=127.0.0.1:9735
|
||||||
|
|
||||||
PIDFile=/home/bitcoin/.lnd/lnd.pid
|
PIDFile=/home/bitcoin/.lnd/lnd.pid
|
||||||
User=bitcoin
|
User=bitcoin
|
||||||
Group=bitcoin
|
Group=bitcoin
|
||||||
|
Reference in New Issue
Block a user