Browse Source

updated torrent and litecoin fixes

#146
rootzoll 6 years ago
parent
commit
189021ec93
  1. 5
      home.admin/00infoBlitz.sh
  2. 44
      home.admin/00infoLCD.sh
  3. 9
      home.admin/10setupBlitz.sh
  4. 2
      home.admin/50downloadHDD.sh
  5. 22
      home.admin/50torrentHDD.sh
  6. 10
      home.admin/80scanLND.sh
  7. 7
      home.admin/91addBonus.sh
  8. 2
      home.admin/AAunlockLND.sh
  9. 4
      home.admin/assets/raspiblitz-bitcoin-2018-07-16.torrent
  10. 801
      home.admin/assets/raspiblitz-litecoin-2018-07-29.torrent

5
home.admin/00infoBlitz.sh

@ -151,14 +151,15 @@ else
external_color="${color_red}"
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 "
${color_yellow}
${color_yellow}
${color_yellow}
${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}
${color_yellow} ,'/ ${color_gray}%s, CPU %s°C

44
home.admin/00infoLCD.sh

@ -18,6 +18,9 @@ if [ "$USER" = "pi" ]; then
while :
do
# refresh network
network=`sudo cat /home/admin/.network`
# get the setup state
setupStepExists=$(sudo -u admin ls -la /home/admin/.setup | grep -c .setup)
if [ ${setupStepExists} -eq 1 ]; then
@ -28,19 +31,19 @@ if [ "$USER" = "pi" ]; 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"
l2="ssh admin@${localip}\n"
l3="Use password: raspiblitz\n"
boxwidth=$((${#localip} + 20))
boxwidth=$((${#localip} + 20))
dialog --backtitle "RaspiBlitz - Welcome" --infobox "$l1$l2$l3" 5 ${boxwidth}
sleep 5
elif [ ${setupStep} -lt 100 ]; then
# setup process init is done and not finished
lndSyncing=$(sudo -u bitcoin lncli getinfo | jq -r '.synced_to_chain' | grep -c false)
chain=$(sudo -u bitcoin ${network}-cli getblockchaininfo | jq -r '.chain')
# setup process init is done and not finished
lndSyncing=$(sudo -u bitcoin lncli getinfo | jq -r '.synced_to_chain' | grep -c false)
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)
if [ ${locked} -gt 0 ]; then
@ -49,7 +52,7 @@ if [ "$USER" = "pi" ]; then
l1="!!! LND WALLET IS LOCKED !!!\n"
l2="Login: ssh admin@${localip}\n"
l3="Use your Password A\n"
boxwidth=$((${#localip} + 20))
boxwidth=$((${#localip} + 20))
dialog --backtitle "RaspiBlitz - Action Required" --infobox "$l1$l2$l3" 5 ${boxwidth}
sleep 5
@ -57,7 +60,7 @@ if [ "$USER" = "pi" ]; then
# special case: LND is syncing
/home/admin/80scanLND.sh
sleep 5
sleep 5
else
@ -67,32 +70,33 @@ if [ "$USER" = "pi" ]; then
l3="Use your Password A\n"
boxwidth=$((${#localip} + 20))
dialog --backtitle "RaspiBlitz - Welcome" --infobox "$l1$l2$l3" 5 ${boxwidth}
sleep 10
sleep 10
fi
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)
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"
l2="Login: ssh admin@${localip}\n"
l3="Use your Password A\n"
boxwidth=$((${#localip} + 20))
boxwidth=$((${#localip} + 22))
dialog --backtitle "RaspiBlitz - Welcome" --infobox "$l1$l2$l3" 5 ${boxwidth}
sleep 5
else
# no special case - show status display
/home/admin/00infoBlitz.sh
sleep 5
sleep 5
else
fi
# no special case - show status display
/home/admin/00infoBlitz.sh
sleep 5
fi
fi
done

9
home.admin/10setupBlitz.sh

@ -56,17 +56,18 @@ if [ ${mountOK} -eq 1 ]; then
echo "Bitcoin Options"
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 \
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)" \
D "DOWNLOAD --> TESTNET + MAINNET per FTP (FALLBACK+SLOW)" \
S "SYNC --> JUST TESTNET thru Bitoin Network (FALLBACK)" 2>&1 >/dev/tty)
S "SYNC --> JUST TESTNET thru Bitoin Network (FALLBACK+SLOW)" 2>&1 >/dev/tty)
# Litecoin
elif [ ${network} = "litecoin" ]; then
echo "Litecoin Options"
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 \
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)" \
S "SYNC --> MAINNET thru Litecoin Network (FALLBACK+SLOW)" 2>&1 >/dev/tty)

2
home.admin/50downloadHDD.sh

@ -9,7 +9,7 @@ bitcoinSize=100
# *** LITECOIN ***
litecoinList="" # url to list with other sources
litecoinUrl="ftp://anonymous:anonymous@ftp.rotzoll.de/pub/raspiblitz-litecoin-2018-07-29"
litecoinSize=19184980
litecoinSize=19000000
# load network
network=`cat .network`

22
home.admin/50torrentHDD.sh

@ -1,12 +1,12 @@
#!/bin/sh
# *** BITCOIN Torrent ***
bitcoinTorrent="raspiblitz-hdd-2018-07-16"
bitcoinTorrent="raspiblitz-bitcoin-2018-07-16"
bitcoinTorrentsize=231230512
# *** LITECOIN Torrent ***
litecoinTorrent="raspiblitz-litecoin-2018-07-28"
litecoinTorrentsize=100
litecoinTorrent="raspiblitz-litecoin-2018-07-29"
litecoinTorrentsize=10240000
# load network
network=`cat .network`
@ -17,15 +17,21 @@ torrentsize=$bitcoinTorrentsize
if [ "$network" = "litecoin" ]; then
torrent=$litecoinTorrent
torrentsize=$litecoinTorrentsize
if
fi
echo ""
echo "torrentFile: ${torrent}"
echo ""
echo "*** Downloading TORRENT ***"
echo "torrentFile: ${torrent}"
echo "IN CASE DOWNLOAD DOES NOT START OR TOO SLOW:"
echo "CTRL+z start ./10setupBlitz.sh choose other option"
echo "***************************"
echo ""
tmpfile=$(mktemp)
chmod a+x $tmpfile
echo "killall transmission-cli" > $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 "*** Checking TORRENT ***"
@ -37,7 +43,7 @@ if [ ${#downloadsize} -eq 0 ]; then
fi
# add some tolerance for checking
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
sleep 3
echo -ne '\007'

10
home.admin/80scanLND.sh

@ -3,14 +3,14 @@ network=`sudo cat /home/admin/.network`
# parse the actual scanned height progress from LND logs
item=0
chain="$(sudo -u bitcoin ${network}-cli getblockchaininfo | jq -r '.chain')"
gotData=$(sudo tail -n 100 /mnt/hdd/lnd/logs/${network}/${chain}net/lnd.log | grep -c height)
chain="$(sudo -u bitcoin ${network}-cli -datadir=/home/bitcoin/.${network} getblockchaininfo | jq -r '.chain')"
gotData=$(sudo -u bitcoin tail -n 100 /mnt/hdd/lnd/logs/${network}/${chain}net/lnd.log | grep -c height)
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
# 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
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
# 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

7
home.admin/91addBonus.sh

@ -1,5 +1,6 @@
# https://github.com/Stadicus/guides/blob/master/raspibolt/raspibolt_67_additional-scripts.md
echo ""
echo "*** Adding: raspibolt_67_additional-scripts.md"
echo "Creating the command lnbalance as well as lnchannels which will give you a nicer output"
cd
@ -11,10 +12,6 @@ chmod +x lnbalance
chmod +x lnchannels
sudo cp lnchannels /usr/local/bin
sudo cp lnbalance /usr/local/bin
echo "Done. Let's try them out"
echo "OK"
cd
rm -r /home/admin/tmpScriptDL
echo "Output of lnbalance:"
lnbalance
echo "Output of lnchannels:"
lnchannels

2
home.admin/AAunlockLND.sh

@ -1,7 +1,7 @@
#!/bin/sh
# load network
network=`.network`
network=`cat .network`
echo ""
echo "****************************************************************************"

4
home.admin/assets/raspiblitz-hdd-2018-07-16.torrent → home.admin/assets/raspiblitz-bitcoin-2018-07-16.torrent

File diff suppressed because one or more lines are too long

801
home.admin/assets/raspiblitz-litecoin-2018-07-29.torrent

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save