mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-09-21 14:11:06 +02:00
updated torrent and litecoin fixes
This commit is contained in:
@@ -151,14 +151,15 @@ else
|
|||||||
external_color="${color_red}"
|
external_color="${color_red}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
networkVersion = $(${network}-cli -cli -version | cut -d " " -f6)
|
networkVersion=$(${network}-cli -datadir=${bitcoin_dir} -version | cut -d ' ' -f6)
|
||||||
|
ln_alias=`sudo -u admin cat /home/admin/.hostname`
|
||||||
|
|
||||||
printf "
|
printf "
|
||||||
${color_yellow}
|
${color_yellow}
|
||||||
${color_yellow}
|
${color_yellow}
|
||||||
${color_yellow}
|
${color_yellow}
|
||||||
${color_yellow} ${color_yellow}%s ${color_green} ${ln_alias}
|
${color_yellow} ${color_yellow}%s ${color_green} ${ln_alias}
|
||||||
${color_yellow} ${color_gray}$Fullnode + Lightning Network
|
${color_yellow} ${color_gray}${network} Fullnode + Lightning Network
|
||||||
${color_yellow} ${color_yellow}%s
|
${color_yellow} ${color_yellow}%s
|
||||||
${color_yellow} ,/ ${color_yellow}
|
${color_yellow} ,/ ${color_yellow}
|
||||||
${color_yellow} ,'/ ${color_gray}%s, CPU %s°C
|
${color_yellow} ,'/ ${color_gray}%s, CPU %s°C
|
||||||
|
@@ -18,6 +18,9 @@ if [ "$USER" = "pi" ]; then
|
|||||||
while :
|
while :
|
||||||
do
|
do
|
||||||
|
|
||||||
|
# refresh network
|
||||||
|
network=`sudo cat /home/admin/.network`
|
||||||
|
|
||||||
# get the setup state
|
# get the setup state
|
||||||
setupStepExists=$(sudo -u admin ls -la /home/admin/.setup | grep -c .setup)
|
setupStepExists=$(sudo -u admin ls -la /home/admin/.setup | grep -c .setup)
|
||||||
if [ ${setupStepExists} -eq 1 ]; then
|
if [ ${setupStepExists} -eq 1 ]; then
|
||||||
@@ -28,19 +31,19 @@ if [ "$USER" = "pi" ]; then
|
|||||||
|
|
||||||
if [ ${setupStep} -eq 0 ]; then
|
if [ ${setupStep} -eq 0 ]; then
|
||||||
|
|
||||||
# setup process has not started yet
|
# setup process has not started yet
|
||||||
l1="Login to your RaspiBlitz with:\n"
|
l1="Login to your RaspiBlitz with:\n"
|
||||||
l2="ssh admin@${localip}\n"
|
l2="ssh admin@${localip}\n"
|
||||||
l3="Use password: raspiblitz\n"
|
l3="Use password: raspiblitz\n"
|
||||||
boxwidth=$((${#localip} + 20))
|
boxwidth=$((${#localip} + 20))
|
||||||
dialog --backtitle "RaspiBlitz - Welcome" --infobox "$l1$l2$l3" 5 ${boxwidth}
|
dialog --backtitle "RaspiBlitz - Welcome" --infobox "$l1$l2$l3" 5 ${boxwidth}
|
||||||
sleep 5
|
sleep 5
|
||||||
|
|
||||||
elif [ ${setupStep} -lt 100 ]; then
|
elif [ ${setupStep} -lt 100 ]; then
|
||||||
|
|
||||||
# setup process init is done and not finished
|
# setup process init is done and not finished
|
||||||
lndSyncing=$(sudo -u bitcoin lncli getinfo | jq -r '.synced_to_chain' | grep -c false)
|
lndSyncing=$(sudo -u bitcoin lncli getinfo | jq -r '.synced_to_chain' | grep -c false)
|
||||||
chain=$(sudo -u bitcoin ${network}-cli getblockchaininfo | jq -r '.chain')
|
chain=$(sudo -u bitcoin ${network}-cli -datadir=/home/bitcoin/.${network} getblockchaininfo | jq -r '.chain')
|
||||||
locked=$(sudo tail -n 1 /mnt/hdd/lnd/logs/${network}/${chain}net/lnd.log | grep -c unlock)
|
locked=$(sudo tail -n 1 /mnt/hdd/lnd/logs/${network}/${chain}net/lnd.log | grep -c unlock)
|
||||||
|
|
||||||
if [ ${locked} -gt 0 ]; then
|
if [ ${locked} -gt 0 ]; then
|
||||||
@@ -49,7 +52,7 @@ if [ "$USER" = "pi" ]; then
|
|||||||
l1="!!! LND WALLET IS LOCKED !!!\n"
|
l1="!!! LND WALLET IS LOCKED !!!\n"
|
||||||
l2="Login: ssh admin@${localip}\n"
|
l2="Login: ssh admin@${localip}\n"
|
||||||
l3="Use your Password A\n"
|
l3="Use your Password A\n"
|
||||||
boxwidth=$((${#localip} + 20))
|
boxwidth=$((${#localip} + 20))
|
||||||
dialog --backtitle "RaspiBlitz - Action Required" --infobox "$l1$l2$l3" 5 ${boxwidth}
|
dialog --backtitle "RaspiBlitz - Action Required" --infobox "$l1$l2$l3" 5 ${boxwidth}
|
||||||
sleep 5
|
sleep 5
|
||||||
|
|
||||||
@@ -57,7 +60,7 @@ if [ "$USER" = "pi" ]; then
|
|||||||
|
|
||||||
# special case: LND is syncing
|
# special case: LND is syncing
|
||||||
/home/admin/80scanLND.sh
|
/home/admin/80scanLND.sh
|
||||||
sleep 5
|
sleep 5
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
@@ -67,32 +70,33 @@ if [ "$USER" = "pi" ]; then
|
|||||||
l3="Use your Password A\n"
|
l3="Use your Password A\n"
|
||||||
boxwidth=$((${#localip} + 20))
|
boxwidth=$((${#localip} + 20))
|
||||||
dialog --backtitle "RaspiBlitz - Welcome" --infobox "$l1$l2$l3" 5 ${boxwidth}
|
dialog --backtitle "RaspiBlitz - Welcome" --infobox "$l1$l2$l3" 5 ${boxwidth}
|
||||||
sleep 10
|
sleep 10
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
# RaspiBlitz is full Setup
|
# RaspiBlitz is full Setup
|
||||||
|
|
||||||
chain=$(su -u bitcoin ${network}-cli getblockchaininfo | jq -r '.chain')
|
chain=$(sudo -u bitcoin ${network}-cli -datadir=/home/bitcoin/.${network} getblockchaininfo | jq -r '.chain')
|
||||||
locked=$(sudo tail -n 1 /mnt/hdd/lnd/logs/${network}/${chain}net/lnd.log | grep -c unlock)
|
locked=$(sudo tail -n 1 /mnt/hdd/lnd/logs/${network}/${chain}net/lnd.log | grep -c unlock)
|
||||||
if [ ${locked} -gt 0 ]; then
|
if [ ${locked} -gt 0 ]; then
|
||||||
# special case: LND wallet is locked ---> show unlock info
|
|
||||||
|
# special case: LND wallet is locked ---> show unlock info
|
||||||
l1="!!! LND WALLET IS LOCKED !!!\n"
|
l1="!!! LND WALLET IS LOCKED !!!\n"
|
||||||
l2="Login: ssh admin@${localip}\n"
|
l2="Login: ssh admin@${localip}\n"
|
||||||
l3="Use your Password A\n"
|
l3="Use your Password A\n"
|
||||||
boxwidth=$((${#localip} + 20))
|
boxwidth=$((${#localip} + 22))
|
||||||
dialog --backtitle "RaspiBlitz - Welcome" --infobox "$l1$l2$l3" 5 ${boxwidth}
|
dialog --backtitle "RaspiBlitz - Welcome" --infobox "$l1$l2$l3" 5 ${boxwidth}
|
||||||
sleep 5
|
sleep 5
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
else
|
# no special case - show status display
|
||||||
|
/home/admin/00infoBlitz.sh
|
||||||
# no special case - show status display
|
sleep 5
|
||||||
/home/admin/00infoBlitz.sh
|
|
||||||
sleep 5
|
fi
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
@@ -56,17 +56,18 @@ if [ ${mountOK} -eq 1 ]; then
|
|||||||
echo "Bitcoin Options"
|
echo "Bitcoin Options"
|
||||||
menuitem=$(dialog --clear --beep --backtitle "RaspiBlitz" --title "Getting the Blockchain" \
|
menuitem=$(dialog --clear --beep --backtitle "RaspiBlitz" --title "Getting the Blockchain" \
|
||||||
--menu "You need a copy of the Bitcoin Blockchain - you have 3 options:" 13 75 4 \
|
--menu "You need a copy of the Bitcoin Blockchain - you have 3 options:" 13 75 4 \
|
||||||
T "TORRENT --> TESTNET + MAINNET per FTP (DEFAULT)" \
|
T "TORRENT --> TESTNET + MAINNET thru Torrent (DEFAULT)" \
|
||||||
|
D "DOWNLOAD --> TESTNET + MAINNET per FTP (FALLBACK)" \
|
||||||
C "COPY --> TESTNET + MAINNET from another HDD (TRICKY+FAST)" \
|
C "COPY --> TESTNET + MAINNET from another HDD (TRICKY+FAST)" \
|
||||||
D "DOWNLOAD --> TESTNET + MAINNET per FTP (FALLBACK+SLOW)" \
|
S "SYNC --> JUST TESTNET thru Bitoin Network (FALLBACK+SLOW)" 2>&1 >/dev/tty)
|
||||||
S "SYNC --> JUST TESTNET thru Bitoin Network (FALLBACK)" 2>&1 >/dev/tty)
|
|
||||||
|
|
||||||
# Litecoin
|
# Litecoin
|
||||||
elif [ ${network} = "litecoin" ]; then
|
elif [ ${network} = "litecoin" ]; then
|
||||||
echo "Litecoin Options"
|
echo "Litecoin Options"
|
||||||
menuitem=$(dialog --clear --beep --backtitle "RaspiBlitz" --title "Getting the Blockchain" \
|
menuitem=$(dialog --clear --beep --backtitle "RaspiBlitz" --title "Getting the Blockchain" \
|
||||||
--menu "You need a copy of the Litecoin Blockchain - you have 3 options:" 13 75 4 \
|
--menu "You need a copy of the Litecoin Blockchain - you have 3 options:" 13 75 4 \
|
||||||
D "DOWNLOAD --> MAINNET thru torrent (RECOMMENDED)" \
|
T "TORRENT --> MAINNET thru Torrent (DEFAULT)" \
|
||||||
|
D "DOWNLOAD --> MAINNET per FTP (FALLBACK)" \
|
||||||
C "COPY --> MAINNET from another HDD (TRICKY+FAST)" \
|
C "COPY --> MAINNET from another HDD (TRICKY+FAST)" \
|
||||||
S "SYNC --> MAINNET thru Litecoin Network (FALLBACK+SLOW)" 2>&1 >/dev/tty)
|
S "SYNC --> MAINNET thru Litecoin Network (FALLBACK+SLOW)" 2>&1 >/dev/tty)
|
||||||
|
|
||||||
|
@@ -9,7 +9,7 @@ bitcoinSize=100
|
|||||||
# *** LITECOIN ***
|
# *** LITECOIN ***
|
||||||
litecoinList="" # url to list with other sources
|
litecoinList="" # url to list with other sources
|
||||||
litecoinUrl="ftp://anonymous:anonymous@ftp.rotzoll.de/pub/raspiblitz-litecoin-2018-07-29"
|
litecoinUrl="ftp://anonymous:anonymous@ftp.rotzoll.de/pub/raspiblitz-litecoin-2018-07-29"
|
||||||
litecoinSize=19184980
|
litecoinSize=19000000
|
||||||
|
|
||||||
# load network
|
# load network
|
||||||
network=`cat .network`
|
network=`cat .network`
|
||||||
|
@@ -1,12 +1,12 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# *** BITCOIN Torrent ***
|
# *** BITCOIN Torrent ***
|
||||||
bitcoinTorrent="raspiblitz-hdd-2018-07-16"
|
bitcoinTorrent="raspiblitz-bitcoin-2018-07-16"
|
||||||
bitcoinTorrentsize=231230512
|
bitcoinTorrentsize=231230512
|
||||||
|
|
||||||
# *** LITECOIN Torrent ***
|
# *** LITECOIN Torrent ***
|
||||||
litecoinTorrent="raspiblitz-litecoin-2018-07-28"
|
litecoinTorrent="raspiblitz-litecoin-2018-07-29"
|
||||||
litecoinTorrentsize=100
|
litecoinTorrentsize=10240000
|
||||||
|
|
||||||
# load network
|
# load network
|
||||||
network=`cat .network`
|
network=`cat .network`
|
||||||
@@ -17,15 +17,21 @@ torrentsize=$bitcoinTorrentsize
|
|||||||
if [ "$network" = "litecoin" ]; then
|
if [ "$network" = "litecoin" ]; then
|
||||||
torrent=$litecoinTorrent
|
torrent=$litecoinTorrent
|
||||||
torrentsize=$litecoinTorrentsize
|
torrentsize=$litecoinTorrentsize
|
||||||
if
|
fi
|
||||||
|
echo ""
|
||||||
echo "*** Downloading TORRENT ***"
|
|
||||||
echo "torrentFile: ${torrent}"
|
echo "torrentFile: ${torrent}"
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "*** Downloading TORRENT ***"
|
||||||
|
echo "IN CASE DOWNLOAD DOES NOT START OR TOO SLOW:"
|
||||||
|
echo "CTRL+z start ./10setupBlitz.sh choose other option"
|
||||||
|
echo "***************************"
|
||||||
|
echo ""
|
||||||
tmpfile=$(mktemp)
|
tmpfile=$(mktemp)
|
||||||
chmod a+x $tmpfile
|
chmod a+x $tmpfile
|
||||||
echo "killall transmission-cli" > $tmpfile
|
echo "killall transmission-cli" > $tmpfile
|
||||||
sudo transmission-cli ./assets/$torrent.torrent -D -et -w /mnt/hdd -f $tmpfile
|
sudo transmission-cli ./assets/$torrent.torrent -D -et -w /mnt/hdd -f $tmpfile
|
||||||
echo "OK - Download is complete"
|
echo "OK - Download closed"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
echo "*** Checking TORRENT ***"
|
echo "*** Checking TORRENT ***"
|
||||||
@@ -37,7 +43,7 @@ if [ ${#downloadsize} -eq 0 ]; then
|
|||||||
fi
|
fi
|
||||||
# add some tolerance for checking
|
# add some tolerance for checking
|
||||||
size="$(($size-1024000))"
|
size="$(($size-1024000))"
|
||||||
echo "download size is(${downloadsize}) needs to be minimum(${size}})"
|
echo "download size is(${downloadsize}) needs to be minimum(${size})"
|
||||||
if [ ${downloadsize} -lt ${size} ]; then
|
if [ ${downloadsize} -lt ${size} ]; then
|
||||||
sleep 3
|
sleep 3
|
||||||
echo -ne '\007'
|
echo -ne '\007'
|
||||||
|
@@ -3,14 +3,14 @@ network=`sudo cat /home/admin/.network`
|
|||||||
|
|
||||||
# parse the actual scanned height progress from LND logs
|
# parse the actual scanned height progress from LND logs
|
||||||
item=0
|
item=0
|
||||||
chain="$(sudo -u bitcoin ${network}-cli getblockchaininfo | jq -r '.chain')"
|
chain="$(sudo -u bitcoin ${network}-cli -datadir=/home/bitcoin/.${network} getblockchaininfo | jq -r '.chain')"
|
||||||
gotData=$(sudo tail -n 100 /mnt/hdd/lnd/logs/${network}/${chain}net/lnd.log | grep -c height)
|
gotData=$(sudo -u bitcoin tail -n 100 /mnt/hdd/lnd/logs/${network}/${chain}net/lnd.log | grep -c height)
|
||||||
if [ ${gotData} -gt 0 ]; then
|
if [ ${gotData} -gt 0 ]; then
|
||||||
item=$(sudo tail -n 100 /mnt/hdd/lnd/logs/${network}/${chain}net/lnd.log | grep height | tail -n1 | awk '{print $9} {print $10} {print $11} {print $12}' | tr -dc '0-9')
|
item=$(sudo -u bitcoin tail -n 100 /mnt/hdd/lnd/logs/${network}/${chain}net/lnd.log | grep height | tail -n1 | awk '{print $9} {print $10} {print $11} {print $12}' | tr -dc '0-9')
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# get total number of blocks
|
# get total number of blocks
|
||||||
total=$(sudo -u bitcoin ${network}-cli getblockchaininfo | jq -r '.blocks')
|
total=$(sudo -u bitcoin ${network}-cli -datadir=/home/bitcoin/.${network} getblockchaininfo | jq -r '.blocks')
|
||||||
|
|
||||||
# calculate progress in percent
|
# calculate progress in percent
|
||||||
percent=$(awk "BEGIN { pc=100*${item}/${total}; i=int(pc); print (pc-i<0.5)?i:i+1 }")
|
percent=$(awk "BEGIN { pc=100*${item}/${total}; i=int(pc); print (pc-i<0.5)?i:i+1 }")
|
||||||
@@ -20,4 +20,4 @@ if [ ${percent} -e 100 ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# display progress to user
|
# display progress to user
|
||||||
dialog --backtitle "RaspiBlitz" --infobox " Lightning Rescanning Blockchain $percent%\nplease wait - this can take some time" 4 42
|
dialog --backtitle "RaspiBlitz (${network} / ${chain})" --infobox " Lightning Rescanning Blockchain ${percent}%\nplease wait - this can take some time" 4 42
|
@@ -1,5 +1,6 @@
|
|||||||
# https://github.com/Stadicus/guides/blob/master/raspibolt/raspibolt_67_additional-scripts.md
|
# https://github.com/Stadicus/guides/blob/master/raspibolt/raspibolt_67_additional-scripts.md
|
||||||
|
|
||||||
|
echo ""
|
||||||
echo "*** Adding: raspibolt_67_additional-scripts.md"
|
echo "*** Adding: raspibolt_67_additional-scripts.md"
|
||||||
echo "Creating the command lnbalance as well as lnchannels which will give you a nicer output"
|
echo "Creating the command lnbalance as well as lnchannels which will give you a nicer output"
|
||||||
cd
|
cd
|
||||||
@@ -11,10 +12,6 @@ chmod +x lnbalance
|
|||||||
chmod +x lnchannels
|
chmod +x lnchannels
|
||||||
sudo cp lnchannels /usr/local/bin
|
sudo cp lnchannels /usr/local/bin
|
||||||
sudo cp lnbalance /usr/local/bin
|
sudo cp lnbalance /usr/local/bin
|
||||||
echo "Done. Let's try them out"
|
echo "OK"
|
||||||
cd
|
cd
|
||||||
rm -r /home/admin/tmpScriptDL
|
rm -r /home/admin/tmpScriptDL
|
||||||
echo "Output of lnbalance:"
|
|
||||||
lnbalance
|
|
||||||
echo "Output of lnchannels:"
|
|
||||||
lnchannels
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# load network
|
# load network
|
||||||
network=`.network`
|
network=`cat .network`
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "****************************************************************************"
|
echo "****************************************************************************"
|
||||||
|
File diff suppressed because one or more lines are too long
801
home.admin/assets/raspiblitz-litecoin-2018-07-29.torrent
Normal file
801
home.admin/assets/raspiblitz-litecoin-2018-07-29.torrent
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user