#3468 Update electrs to 0.9.11 (#3613)

This commit is contained in:
/rootzoll 2023-02-03 20:46:07 +01:00 committed by GitHub
parent b63981fb9f
commit 3b087a00cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 42 additions and 25 deletions

View file

@ -15,7 +15,7 @@
- Update: Bitcoin Core v24.0.1 [details](https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-24.0.1.md) - Update: Bitcoin Core v24.0.1 [details](https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-24.0.1.md)
- Update: LND v0.15.5 [details](https://github.com/lightningnetwork/lnd/releases/tag/v0.15.5-beta) - Update: LND v0.15.5 [details](https://github.com/lightningnetwork/lnd/releases/tag/v0.15.5-beta)
- Update: Core Lightning v22.11.1 [details](https://github.com/ElementsProject/lightning/releases/tag/v22.11.1) - Update: Core Lightning v22.11.1 [details](https://github.com/ElementsProject/lightning/releases/tag/v22.11.1)
- Update: Electrum Server in Rust (electrs) v0.9.10 [details](https://github.com/romanz/electrs/blob/master/RELEASE-NOTES.md#0910-nov-3-2022) - Update: Electrum Server in Rust (electrs) v0.9.11 [details](https://github.com/romanz/electrs/blob/master/RELEASE-NOTES.md#0911-jan-5-2023)
- Update: Lightning Terminal v0.8.4-alpha [details](https://github.com/lightninglabs/lightning-terminal/releases/tag/v0.8.4-alpha) - Update: Lightning Terminal v0.8.4-alpha [details](https://github.com/lightninglabs/lightning-terminal/releases/tag/v0.8.4-alpha)
- Update: RTL v0.13.0 with update option [details](https://github.com/Ride-The-Lightning/RTL/releases/tag/v0.12.3) - Update: RTL v0.13.0 with update option [details](https://github.com/Ride-The-Lightning/RTL/releases/tag/v0.12.3)
- Update: Thunderhub v0.13.16 with balance sharing disabled [details](https://github.com/apotdevin/thunderhub/releases/tag/v0.13.16) - Update: Thunderhub v0.13.16 with balance sharing disabled [details](https://github.com/apotdevin/thunderhub/releases/tag/v0.13.16)

View file

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# https://github.com/romanz/electrs/releases # https://github.com/romanz/electrs/releases
ELECTRSVERSION="v0.9.10" ELECTRSVERSION="v0.9.11"
# https://github.com/romanz/electrs/commits/master # https://github.com/romanz/electrs/commits/master
# ELECTRSVERSION="446858ea621416916f84cbce61be92b748e8133e" # ELECTRSVERSION="446858ea621416916f84cbce61be92b748e8133e"
@ -73,7 +73,7 @@ if [ "$1" = "status" ]; then
# no answer on that port # no answer on that port
echo "publicHTTPPortAnswering=0" echo "publicHTTPPortAnswering=0"
fi fi
# add TOR info # add Tor info
if [ "${runBehindTor}" == "on" ]; then if [ "${runBehindTor}" == "on" ]; then
echo "TorRunning=1" echo "TorRunning=1"
if [ "$2" = "showAddress" ]; then if [ "$2" = "showAddress" ]; then
@ -269,7 +269,7 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
isInstalled=$(sudo ls /etc/systemd/system/electrs.service 2>/dev/null | grep -c 'electrs.service') isInstalled=$(sudo ls /etc/systemd/system/electrs.service 2>/dev/null | grep -c 'electrs.service')
if [ ${isInstalled} -eq 0 ]; then if [ ${isInstalled} -eq 0 ]; then
#cleanup # cleanup
sudo rm -f /home/electrs/.electrs/config.toml sudo rm -f /home/electrs/.electrs/config.toml
echo echo
@ -290,9 +290,14 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
echo echo
sudo -u electrs git clone https://github.com/romanz/electrs sudo -u electrs git clone https://github.com/romanz/electrs
cd /home/electrs/electrs || exit 1 cd /home/electrs/electrs || exit 1
sudo -u electrs git reset --hard $ELECTRSVERSION sudo -u electrs git reset --hard $ELECTRSVERSION
# verify
sudo -u electrs /home/admin/config.scripts/blitz.git-verify.sh \ sudo -u electrs /home/admin/config.scripts/blitz.git-verify.sh \
"${PGPsigner}" "${PGPpubkeyLink}" "${PGPpubkeyFingerprint}" || exit 1 "${PGPsigner}" "${PGPpubkeyLink}" "${PGPpubkeyFingerprint}" || exit 1
# build
sudo -u electrs /home/electrs/.cargo/bin/cargo build --locked --release || exit 1 sudo -u electrs /home/electrs/.cargo/bin/cargo build --locked --release || exit 1
echo echo
@ -303,7 +308,7 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
echo echo
echo "# Getting RPC credentials from the bitcoin.conf" echo "# Getting RPC credentials from the bitcoin.conf"
#read PASSWORD_B # read PASSWORD_B
RPC_USER=$(sudo cat /mnt/hdd/bitcoin/bitcoin.conf | grep rpcuser | cut -c 9-) RPC_USER=$(sudo cat /mnt/hdd/bitcoin/bitcoin.conf | grep rpcuser | cut -c 9-)
PASSWORD_B=$(sudo cat /mnt/hdd/bitcoin/bitcoin.conf | grep rpcpassword | cut -c 13-) PASSWORD_B=$(sudo cat /mnt/hdd/bitcoin/bitcoin.conf | grep rpcpassword | cut -c 13-)
echo "# Done" echo "# Done"
@ -479,8 +484,7 @@ fi
# switch off # switch off
if [ "$1" = "0" ] || [ "$1" = "off" ]; then if [ "$1" = "0" ] || [ "$1" = "off" ]; then
# setting value in raspiblitz config echo "# REMOVING ELECTRS"
/home/admin/config.scripts/blitz.conf.sh set ElectRS "off"
# if second parameter is "deleteindex" # if second parameter is "deleteindex"
if [ "$2" == "deleteindex" ]; then if [ "$2" == "deleteindex" ]; then
@ -488,23 +492,10 @@ if [ "$1" = "0" ] || [ "$1" = "off" ]; then
sudo rm -rf /mnt/hdd/app-storage/electrs/ sudo rm -rf /mnt/hdd/app-storage/electrs/
fi fi
# Hidden Service if Tor is active
if [ "${runBehindTor}" = "on" ]; then
/home/admin/config.scripts/tor.onion-service.sh off electrs
fi
isInstalled=$(sudo ls /etc/systemd/system/electrs.service 2>/dev/null | grep -c 'electrs.service') isInstalled=$(sudo ls /etc/systemd/system/electrs.service 2>/dev/null | grep -c 'electrs.service')
if [ ${isInstalled} -eq 1 ]; then if [ ${isInstalled} -eq 1 ]; then
echo "# REMOVING ELECTRS"
sudo systemctl disable electrs sudo systemctl disable electrs
sudo rm /etc/systemd/system/electrs.service sudo rm /etc/systemd/system/electrs.service
# delete user and home directory
sudo userdel -rf electrs
# close ports on firewall
sudo ufw deny 50001
sudo ufw deny 50002
echo "# OK ElectRS removed."
# restart BTC-RPC-Explorer to reconfigure itself to use electrs for address API # restart BTC-RPC-Explorer to reconfigure itself to use electrs for address API
if [ "${BTCRPCexplorer}" == "on" ]; then if [ "${BTCRPCexplorer}" == "on" ]; then
@ -513,8 +504,25 @@ if [ "$1" = "0" ] || [ "$1" = "off" ]; then
fi fi
else else
echo "# ElectRS is not installed." echo "# electrs.service is not installed."
fi fi
# Hidden Service if Tor is active
if [ "${runBehindTor}" = "on" ]; then
/home/admin/config.scripts/tor.onion-service.sh off electrs
fi
# close ports on firewall
sudo ufw delete allow 50001
sudo ufw delete allow 50002
# delete user and home directory
sudo userdel -rf electrs
# setting value in raspiblitz config
/home/admin/config.scripts/blitz.conf.sh set ElectRS "off"
echo "# OK ElectRS removed."
exit 0 exit 0
fi fi
@ -523,7 +531,7 @@ if [ "$1" = "update" ]; then
cd /home/electrs/electrs || exit 1 cd /home/electrs/electrs || exit 1
sudo -u electrs git fetch sudo -u electrs git fetch
localVersion=$(git describe --tag) localVersion=$(/home/electrs/electrs/target/release/electrs --version)
updateVersion=$(curl --header "X-GitHub-Api-Version:2022-11-28" -s https://api.github.com/repos/romanz/electrs/releases/latest|grep tag_name|head -1|cut -d '"' -f4) updateVersion=$(curl --header "X-GitHub-Api-Version:2022-11-28" -s https://api.github.com/repos/romanz/electrs/releases/latest|grep tag_name|head -1|cut -d '"' -f4)
if [ $localVersion = $updateVersion ]; then if [ $localVersion = $updateVersion ]; then
@ -533,12 +541,21 @@ if [ "$1" = "update" ]; then
sudo -u electrs git pull -p sudo -u electrs git pull -p
echo "# Reset to the latest release tag: $updateVersion" echo "# Reset to the latest release tag: $updateVersion"
sudo -u electrs git reset --hard $updateVersion sudo -u electrs git reset --hard $updateVersion
sudo -u electrs /home/admin/config.scripts/blitz.git-verify.sh \
"${PGPsigner}" "${PGPpubkeyLink}" "${PGPpubkeyFingerprint}" || exit 1
echo "# Installing build dependencies"
sudo -u electrs curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sudo -u electrs sh -s -- --default-toolchain none -y
sudo apt install -y clang cmake build-essential # for building 'rust-rocksdb'
echo
echo "# Build Electrs ..." echo "# Build Electrs ..."
sudo -u electrs /home/electrs/.cargo/bin/cargo build --locked --release || exit 1 sudo -u electrs /home/electrs/.cargo/bin/cargo build --locked --release || exit 1
# update config # update config
sed -i "/^server_banner =/d" /home/electrs/.electrs/config.toml sudo -u electrs sed -i "/^server_banner = /d" /home/electrs/.electrs/config.toml
sudo bash -c "echo 'server_banner = \"Welcome to electrs $updateVersion - the Electrum Rust Server on your RaspiBlitz\"' >> /home/electrs/.electrs/config.toml" sudo -u electrs bash -c "echo 'server_banner = \"Welcome to electrs $updateVersion - the Electrum Rust Server on your RaspiBlitz\"' >> /home/electrs/.electrs/config.toml"
echo "# Updated Electrs to $updateVersion" echo "# Updated Electrs to $updateVersion"
fi fi