mirror of
https://github.com/Retropex/raspiblitz.git
synced 2025-05-21 17:42:33 +02:00
Merge branch 'dev' of https://github.com/rootzoll/raspiblitz into dev
This commit is contained in:
commit
36bf1a84d9
@ -1,7 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# https://github.com/romanz/electrs/blob/master/doc/usage.md
|
# https://github.com/romanz/electrs/releases
|
||||||
ELECTRSVERSION="v0.8.12"
|
#ELECTRSVERSION="v0.9.0-rc1"
|
||||||
|
# https://github.com/romanz/electrs/commits/master
|
||||||
|
ELECTRSVERSION="3041e89cd2fb377541b929d852ef6298c2d4e60a"
|
||||||
|
|
||||||
# command info
|
# command info
|
||||||
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
|
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
|
||||||
@ -39,7 +41,7 @@ if [ "$1" = "status" ]; then
|
|||||||
if [ ${serviceRunning} -eq 1 ]; then
|
if [ ${serviceRunning} -eq 1 ]; then
|
||||||
|
|
||||||
# Experimental try to get sync Info
|
# Experimental try to get sync Info
|
||||||
syncedToBlock=$(sudo journalctl -u electrs --no-pager -n2000 | grep "new headers from height" | tail -n 1 | cut -d " " -f 16 | sed 's/[^0-9]*//g')
|
syncedToBlock=$(sudo journalctl -u electrs --no-pager -n2000 | grep "height=" | tail -n1| cut -d= -f3)
|
||||||
blockchainHeight=$(sudo -u bitcoin ${network}-cli getblockchaininfo 2>/dev/null | jq -r '.headers' | sed 's/[^0-9]*//g')
|
blockchainHeight=$(sudo -u bitcoin ${network}-cli getblockchaininfo 2>/dev/null | jq -r '.headers' | sed 's/[^0-9]*//g')
|
||||||
lastBlockchainHeight=$(($blockchainHeight -1))
|
lastBlockchainHeight=$(($blockchainHeight -1))
|
||||||
syncProgress=0
|
syncProgress=0
|
||||||
@ -91,7 +93,7 @@ if [ "$1" = "status" ]; then
|
|||||||
# no answer on that port
|
# no answer on that port
|
||||||
echo "publicTCPPortAnswering=0"
|
echo "publicTCPPortAnswering=0"
|
||||||
fi
|
fi
|
||||||
echo "portHTTP='50002'"
|
echo "portSSL='50002'"
|
||||||
localPortRunning=$(sudo netstat -an | grep -c '0.0.0.0:50002')
|
localPortRunning=$(sudo netstat -an | grep -c '0.0.0.0:50002')
|
||||||
echo "localHTTPPortActive=${localPortRunning}"
|
echo "localHTTPPortActive=${localPortRunning}"
|
||||||
publicPortRunning=$(nc -z -w6 ${publicip} 50002 2>/dev/null; echo $?)
|
publicPortRunning=$(nc -z -w6 ${publicip} 50002 2>/dev/null; echo $?)
|
||||||
@ -104,13 +106,13 @@ if [ "$1" = "status" ]; then
|
|||||||
fi
|
fi
|
||||||
# add TOR info
|
# add TOR info
|
||||||
if [ "${runBehindTor}" == "on" ]; then
|
if [ "${runBehindTor}" == "on" ]; then
|
||||||
echo "TORrunning=1"
|
echo "TorRunning=1"
|
||||||
if [ "$2" = "showAddress" ]; then
|
if [ "$2" = "showAddress" ]; then
|
||||||
TORaddress=$(sudo cat /mnt/hdd/tor/electrs/hostname)
|
TORaddress=$(sudo cat /mnt/hdd/tor/electrs/hostname)
|
||||||
echo "TORaddress='${TORaddress}'"
|
echo "TORaddress='${TORaddress}'"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "TORrunning=0"
|
echo "TorRunning=0"
|
||||||
fi
|
fi
|
||||||
# check Nginx
|
# check Nginx
|
||||||
nginxTest=$(sudo nginx -t 2>&1 | grep -c "test is successful")
|
nginxTest=$(sudo nginx -t 2>&1 | grep -c "test is successful")
|
||||||
@ -193,12 +195,12 @@ Check 'sudo nginx -t' for a detailed error message.
|
|||||||
echo
|
echo
|
||||||
echo "On Network Settings > Server menu:"
|
echo "On Network Settings > Server menu:"
|
||||||
echo "- deactivate automatic server selection"
|
echo "- deactivate automatic server selection"
|
||||||
echo "- as manual server set '${localip}' & '${portHTTP}'"
|
echo "- as manual server set '${localip}' & '${portSSL}'"
|
||||||
echo "- laptop and RaspiBlitz need to be within same local network"
|
echo "- laptop and RaspiBlitz need to be within same local network"
|
||||||
echo
|
echo
|
||||||
echo "To start directly from laptop terminal use:"
|
echo "To start directly from laptop terminal use:"
|
||||||
echo "electrum --oneserver --server ${localip}:${portHTTP}:s"
|
echo "electrum --oneserver --server ${localip}:${portSSL}:s"
|
||||||
if [ ${TORrunning} -eq 1 ]; then
|
if [ ${TorRunning} -eq 1 ]; then
|
||||||
echo
|
echo
|
||||||
echo "The Tor Hidden Service address for electrs is (see LCD for QR code):"
|
echo "The Tor Hidden Service address for electrs is (see LCD for QR code):"
|
||||||
echo "${TORaddress}"
|
echo "${TORaddress}"
|
||||||
|
Loading…
Reference in New Issue
Block a user