Skip to content

Commit a327b41

Browse files
committed
Update LND to v0.7.0-beta
1 parent 6b68cb5 commit a327b41

File tree

2 files changed

+114
-0
lines changed

2 files changed

+114
-0
lines changed

lnd.updates/README.md

+5
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ Choose a commit ID from this list: https://github.com/lightningnetwork/lnd/commi
1010

1111
### [Check for the latest official release and notes](https://github.com/lightningnetwork/lnd/releases/)
1212

13+
#### [Update LND to v0.7.0-beta](lnd.update.v0.7.0-beta.sh)
14+
15+
* Download and run this script on the RaspiBlitz:
16+
`$ wget https://raw.githubusercontent.com/openoms/bitcoin-tutorials/master/lnd.updates/lnd.update.v0.7.0-beta.sh && sudo bash lnd.update.v0.7.0-beta.sh`
17+
1318
#### [Update LND to v0.7.0-beta-rc3](lnd.update.v0.7.0-beta-rc3.sh)
1419

1520
* Download and run this script on the RaspiBlitz:

lnd.updates/lnd.update.v0.7.0-beta.sh

+109
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
# LND Update Script
2+
3+
# Download and run this script on the RaspiBlitz:
4+
# $ wget https://raw.githubusercontent.com/openoms/bitcoin-tutorials/master/lnd.updates/lnd.update.v0.7.0-beta.sh && sudo bash lnd.update.v0.7.0-beta.sh
5+
6+
## based on https://github.com/Stadicus/guides/blob/master/raspibolt/raspibolt_40_lnd.md#lightning-lnd
7+
## see LND releases: https://github.com/lightningnetwork/lnd/releases
8+
9+
lndVersion="0.7.0-beta" # the version you would like to be updated
10+
downloadDir="/home/admin/download" # edit your download directory
11+
12+
echo "Detect CPU architecture ..."
13+
isARM=$(uname -m | grep -c 'arm')
14+
isAARCH64=$(uname -m | grep -c 'aarch64')
15+
isX86_64=$(uname -m | grep -c 'x86_64')
16+
isX86_32=$(uname -m | grep -c 'i386\|i486\|i586\|i686\|i786')
17+
if [ ${isARM} -eq 0 ] && [ ${isAARCH64} -eq 0 ] && [ ${isX86_64} -eq 0 ] && [ ${isX86_32} -eq 0 ] ; then
18+
echo "!!! FAIL !!!"
19+
echo "Can only build on ARM, aarch64, x86_64 or i386 not on:"
20+
uname -m
21+
exit 1
22+
else
23+
echo "OK running on $(uname -m) architecture."
24+
fi
25+
26+
# update the SHA256 checksum upon version change
27+
if [ ${isARM} -eq 1 ] ; then
28+
lndOSversion="armv7"
29+
lndSHA256="ac51d96ee9b57bfcab0b05dbcfcd9ce3bd42a216354c0972e97c1a1c86c2479a"
30+
fi
31+
if [ ${isAARCH64} -eq 1 ] ; then
32+
lndOSversion="arm64"
33+
lndSHA256="c995fa67d6b23e547723801de49817dda34188fba78d0fe8ae506774e54c0afd"
34+
fi
35+
if [ ${isX86_64} -eq 1 ] ; then
36+
lndOSversion="amd64"
37+
lndSHA256="c818c3a983167312f3bf2c84cb285212c5052131319caaef287a97541d2ff479"
38+
fi
39+
if [ ${isX86_32} -eq 1 ] ; then
40+
lndOSversion="386"
41+
lndSHA256="47be6c3391fadbc5a169fa1dd6dd13031d759b3d42c71a2d556751746b705c48"
42+
fi
43+
echo ""
44+
echo "*** LND v${lndVersion} for ${lndOSversion} ***"
45+
46+
# olaoluwa
47+
PGPpkeys="https://keybase.io/roasbeef/pgp_keys.asc"
48+
PGPcheck="F8037E70C12C7A263C032508CE58F7F8E20FD9A2"
49+
# PGPcheck="BD599672C804AF2770869A048B80CD2BB8BD8132"
50+
51+
# bitconner
52+
# PGPpkeys="https://keybase.io/bitconner/pgp_keys.asc"
53+
# PGPcheck="9C8D61868A7C492003B2744EE7D737B67FA592C7"
54+
55+
# get LND resources
56+
cd "${downloadDir}"
57+
binaryName="lnd-linux-${lndOSversion}-v${lndVersion}.tar.gz"
58+
sudo -u admin wget -N https://github.com/lightningnetwork/lnd/releases/download/v${lndVersion}/${binaryName}
59+
sudo -u admin wget -N https://github.com/lightningnetwork/lnd/releases/download/v${lndVersion}/manifest-v${lndVersion}.txt
60+
sudo -u admin wget -N https://github.com/lightningnetwork/lnd/releases/download/v${lndVersion}/manifest-v${lndVersion}.txt.sig
61+
sudo -u admin wget -N -O "${downloadDir}/pgp_keys.asc" ${PGPpkeys}
62+
63+
# check binary is was not manipulated (checksum test)
64+
binaryChecksum=$(sha256sum ${binaryName} | cut -d " " -f1)
65+
if [ "${binaryChecksum}" != "${lndSHA256}" ]; then
66+
echo "!!! FAIL !!! Downloaded LND BINARY not matching SHA256 checksum: ${lndSHA256}"
67+
exit 1
68+
fi
69+
70+
# check gpg finger print
71+
gpg ./pgp_keys.asc
72+
fingerprint=$(sudo gpg "${downloadDir}/pgp_keys.asc" 2>/dev/null | grep "${PGPcheck}" -c)
73+
if [ ${fingerprint} -lt 1 ]; then
74+
echo ""
75+
echo "!!! BUILD WARNING --> LND PGP author not as expected"
76+
echo "Should contain PGP: ${PGPcheck}"
77+
echo "PRESS ENTER to TAKE THE RISK if you think all is OK"
78+
read key
79+
fi
80+
gpg --import ./pgp_keys.asc
81+
sleep 3
82+
verifyResult=$(gpg --verify manifest-v${lndVersion}.txt.sig 2>&1)
83+
goodSignature=$(echo ${verifyResult} | grep 'Good signature' -c)
84+
echo "goodSignature(${goodSignature})"
85+
correctKey=$(echo ${verifyResult} | tr -d " \t\n\r" | grep "${olaoluwaPGP}" -c)
86+
echo "correctKey(${correctKey})"
87+
if [ ${correctKey} -lt 1 ] || [ ${goodSignature} -lt 1 ]; then
88+
echo ""
89+
echo "!!! BUILD FAILED --> LND PGP Verify not OK / signatute(${goodSignature}) verify(${correctKey})"
90+
exit 1
91+
fi
92+
93+
sudo systemctl stop lnd
94+
95+
# install
96+
sudo -u admin tar -xzf ${binaryName}
97+
sudo install -m 0755 -o root -g root -t /usr/local/bin lnd-linux-${lndOSversion}-v${lndVersion}/*
98+
sleep 3
99+
installed=$(sudo -u admin lnd --version)
100+
if [ ${#installed} -eq 0 ]; then
101+
echo ""
102+
echo "!!! BUILD FAILED --> Was not able to install LND"
103+
exit 1
104+
fi
105+
106+
sudo systemctl restart lnd
107+
108+
echo ""
109+
echo "Installed ${installed}"

0 commit comments

Comments
 (0)