This commit is contained in:
rootzoll 2021-09-20 00:17:06 +02:00
commit e6f5006335
5 changed files with 60 additions and 43 deletions

View file

@ -7,7 +7,7 @@
- New: CLN plugin: Sparko [details](https://github.com/fiatjaf/sparko)
- New: Suez - channel visualization for LND and CLN [details](https://github.com/prusnak/suez)
- New: LND Static Channel Backup to Nextcloud
- Update: Bitcoin Core v0.21.1 [details](https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-0.21.1.md)
- Update: Bitcoin Core v22.0 [details](https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-22.0.md)
- Update: LND v0.13.1 [details](https://github.com/lightningnetwork/lnd/releases/tag/v0.13.1-beta)
- Update: RTL 0.11.2 [details](https://github.com/Ride-The-Lightning/RTL/releases/tag/v0.11.2)
- Update: Specter Desktop 1.6.0 [details](https://github.com/cryptoadvance/specter-desktop/blob/master/README.md)

View file

@ -20,14 +20,15 @@ mode="$1"
# RECOMMENDED UPDATE BY RASPIBLITZ TEAM
# comment will be shown as "BEWARE Info" when option is choosen (can be multiple lines)
bitcoinVersion="" # example: 0.21.0 .. keep empty if no newer version as sd card build is available
bitcoinVersion="" # example: 22.0 .. keep empty if no newer version as sd card build is available
# needed to check code signing
laanwjPGP="01EA5486DE18A882D4C2684590C8019E36C2E964"
# https://github.com/laanwj
laanwjPGP="71A3 B167 3540 5025 D447 E8F2 7481 0B01 2346 C9A6"
# GATHER DATA
# setting download directory
downloadDir="/home/admin/download"
# setting download directory to the current user
downloadDir="/home/$(whoami)/download/bitcoin.update"
# detect CPU architecture & fitting download link
if [ $(uname -m | grep -c 'arm') -eq 1 ] ; then
@ -105,14 +106,15 @@ elif [ "${mode}" = "custom" ]; then
echo "# Update Bitcoin Core to a chosen version."
echo
echo "# Input the version you would like to install and press ENTER."
echo "# Examples:"
echo "0.21.1rc1"
echo "0.21.0"
echo "# Examples (versions below 22 are not supported):"
echo "22.0rc3"
echo "22.0"
echo
read bitcoinVersion
if [ $(echo ${bitcoinVersion} | grep -c "rc") -gt 0 ];then
cutVersion=$(echo ${bitcoinVersion} | awk -F"r" '{print $1}')
rcVersion=$(echo ${bitcoinVersion} | awk -F"r" '{print $2}')
# https://bitcoincore.org/bin/bitcoin-core-22.0/test.rc3/
pathVersion=${cutVersion}/test.r${rcVersion}
else
pathVersion=${bitcoinVersion}
@ -145,34 +147,42 @@ if [ "${mode}" = "tested" ]||[ "${mode}" = "reckless" ]||[ "${mode}" = "custom"
echo
echo "# clean & change into download directory"
sudo rm -r ${downloadDir}/*
sudo rm -rf "${downloadDir}"
mkdir -p "${downloadDir}"
cd "${downloadDir}" || exit 1
echo
# download, check and import signer key
sudo -u admin wget https://bitcoin.org/laanwj-releases.asc
if [ ! -f "./laanwj-releases.asc" ]
# download signed binary sha256 hash sum file
wget https://bitcoincore.org/bin/bitcoin-core-${pathVersion}/SHA256SUMS
# download signed binary sha256 hash sum file and check
wget https://bitcoincore.org/bin/bitcoin-core-${pathVersion}/SHA256SUMS.asc
echo "# Paste the PGP pubkey fingerprint of a signer."
echo "# Example for W. J. van der Laan (https://github.com/laanwj):"
echo "71A3 B167 3540 5025 D447 E8F2 7481 0B01 2346 C9A6"
echo ""
read customKey
if [ ${#customKey} -eq 0 ];then
customKey=$laanwjPGP
fi
# receive signer key
if ! gpg --recv-key "$customKey"
then
echo "# !!! FAIL !!! Download laanwj-releases.asc not success."
echo
echo "!!! FAIL !!! Could not download the PGP pubkey"
echo
echo "See the signers of this release:"
echo
gpg --verify SHA256SUMS.asc
echo
exit 1
fi
gpg --import-options show-only --import ./laanwj-releases.asc
fingerprint=$(gpg ./laanwj-releases.asc 2>/dev/null | grep -c "${laanwjPGP}")
if [ ${fingerprint} -eq 0 ]; then
echo
echo "# !!! BUILD WARNING --> Bitcoin PGP author not as expected"
echo "# Should contain laanwjPGP: ${laanwjPGP}"
echo "# PRESS ENTER to TAKE THE RISK if you think all is OK"
read key
fi
gpg --import ./laanwj-releases.asc
# download signed binary sha256 hash sum file and check
sudo -u admin wget https://bitcoincore.org/bin/bitcoin-core-${pathVersion}/SHA256SUMS.asc
verifyResult=$(gpg --verify SHA256SUMS.asc 2>&1)
goodSignature=$(echo ${verifyResult} | grep 'Good signature' -c)
echo "goodSignature(${goodSignature})"
correctKey=$(echo ${verifyResult} | grep "using RSA key ${laanwjPGP: -16}" -c)
correctKey=$(echo ${verifyResult} | grep "${customKey}" -c)
echo "correctKey(${correctKey})"
if [ ${correctKey} -lt 1 ] || [ ${goodSignature} -lt 1 ]; then
echo
@ -186,7 +196,7 @@ if [ "${mode}" = "tested" ]||[ "${mode}" = "reckless" ]||[ "${mode}" = "custom"
echo "# Downloading Bitcoin Core v${bitcoinVersion} for ${bitcoinOSversion} ..."
binaryName="bitcoin-${bitcoinVersion}-${bitcoinOSversion}.tar.gz"
sudo -u admin wget https://bitcoincore.org/bin/bitcoin-core-${pathVersion}/${binaryName}
wget https://bitcoincore.org/bin/bitcoin-core-${pathVersion}/${binaryName}
if [ ! -f "./${binaryName}" ]
then
echo "# !!! FAIL !!! Downloading BITCOIN BINARY did not succeed."
@ -194,11 +204,11 @@ if [ "${mode}" = "tested" ]||[ "${mode}" = "reckless" ]||[ "${mode}" = "custom"
fi
echo "# Checking binary checksum ..."
checksumTest=$(sha256sum -c --ignore-missing SHA256SUMS.asc ${binaryName} 2>/dev/null \
checksumTest=$(sha256sum -c --ignore-missing SHA256SUMS ${binaryName} 2>/dev/null \
| grep -c "${binaryName}: OK")
if [ "${checksumTest}" -eq 0 ]; then
# get the sha256 value for the corresponding platform from signed hash sum file
bitcoinSHA256=$(grep -i "$bitcoinOSversion" SHA256SUMS.asc | cut -d " " -f1)
bitcoinSHA256=$(grep -i "${binaryName}}" SHA256SUMS | cut -d " " -f1)
echo "!!! FAIL !!! Downloaded BITCOIN BINARY CHECKSUM:"
echo "$(sha256sum ${binaryName})"
echo "NOT matching SHA256 checksum:"
@ -206,10 +216,9 @@ if [ "${mode}" = "tested" ]||[ "${mode}" = "reckless" ]||[ "${mode}" = "custom"
exit 1
else
echo
echo "# OK --> VERIFIED BITCOIN CHECKSUM IS CORRECT"
echo "# OK --> VERIFIED BITCOIN CORE BINARY CHECKSUM IS CORRECT"
echo
fi
fi
if [ "${mode}" = "tested" ]||[ "${mode}" = "custom" ]; then
@ -227,10 +236,10 @@ if [ "${mode}" = "tested" ]||[ "${mode}" = "reckless" ]||[ "${mode}" = "custom"
sudo systemctl stop bitcoind
echo
echo "# Installing Bitcoin Core v${bitcoinVersion}"
sudo -u admin tar -xvf ${binaryName}
tar -xvf ${binaryName}
sudo install -m 0755 -o root -g root -t /usr/local/bin/ bitcoin-${bitcoinVersion}/bin/*
sleep 3
installed=$(sudo -u admin bitcoind --version | grep "${bitcoinVersion}" -c)
installed=$(bitcoind --version | grep "${bitcoinVersion}" -c)
if [ ${installed} -lt 1 ]; then
echo
echo "# !!! BUILD FAILED --> Was not able to install bitcoind version(${bitcoinVersion})"

View file

@ -276,7 +276,7 @@ else
echo "- BTCPayServer is OFF by config"
fi
if [ ${BTCRPCexplorer} == "on" ]; then
if [ "${BTCRPCexplorer}" == "on" ]; then
echo
echo "*** LAST 20 BTC-RPC-Explorer LOGS ***"
echo "sudo journalctl -u btc-rpc-explorer -b --no-pager -n20"

View file

@ -37,11 +37,14 @@ source <(/home/admin/config.scripts/network.aliases.sh getvars cln $2)
echo "# Running: 'cln.install.sh $*'"
echo "# Using the settings for: ${network} ${CHAIN}"
# add default value to raspi config if needed
if ! grep -Eq "^lightning=" /mnt/hdd/raspiblitz.conf; then
echo "lightning=cln" | sudo tee -a /mnt/hdd/raspiblitz.conf
fi
# add default value to raspi config if needed
if ! grep -Eq "^${netprefix}cln=" /mnt/hdd/raspiblitz.conf; then
echo "${netprefix}cln=off" | sudo tee -a /mnt/hdd/raspiblitz.conf
fi
source /mnt/hdd/raspiblitz.conf
if [ "$1" = on ]||[ "$1" = update ]||[ "$1" = experimental ]||[ "$1" = testPR ];then

View file

@ -38,6 +38,17 @@ elif [ ${CHAIN} = mainnet ];then
zmqprefix=28
fi
source /home/admin/raspiblitz.info
# add default value to raspi config if needed
if ! grep -Eq "^lightning=" /mnt/hdd/raspiblitz.conf; then
echo "lightning=lnd" | sudo tee -a /mnt/hdd/raspiblitz.conf
fi
# add default value to raspi config if needed
if ! grep -Eq "^${netprefix}lnd=" /mnt/hdd/raspiblitz.conf; then
echo "${netprefix}lnd=off" >> /mnt/hdd/raspiblitz.conf
fi
source /mnt/hdd/raspiblitz.conf
function removeParallelService() {
if [ -f "/etc/systemd/system/${netprefix}lnd.service" ];then
sudo -u bitcoin /usr/local/bin/lncli\
@ -50,12 +61,6 @@ function removeParallelService() {
fi
}
source /home/admin/raspiblitz.info
# add default value to raspi config if needed
if ! grep -Eq "^${netprefix}lnd=" /mnt/hdd/raspiblitz.conf; then
echo "${netprefix}lnd=off" >> /mnt/hdd/raspiblitz.conf
fi
source /mnt/hdd/raspiblitz.conf
# switch on
if [ "$1" = "1" ] || [ "$1" = "on" ]; then