Skip to content

Commit 6b68cb5

Browse files
committed
update to v0.7.0-beta-rc3
1 parent 92c9476 commit 6b68cb5

File tree

2 files changed

+134
-7
lines changed

2 files changed

+134
-7
lines changed

lnd.updates/README.md

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,32 @@
1-
#### [RaspiBlitz: update LND to v0.7.0-beta-rc2](lnd.update.v0.7.0-beta-rc2.sh)
2-
Download and run the script to update:
1+
## Automated LND update scripts for the RaspiBlitz and compatible systems
32

4-
`$ wget https://raw.githubusercontent.com/openoms/bitcoin-tutorials/master/lnd.updates/lnd.update.v0.7.0-beta-rc2.sh && sudo bash lnd.update.v0.7.0-beta-rc2.sh`
5-
6-
#### [RaspiBlitz: build LND from source](lnd.from.source.sh)
7-
Download and run this script on the RaspiBlitz:
3+
#### [Build LND from source](lnd.from.source.sh)
4+
* Download and run this script on the RaspiBlitz:
85
`$ wget https://raw.githubusercontent.com/openoms/bitcoin-tutorials/master/lnd.updates/lnd.from.source.sh && sudo bash lnd.from.source.sh`
96

10-
Will ask for the commit to checkout from.
7+
* Will ask for the commit to checkout from.
118
Choose a commit ID from this list: https://github.com/lightningnetwork/lnd/commits/master
129

10+
11+
### [Check for the latest official release and notes](https://github.com/lightningnetwork/lnd/releases/)
12+
13+
#### [Update LND to v0.7.0-beta-rc3](lnd.update.v0.7.0-beta-rc3.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-rc3.sh && sudo bash lnd.update.v0.7.0-beta-rc3.sh`
17+
18+
19+
#### [Update LND to v0.7.0-beta-rc2](lnd.update.v0.7.0-beta-rc2.sh)
20+
* Download and run the script to update:
21+
`$ wget https://raw.githubusercontent.com/openoms/bitcoin-tutorials/master/lnd.updates/lnd.update.v0.7.0-beta-rc2.sh && sudo bash lnd.update.v0.7.0-beta-rc2.sh`
22+
23+
#### [Update LND to v0.7.0-beta-rc1](lnd.update.v0.7.0-beta-rc1.sh)
24+
* Download and run the script to update:
25+
`$ wget https://raw.githubusercontent.com/openoms/bitcoin-tutorials/master/lnd.updates/lnd.update.v0.7.0-beta-rc1.sh && sudo bash lnd.update.v0.7.0-beta-rc1.sh`
26+
27+
#### [Update LND to v0.6.1-beta](lnd.update.v0.6.1-beta.sh)
28+
* Download and run the script to update:
29+
`$ wget https://raw.githubusercontent.com/openoms/bitcoin-tutorials/master/lnd.updates/lnd.update.v0.6.1-beta.sh && sudo bash lnd.update.v0.6.1-beta.sh`
30+
31+
32+
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
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-rc3.sh && sudo bash lnd.update.v0.7.0-beta-rc3.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-rc3" # 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="92d2cf564714057ebf63f952454e4255e3e16e590178d096f75efc40931ace9a"
30+
fi
31+
if [ ${isAARCH64} -eq 1 ] ; then
32+
lndOSversion="arm64"
33+
lndSHA256="a0f40ec55ac9a9898657ede6084b32ae150d2d0483975eb1a6aab3c5fa691f2d"
34+
fi
35+
if [ ${isX86_64} -eq 1 ] ; then
36+
lndOSversion="amd64"
37+
lndSHA256="d90bf078edc57f12cfebfae96aaa6d686a8036a3cb1b8684855f773edd9f2ec7"
38+
fi
39+
if [ ${isX86_32} -eq 1 ] ; then
40+
lndOSversion="386"
41+
lndSHA256="2723ce9dff50a2b063ba01b2b2cf4159db5aed5ade76a20978dfac361152fa06"
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="BD599672C804AF2770869A048B80CD2BB8BD8132"
49+
# bitconner
50+
PGPpkeys="https://keybase.io/bitconner/pgp_keys.asc"
51+
PGPcheck="9C8D61868A7C492003B2744EE7D737B67FA592C7"
52+
53+
# get LND resources
54+
cd "${downloadDir}"
55+
binaryName="lnd-linux-${lndOSversion}-v${lndVersion}.tar.gz"
56+
sudo -u admin wget -N https://github.com/lightningnetwork/lnd/releases/download/v${lndVersion}/${binaryName}
57+
sudo -u admin wget -N https://github.com/lightningnetwork/lnd/releases/download/v${lndVersion}/manifest-v${lndVersion}.txt
58+
sudo -u admin wget -N https://github.com/lightningnetwork/lnd/releases/download/v${lndVersion}/manifest-v${lndVersion}.txt.sig
59+
sudo -u admin wget -N -O "${downloadDir}/pgp_keys.asc" ${PGPpkeys}
60+
61+
# check binary is was not manipulated (checksum test)
62+
binaryChecksum=$(sha256sum ${binaryName} | cut -d " " -f1)
63+
if [ "${binaryChecksum}" != "${lndSHA256}" ]; then
64+
echo "!!! FAIL !!! Downloaded LND BINARY not matching SHA256 checksum: ${lndSHA256}"
65+
exit 1
66+
fi
67+
68+
# check gpg finger print
69+
gpg ./pgp_keys.asc
70+
fingerprint=$(sudo gpg "${downloadDir}/pgp_keys.asc" 2>/dev/null | grep "${PGPcheck}" -c)
71+
if [ ${fingerprint} -lt 1 ]; then
72+
echo ""
73+
echo "!!! BUILD WARNING --> LND PGP author not as expected"
74+
echo "Should contain PGP: ${PGPcheck}"
75+
echo "PRESS ENTER to TAKE THE RISK if you think all is OK"
76+
read key
77+
fi
78+
gpg --import ./pgp_keys.asc
79+
sleep 3
80+
verifyResult=$(gpg --verify manifest-v${lndVersion}.txt.sig 2>&1)
81+
goodSignature=$(echo ${verifyResult} | grep 'Good signature' -c)
82+
echo "goodSignature(${goodSignature})"
83+
correctKey=$(echo ${verifyResult} | tr -d " \t\n\r" | grep "${olaoluwaPGP}" -c)
84+
echo "correctKey(${correctKey})"
85+
if [ ${correctKey} -lt 1 ] || [ ${goodSignature} -lt 1 ]; then
86+
echo ""
87+
echo "!!! BUILD FAILED --> LND PGP Verify not OK / signatute(${goodSignature}) verify(${correctKey})"
88+
exit 1
89+
fi
90+
91+
sudo systemctl stop lnd
92+
93+
# install
94+
sudo -u admin tar -xzf ${binaryName}
95+
sudo install -m 0755 -o root -g root -t /usr/local/bin lnd-linux-${lndOSversion}-v${lndVersion}/*
96+
sleep 3
97+
installed=$(sudo -u admin lnd --version)
98+
if [ ${#installed} -eq 0 ]; then
99+
echo ""
100+
echo "!!! BUILD FAILED --> Was not able to install LND"
101+
exit 1
102+
fi
103+
104+
sudo systemctl restart lnd
105+
106+
echo ""
107+
echo "Installed ${installed}"

0 commit comments

Comments
 (0)