mirror of
https://github.com/Retropex/raspiblitz.git
synced 2025-05-12 19:20:48 +02:00
switch to Bitcoin Knots
This commit is contained in:
parent
336a3418e9
commit
d89e521b61
@ -1,18 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
# set version (change if update is available)
|
||||
# https://bitcoincore.org/en/download/
|
||||
bitcoinVersion="26.0"
|
||||
# https://bitcoinknots.org/file/
|
||||
bitcoinVersion="27.1.knots20240801"
|
||||
|
||||
|
||||
# command info
|
||||
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
|
||||
echo
|
||||
echo "bitcoin.install.sh install - called by build.sdcard.sh"
|
||||
echo "Install or remove parallel chains for Bitcoin Core:"
|
||||
echo "Install or remove parallel chains for Bitcoin Knots:"
|
||||
echo "bitcoin.install.sh install"
|
||||
echo "bitcoin.install.sh [on|off] [signet|testnet|mainnet]"
|
||||
echo "Installs Bitcoin Core $bitcoinVersion by default"
|
||||
echo "Installs Bitcoin Knots $bitcoinVersion by default"
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
@ -78,13 +78,12 @@ if [ "$1" = "install" ]; then
|
||||
cd /home/admin/download || exit 1
|
||||
|
||||
echo "# Receive signer keys"
|
||||
curl -s "https://api.github.com/repos/bitcoin-core/guix.sigs/contents/builder-keys" |
|
||||
jq -r '.[].download_url' | while read url; do curl -s "$url" | gpg --import; done
|
||||
curl -s "https://raw.githubusercontent.com/bitcoin-core/guix.sigs/main/builder-keys/luke-jr.gpg" | gpg --import
|
||||
|
||||
# download signed binary sha256 hash sum file
|
||||
sudo -u admin wget --prefer-family=ipv4 --progress=bar:force -O SHA256SUMS https://bitcoincore.org/bin/bitcoin-core-${bitcoinVersion}/SHA256SUMS
|
||||
sudo -u admin wget --prefer-family=ipv4 --progress=bar:force -O SHA256SUMS https://bitcoinknots.org/files/27.x/${bitcoinVersion}/SHA256SUMS
|
||||
# download the signed binary sha256 hash sum file and check
|
||||
sudo -u admin wget --prefer-family=ipv4 --progress=bar:force -O SHA256SUMS.asc https://bitcoincore.org/bin/bitcoin-core-${bitcoinVersion}/SHA256SUMS.asc
|
||||
sudo -u admin wget --prefer-family=ipv4 --progress=bar:force -O SHA256SUMS.asc https://bitcoinknots.org/files/27.x/${bitcoinVersion}/SHA256SUMS.asc
|
||||
|
||||
if gpg --verify SHA256SUMS.asc; then
|
||||
echo
|
||||
@ -108,13 +107,13 @@ if [ "$1" = "install" ]; then
|
||||
fi
|
||||
|
||||
echo
|
||||
echo "*** BITCOIN CORE v${bitcoinVersion} for ${bitcoinOSversion} ***"
|
||||
echo "*** BITCOIN KNOTS v${bitcoinVersion} for ${bitcoinOSversion} ***"
|
||||
|
||||
# download resources
|
||||
binaryName="bitcoin-${bitcoinVersion}-${bitcoinOSversion}.tar.gz"
|
||||
if [ ! -f "./${binaryName}" ]; then
|
||||
echo "# Downloading https://bitcoincore.org/bin/bitcoin-core-${bitcoinVersion}/${binaryName} ..."
|
||||
sudo -u admin wget --quiet https://bitcoincore.org/bin/bitcoin-core-${bitcoinVersion}/${binaryName}
|
||||
echo "# Downloading https://bitcoinknots.org/files/27.x/${bitcoinVersion}/${binaryName} ..."
|
||||
sudo -u admin wget --quiet https://bitcoinknots.org/files/27.x/${bitcoinVersion}/${binaryName}
|
||||
fi
|
||||
if [ ! -f "./${binaryName}" ]; then
|
||||
echo "# FAIL # Could not download the BITCOIN BINARY"
|
||||
@ -135,7 +134,7 @@ if [ "$1" = "install" ]; then
|
||||
else
|
||||
echo
|
||||
echo "********************************************"
|
||||
echo "OK --> VERIFIED BITCOIN CORE BINARY CHECKSUM"
|
||||
echo "OK --> VERIFIED BITCOIN KNOTS BINARY CHECKSUM"
|
||||
echo "********************************************"
|
||||
echo
|
||||
sleep 10
|
||||
@ -177,12 +176,12 @@ function removeParallelService() {
|
||||
echo "# The signetd.service is stopped and disabled"
|
||||
fi
|
||||
fi
|
||||
echo "# Bitcoin Core on ${CHAIN} service is stopped and disabled"
|
||||
echo "# Bitcoin Knots on ${CHAIN} service is stopped and disabled"
|
||||
fi
|
||||
}
|
||||
|
||||
function installParallelService() {
|
||||
echo "# Installing Bitcoin Core instance on ${CHAIN}"
|
||||
echo "# Installing Bitcoin Knots instance on ${CHAIN}"
|
||||
# bitcoin.conf
|
||||
if [ ! -f /home/bitcoin/.bitcoin/bitcoin.conf ]; then
|
||||
# add minimal config
|
||||
@ -347,7 +346,7 @@ fi
|
||||
|
||||
# switch off
|
||||
if [ "$1" = "0" ] || [ "$1" = "off" ]; then
|
||||
echo "# Uninstall Bitcoin Core instance on ${CHAIN}"
|
||||
echo "# Uninstall Bitcoin Knots instance on ${CHAIN}"
|
||||
removeParallelService
|
||||
# setting value in raspi blitz config
|
||||
/home/admin/config.scripts/blitz.conf.sh set ${CHAIN} "off"
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
# command info
|
||||
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
|
||||
echo "Interim optional Bitcoin Core updates between RaspiBlitz releases."
|
||||
echo "Interim optional Bitcoin Knots updates between RaspiBlitz releases."
|
||||
echo "bitcoin.update.sh [info|tested|reckless|custom]"
|
||||
echo "info -> get actual state and possible actions"
|
||||
echo "tested -> only do a tested update by the RaspiBlitz team"
|
||||
@ -20,7 +20,7 @@ echo "# Running: bitcoin.update.sh $*"
|
||||
mode="$1"
|
||||
|
||||
# RECOMMENDED UPDATE BY RASPIBLITZ TEAM (latest tested version available)
|
||||
bitcoinVersion="27.1" # example: 22.0 .. keep empty if no newer version as sd card build is available
|
||||
bitcoinVersion="27.1.knots20240801" # example: 22.0 .. keep empty if no newer version as sd card build is available
|
||||
|
||||
# GATHER DATA
|
||||
# setting download directory to the current user
|
||||
@ -42,7 +42,7 @@ installedVersion=$(sudo -u bitcoin bitcoind --version | head -n1 | cut -d" " -f4
|
||||
bitcoinUpdateInstalled=$(echo "${installedVersion}" | grep -c "${bitcoinVersion}")
|
||||
|
||||
# get latest release from GitHub releases
|
||||
bitcoinLatestVersion=$(curl --header "X-GitHub-Api-Version:2022-11-28" -s https://api.github.com/repos/bitcoin/bitcoin/releases | jq -r '.[].tag_name' | sort | tail -n1 | cut -c 2-)
|
||||
bitcoinLatestVersion=$(curl --header "X-GitHub-Api-Version:2022-11-28" -s https://api.github.com/repos/bitcoinknots/bitcoin/releases | jq -r '.[].tag_name' | sort | tail -n1 | cut -c 2-)
|
||||
|
||||
# INFO
|
||||
function displayInfo() {
|
||||
@ -54,7 +54,7 @@ function displayInfo() {
|
||||
echo "bitcoinUpdateInstalled='${bitcoinUpdateInstalled}'"
|
||||
echo "bitcoinVersion='${bitcoinVersion}'"
|
||||
|
||||
echo "# reckless update option (latest Bitcoin Core release from GitHub)"
|
||||
echo "# reckless update option (latest Bitcoin Knots release from GitHub)"
|
||||
echo "bitcoinLatestVersion='${bitcoinLatestVersion}'"
|
||||
}
|
||||
|
||||
@ -155,7 +155,7 @@ elif [ "${mode}" = "custom" ]; then
|
||||
else
|
||||
clear
|
||||
echo
|
||||
echo "# Update Bitcoin Core to a chosen version."
|
||||
echo "# Update Bitcoin Knots to a chosen version."
|
||||
echo
|
||||
echo "# Input the version you would like to install and press ENTER."
|
||||
echo "# Examples (versions below 22.1 are not supported):"
|
||||
@ -175,12 +175,12 @@ elif [ "${mode}" = "custom" ]; then
|
||||
fi
|
||||
|
||||
if curl --output /dev/null --silent --head --fail \
|
||||
https://bitcoincore.org/bin/bitcoin-core-${pathVersion}/SHA256SUMS.asc; then
|
||||
echo "# OK version exists at https://bitcoincore.org/bin/bitcoin-core-${pathVersion}"
|
||||
https://bitcoinknots.org/files/27.x/${pathVersion}/SHA256SUMS.asc; then
|
||||
echo "# OK version exists at https://bitcoinknots.org/files/27.x/${pathVersion}"
|
||||
if [ "${mode}" = "custom" ] && [ "$3" = "skipverify" ]; then
|
||||
echo "# skipping signature verification"
|
||||
fi
|
||||
echo "# Press ENTER to proceed to install Bitcoin Core $bitcoinVersion or CTRL+C to abort."
|
||||
echo "# Press ENTER to proceed to install Bitcoin Knots $bitcoinVersion or CTRL+C to abort."
|
||||
read key
|
||||
else
|
||||
echo "# FAIL $bitcoinVersion does not exist"
|
||||
@ -209,13 +209,12 @@ if [ "${mode}" = "tested" ] || [ "${mode}" = "reckless" ] || [ "${mode}" = "cust
|
||||
cd "${downloadDir}" || exit 1
|
||||
|
||||
echo "# Receive signer keys"
|
||||
curl -s "https://api.github.com/repos/bitcoin-core/guix.sigs/contents/builder-keys" |
|
||||
jq -r '.[].download_url' | while read url; do curl -s "$url" | gpg --import; done
|
||||
curl -s "https://raw.githubusercontent.com/bitcoin-core/guix.sigs/main/builder-keys/luke-jr.gpg" | gpg --import
|
||||
|
||||
# download signed binary sha256 hash sum file
|
||||
wget --prefer-family=ipv4 --progress=bar:force -O SHA256SUMS https://bitcoincore.org/bin/bitcoin-core-${bitcoinVersion}/SHA256SUMS
|
||||
wget --prefer-family=ipv4 --progress=bar:force -O SHA256SUMS https://bitcoinknots.org/files/27.x/${bitcoinVersion}/SHA256SUMS
|
||||
# download the signed binary sha256 hash sum file and check
|
||||
wget --prefer-family=ipv4 --progress=bar:force -O SHA256SUMS.asc https://bitcoincore.org/bin/bitcoin-core-${bitcoinVersion}/SHA256SUMS.asc
|
||||
wget --prefer-family=ipv4 --progress=bar:force -O SHA256SUMS.asc https://bitcoinknots.org/files/27.x/${bitcoinVersion}/SHA256SUMS.asc
|
||||
|
||||
if [ "${mode}" = "custom" ] && [ "$3" = "skipverify" ]; then
|
||||
echo "# skipping signature verification"
|
||||
@ -238,9 +237,9 @@ if [ "${mode}" = "tested" ] || [ "${mode}" = "reckless" ] || [ "${mode}" = "cust
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "# Downloading Bitcoin Core v${bitcoinVersion} for ${bitcoinOSversion} ..."
|
||||
echo "# Downloading Bitcoin Knots v${bitcoinVersion} for ${bitcoinOSversion} ..."
|
||||
binaryName="bitcoin-${bitcoinVersion}-${bitcoinOSversion}.tar.gz"
|
||||
wget https://bitcoincore.org/bin/bitcoin-core-${pathVersion}/${binaryName}
|
||||
wget https://bitcoinknots.org/files/27.x/${pathVersion}/${binaryName}
|
||||
if [ ! -f "./${binaryName}" ]; then
|
||||
echo "# FAIL # Downloading BITCOIN BINARY did not succeed."
|
||||
exit 1
|
||||
@ -257,7 +256,7 @@ if [ "${mode}" = "tested" ] || [ "${mode}" = "reckless" ] || [ "${mode}" = "cust
|
||||
exit 1
|
||||
else
|
||||
echo
|
||||
echo "# OK --> VERIFIED BITCOIN CORE BINARY CHECKSUM IS CORRECT"
|
||||
echo "# OK --> VERIFIED BITCOIN KNOTS BINARY CHECKSUM IS CORRECT"
|
||||
echo
|
||||
fi
|
||||
fi
|
||||
@ -277,7 +276,7 @@ if [ "${mode}" = "tested" ] || [ "${mode}" = "reckless" ] || [ "${mode}" = "cust
|
||||
sudo systemctl stop tbitcoind 2>/dev/null
|
||||
sudo systemctl stop sbitcoind 2>/dev/null
|
||||
echo
|
||||
echo "# Installing Bitcoin Core v${bitcoinVersion}"
|
||||
echo "# Installing Bitcoin Knots v${bitcoinVersion}"
|
||||
tar -xvf ${binaryName}
|
||||
sudo install -m 0755 -o root -g root -t /usr/local/bin/ bitcoin-${bitcoinVersion}/bin/*
|
||||
sleep 3
|
||||
@ -290,7 +289,7 @@ if [ "${mode}" = "tested" ] || [ "${mode}" = "reckless" ] || [ "${mode}" = "cust
|
||||
echo "# mark update in raspiblitz config"
|
||||
/home/admin/config.scripts/blitz.conf.sh set bitcoinInterimsUpdate "${bitcoinInterimsUpdateNew}"
|
||||
|
||||
echo "# OK Bitcoin Core ${bitcoinVersion} is installed"
|
||||
echo "# OK Bitcoin Knots ${bitcoinVersion} is installed"
|
||||
exit 0
|
||||
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user