mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-04-11 13:20:56 +02:00
Merge branch 'dev' into v1.11.0-changes
This commit is contained in:
commit
49ce0d7336
20
.github/workflows/spelling.yml
vendored
Normal file
20
.github/workflows/spelling.yml
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
name: Spelling
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: ["dev", "v1.10", "v1.11"]
|
||||
pull_request:
|
||||
branches: ["dev", "v1.10", "v1.11"]
|
||||
|
||||
jobs:
|
||||
spelling:
|
||||
name: Spell Check with Typos
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Actions Repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Spell Check Repo
|
||||
uses: crate-ci/typos@master
|
||||
with:
|
||||
config: typos.toml
|
14
CHANGES.md
14
CHANGES.md
@ -1,13 +1,16 @@
|
||||
## What's new in Version 1.11.0 of RaspiBlitz?
|
||||
|
||||
- Update: RasperryOS base image 2023-10-10-raspios-bookworm-arm64.img.xz [details](https://downloads.raspberrypi.org/raspios_arm64/images/raspios_arm64-2023-10-10/)
|
||||
- Update: Bitcoin Core v25.1 [details](https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-25.1.md)
|
||||
- Update: LND v0.17.2-beta [details](https://github.com/lightningnetwork/lnd/releases/tag/v0.17.2-beta)
|
||||
- New: Enabling NVMe PCIe Hats
|
||||
- Update: RaspiOS base image from 2023-12-05 (Bookworm)
|
||||
- Update: Bitcoin Core v26.0 [details](https://bitcoincore.org/en/releases/26.0/)
|
||||
- Update: LND v0.17.3-beta [details](https://github.com/lightningnetwork/lnd/releases/tag/v0.17.3-beta)
|
||||
- Update: Core Lightning v23.11 [details](https://github.com/ElementsProject/lightning/releases/tag/v23.11)
|
||||
- Update: C-lightningREST v0.10.7 [details](https://github.com/Ride-The-Lightning/c-lightning-REST/releases/tag/v0.10.7)
|
||||
- Update: CLBOSS 0.13+ (latest master 0673c50) [details](https://github.com/ZmnSCPxj/clboss/releases/tag/v0.13)
|
||||
- Update: BTCPayServer v1.12.3 [details](https://github.com/btcpayserver/btcpayserver/releases/tag/v1.12.3)
|
||||
- Update: Electrs (Electrum Server in Rust) v0.10.1 [details](https://github.com/romanz/electrs/blob/master/RELEASE-NOTES.md#0101-nov-01-2023)
|
||||
- Update: Fulcrum electrum server (CLI only) v1.9.7 [details](https://github.com/cculianu/Fulcrum/releases/tag/v1.9.7)
|
||||
- Update: Channel Tools (chantools) v0.12.0 [details](https://github.com/lightninglabs/chantools/releases/tag/v0.12.0)
|
||||
- Update: LNbits 0.11.3 [details](https://github.com/lnbits/lnbits/releases/tag/0.11.3)
|
||||
- Update: Circuitbreaker v0.5.1 [details](https://github.com/lightningequipment/circuitbreaker/blob/master/README.md)
|
||||
- Deprecated: Homer Dashboard (remove from SSH menus, config script will stay with possible future removal)
|
||||
- Deprecated: Bitcoinminds (remove from SSH menus, config script will stay with possible future removal)
|
||||
- Remove: ItchySats (unmaintained project / in consent with dev)
|
||||
@ -440,4 +443,3 @@ Version 1.1 packs some first fixes and enhancements to make the RaspiBlitz more
|
||||
- Removed: FTP download option for blockchain
|
||||
|
||||
For full details see issue list of [Release 1.1 Milestone](https://github.com/rootzoll/raspiblitz/milestone/3?closed=1).
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
_Build your own Lightning & Bitcoin Fullnode on a RaspberryPi with an optional Display._
|
||||
|
||||
`Version 1.10.0 with bitcoin 25.0.0, lnd 0.16.4 & Core Lightning 23.08.1` ([api](https://github.com/fusion44/blitz_api)|[web](https://github.com/raspiblitz/raspiblitz-web))
|
||||
`Version 1.11.0rc0 with bitcoin 26.0, lnd 0.17.3 & Core Lightning 23.11` ([api](https://github.com/fusion44/blitz_api)|[web](https://github.com/raspiblitz/raspiblitz-web))
|
||||
|
||||

|
||||
|
||||
@ -54,7 +54,7 @@ Additional Services that can be installed thru WebUI (beginners):
|
||||
Further Services that are just available thru SSH menu (advanced users):
|
||||
|
||||
- **ElectRS** (Electrum Server in Rust) [details](https://github.com/romanz/electrs)
|
||||
- **SpecterDesktop** (Multisig Trezor, Ledger, COLDCARDwallet & Specter-DIY) [details](https://github.com/cryptoadvance/specter-desktop) [app connection guide](https://d11n.net/connect-specter-desktor-with-raspiblitz.html)
|
||||
- **SpecterDesktop** (Multisig Trezor, Ledger, COLDCARDwallet & Specter-DIY) [details](https://github.com/cryptoadvance/specter-desktop) [app connection guide](https://web.archive.org/web/20220815214301/https://www.d11n.net/connect-specter-desktor-with-raspiblitz.html)
|
||||
- **Lightning Terminal (Loop, Pool & Faraday)** (Manage Channel Liquidity) [details](https://github.com/lightninglabs/lightning-terminal#lightning-terminal-lit)
|
||||
- **JoinMarket** (CoinJoin Service) [details](https://github.com/JoinMarket-Org/joinmarket-clientserver)
|
||||
- **JoinMarket Web UI** (Browser-based interface for JoinMarket) [details](https://github.com/joinmarket-webui/joinmarket-webui)
|
||||
@ -257,7 +257,7 @@ There are plenty off rooms you can find Raspiblitz users that can help you:
|
||||
|
||||
3. [Telegram Spanish](https://t.me/raspiblitz_ES)
|
||||
|
||||
4. [Telegram Italian](https://t.me/raspiblitz_IT)
|
||||
4. [Telegram Italian](https://t.me/raspiblitz_italia)
|
||||
|
||||
5. [Telegram Russian](https://t.me/raspiblitz_RU)
|
||||
|
||||
|
@ -78,23 +78,26 @@ Tested with:
|
||||
These not need installation, password: `osboxes.org`
|
||||
|
||||
### Building the Raspiblitz scripts
|
||||
* Run the build script in the terminal of the guest OS (with sudo access):
|
||||
* Run the build script in the terminal of the base OS (with sudo access):
|
||||
|
||||
```bash
|
||||
# download the build script
|
||||
wget https://raw.githubusercontent.com/rootzoll/raspiblitz/dev/build_sdcard.sh
|
||||
# run
|
||||
sudo bash build_sdcard.sh -f true -b dev -d headless -t false -w off
|
||||
# Options:
|
||||
# -h, --help this help info
|
||||
# -i, --interaction [0|1] interaction before proceeding with execution (default: 1)
|
||||
# -f, --fatpack [0|1] fatpack mode (default: 1)
|
||||
# -u, --github-user [rootzoll|other] github user to be checked from the repo (default: rootzoll)
|
||||
# -b, --branch [v1.7|v1.8] branch to be built on (default: v1.7)
|
||||
# -d, --display [lcd|hdmi|headless] display class (default: lcd)
|
||||
# -t, --tweak-boot-drive [0|1] tweak boot drives (default: 1)
|
||||
# -w, --wifi-region [off|US|GB|other] wifi iso code (default: US) or 'off'
|
||||
```
|
||||
```bash
|
||||
# download the build script
|
||||
wget https://raw.githubusercontent.com/rootzoll/raspiblitz/dev/build_sdcard.sh
|
||||
# run
|
||||
sudo bash build_sdcard.sh -f false -b dev -d headless -t false -w off
|
||||
```
|
||||
```
|
||||
Options:
|
||||
-EXPORT just print build parameters & exit'
|
||||
-h, --help this help info
|
||||
-i, --interaction [0|1] interaction before proceeding with execution (default: 1)
|
||||
-f, --fatpack [0|1] fatpack mode (default: 1)
|
||||
-u, --github-user [raspiblitz|other] github user to be checked from the repo (default: raspiblitz)
|
||||
-b, --branch [v1.7|v1.8] branch to be built on (default: v1.10)
|
||||
-d, --display [lcd|hdmi|headless] display class (default: lcd)
|
||||
-t, --tweak-boot-drive [0|1] tweak boot drives (default: 1)
|
||||
-w, --wifi-region [off|US|GB|other] wifi iso code (default: US) or 'off'
|
||||
```
|
||||
|
||||
* Switch off when ready
|
||||
* Attach an other disk (can be even small if you prune or [stop bitcoind](https://github.com/rootzoll/raspiblitz/issues/1500#issuecomment-982779830) manually.
|
||||
|
@ -2,10 +2,11 @@
|
||||
|
||||
#########################################################################
|
||||
# Build your SD card image based on: 2023-10-10-raspios-bookworm-arm64.img.xz
|
||||
# https://downloads.raspberrypi.org/raspios_arm64/images/raspios_arm64-2023-10-10/
|
||||
# SHA256: 1702d6494e8fc1036c39d73d99a5b7e0bfb5352fd2cf35fd940c66ceb37d2c0a
|
||||
# PGP fingerprint: 8738CD6B956F460C
|
||||
# PGP key: https://www.raspberrypi.org/raspberrypi_downloads.gpg.key
|
||||
# https://downloads.raspberrypi.org/raspios_arm64/images/raspios_arm64-2023-12-06/
|
||||
# SHA256: 5c54f0572d61e443a32dfa80aa8d918049814bfc70ab977f2d545eef45f1658e
|
||||
# also change in: raspiblitz/ci/arm64-rpi/build.arm64-rpi.pkr.hcl
|
||||
# PGP fingerprint: 8738CD6B956F460C - to check signature:
|
||||
# curl -O https://www.raspberrypi.org/raspberrypi_downloads.gpg.key && gpg --import ./raspberrypi_downloads.gpg.key && gpg --verify *.sig
|
||||
# setup fresh SD card with image above - login via SSH and run this script:
|
||||
##########################################################################
|
||||
|
||||
@ -30,9 +31,9 @@ usage(){
|
||||
Options:
|
||||
-EXPORT just print build parameters & exit'
|
||||
-h, --help this help info
|
||||
-i, --interaction [0|1] interaction before proceeding with exection (default: 1)
|
||||
-i, --interaction [0|1] interaction before proceeding with execution (default: 1)
|
||||
-f, --fatpack [0|1] fatpack mode (default: 1)
|
||||
-u, --github-user [raspiblitz|other] github user to be checked from the repo (default: ${defaultRepo})
|
||||
-u, --github-user [raspiblitz|other] github user to be checked from the repo (default: ${defaultRepo})
|
||||
-b, --branch [v1.7|v1.8] branch to be built on (default: ${defaultBranch})
|
||||
-d, --display [lcd|hdmi|headless] display class (default: lcd)
|
||||
-t, --tweak-boot-drive [0|1] tweak boot drives (default: 1)
|
||||
@ -436,15 +437,18 @@ if [ "${baseimage}" = "raspios_arm64" ]; then
|
||||
# see https://github.com/rootzoll/raspiblitz/issues/428#issuecomment-472822840
|
||||
|
||||
configFile="/boot/config.txt"
|
||||
max_usb_current="max_usb_current=1"
|
||||
max_usb_currentDone=$(grep -c "$max_usb_current" $configFile)
|
||||
raspiblitzEdits=$(grep -c "Raspiblitz" $configFile)
|
||||
|
||||
if [ ${max_usb_currentDone} -eq 0 ]; then
|
||||
if [ ${raspiblitzEdits} -eq 0 ]; then
|
||||
echo "# Raspiblitz Edits adding to $configFile"
|
||||
echo | tee -a $configFile
|
||||
echo "# Raspiblitz" | tee -a $configFile
|
||||
echo "$max_usb_current" | tee -a $configFile
|
||||
echo "max_usb_current=1" | tee -a $configFile
|
||||
echo "dtparam=nvme" | tee -a $configFile
|
||||
echo 'dtoverlay=pi3-disable-bt' | tee -a $configFile
|
||||
echo 'dtoverlay=disable-bt' | tee -a $configFile
|
||||
else
|
||||
echo "$max_usb_current already in $configFile"
|
||||
echo "# Raspiblitz Edits already in $configFile"
|
||||
fi
|
||||
|
||||
# run fsck on sd root partition on every startup to prevent "maintenance login" screen
|
||||
@ -477,6 +481,17 @@ if [ "${baseimage}" = "raspios_arm64" ]; then
|
||||
else
|
||||
echo "$fsOption2 already in $kernelOptionsFile"
|
||||
fi
|
||||
|
||||
# *** SAFE SHUTDOWN ***
|
||||
# logind
|
||||
echo "[Login]" | tee /etc/systemd/logind.conf.d/safeshutdown.conf
|
||||
echo "HandlePowerKey=ignore" | tee -a /etc/systemd/logind.conf.d/safeshutdown.conf
|
||||
# sudoers
|
||||
echo 'nobody ALL=(ALL) NOPASSWD: /home/admin/config.scripts/blitz.shutdown.sh' |
|
||||
tee -a /etc/sudoers
|
||||
# triggerhappy
|
||||
echo 'KEY_POWER 1 sudo /home/admin/config.scripts/blitz.shutdown.sh' |
|
||||
tee /etc/triggerhappy/triggers.d/powerbutton.conf
|
||||
fi
|
||||
|
||||
# special prepare when Nvidia Jetson Nano
|
||||
@ -742,21 +757,6 @@ if [ "${baseimage}" = "raspios_arm64" ] || [ "${baseimage}" = "debian" ]; then
|
||||
ifconfig wlan0 down
|
||||
fi
|
||||
|
||||
echo -e "\n*** DISABLE BLUETOOTH ***"
|
||||
configFile="/boot/config.txt"
|
||||
disableBT="dtoverlay=disable-bt"
|
||||
disableBTDone=$(grep -c "$disableBT" $configFile)
|
||||
|
||||
if [ "${disableBTDone}" -eq 0 ]; then
|
||||
# disable bluetooth module
|
||||
echo "" | tee -a $configFile
|
||||
echo "# Raspiblitz" | tee -a $configFile
|
||||
echo 'dtoverlay=pi3-disable-bt' | tee -a $configFile
|
||||
echo 'dtoverlay=disable-bt' | tee -a $configFile
|
||||
else
|
||||
echo "disable BT already in $configFile"
|
||||
fi
|
||||
|
||||
# remove bluetooth services
|
||||
systemctl disable bluetooth.service
|
||||
systemctl disable hciuart.service
|
||||
|
@ -35,7 +35,7 @@
|
||||
* The images are built in GitHub actions
|
||||
* To see the downloadable artifacts will need to log in to GitHub
|
||||
* Find the latest successful build of the default amd64 image:
|
||||
https://github.com/raspiblitz/raspiblitz/actions/workflows/arm64-rpi-lean-image.yml?query=workflow%3Aarm64-rpi-lean-image-build+is%3Asuccess
|
||||
https://github.com/raspiblitz/raspiblitz/actions/workflows/arm64-rpi-lean-image.yml?query=workflow%3Aarm64-rpi-lean-image-build+is%3Asuccess+branch%3Adev
|
||||
* unpack the artifact to the same directory
|
||||
```
|
||||
unzip ./raspiblitz-arm64-rpi-image-*.zip
|
||||
|
@ -1,13 +1,5 @@
|
||||
packer {
|
||||
required_version = ">= 1.7.0, < 2.0.0"
|
||||
|
||||
required_plugins {
|
||||
qemu = {
|
||||
source = "github.com/hashicorp/qemu"
|
||||
version = ">= 1.0.0, < 2.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
variable "iso_name" { default = "debian-12.4.0-amd64-netinst.iso" }
|
||||
variable "iso_checksum" { default = "64d727dd5785ae5fcfd3ae8ffbede5f40cca96f1580aaa2820e8b99dae989d94" }
|
||||
|
||||
variable "pack" { default = "lean" }
|
||||
variable "github_user" { default = "raspiblitz" }
|
||||
@ -18,9 +10,6 @@ variable "boot" { default = "uefi" }
|
||||
variable "preseed_file" { default = "preseed.cfg" }
|
||||
variable "hostname" { default = "raspiblitz-amd64" }
|
||||
|
||||
variable "iso_name" { default = "debian-12.2.0-amd64-netinst.iso" }
|
||||
variable "iso_checksum" { default = "23ab444503069d9ef681e3028016250289a33cc7bab079259b73100daee0af66" }
|
||||
|
||||
variable "disk_size" { default = "30000" }
|
||||
variable "memory" { default = "4096" }
|
||||
variable "cpus" { default = "4" }
|
||||
@ -113,3 +102,14 @@ build {
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
packer {
|
||||
required_version = ">= 1.7.0, < 2.0.0"
|
||||
|
||||
required_plugins {
|
||||
qemu = {
|
||||
source = "github.com/hashicorp/qemu"
|
||||
version = ">= 1.0.0, < 2.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
variable "pack" { default = "lean" }
|
||||
variable "github_user" { default = "raspiblitz" }
|
||||
variable "branch" { default = "dev" }
|
||||
variable "image_link" { default = "https://downloads.raspberrypi.org/raspios_arm64/images/raspios_arm64-2023-10-10/2023-10-10-raspios-bookworm-arm64.img.xz" }
|
||||
variable "image_checksum" { default = "1702d6494e8fc1036c39d73d99a5b7e0bfb5352fd2cf35fd940c66ceb37d2c0a" }
|
||||
variable "image_link" { default = "https://downloads.raspberrypi.org/raspios_arm64/images/raspios_arm64-2023-12-06/2023-12-05-raspios-bookworm-arm64.img.xz" }
|
||||
variable "image_checksum" { default = "5c54f0572d61e443a32dfa80aa8d918049814bfc70ab977f2d545eef45f1658e" }
|
||||
|
||||
source "arm" "raspiblitz-arm64-rpi" {
|
||||
file_checksum_type = "sha256"
|
||||
|
@ -204,7 +204,7 @@ Save this password as it will be needed to restore the backup (same as the Passw
|
||||
source $_temp
|
||||
/home/admin/config.scripts/cl.hsmtool.sh seed-force "$CHAIN" "${seedWords}"
|
||||
sudo rm $_temp 2>/dev/null
|
||||
if ! sudo ls /home/bitcoin/.lightning/${CLNETWORK}/hsm_secret; then
|
||||
if ! sudo ls /home/bitcoin/.lightning/${CLNETWORK}/hsm_secret 2>/dev/null; then
|
||||
echo "# There was no hsm_secret created - exiting"
|
||||
exit 15
|
||||
fi
|
||||
|
@ -346,7 +346,7 @@ case $CHOICE in
|
||||
echo
|
||||
echo "Press ENTER when your backup download is done to shutdown."
|
||||
read key
|
||||
/home/admin/config.scripts/blitz.shutdown.sh
|
||||
sudo /home/admin/config.scripts/blitz.shutdown.sh
|
||||
;;
|
||||
RESET-LND)
|
||||
askLNDbackupCopy
|
||||
|
@ -160,7 +160,7 @@ patch()
|
||||
if [ $? -eq 0 ]; then
|
||||
clear
|
||||
echo "REBOOT .."
|
||||
/home/admin/config.scripts/blitz.shutdown.sh reboot
|
||||
sudo /home/admin/config.scripts/blitz.shutdown.sh reboot
|
||||
sleep 8
|
||||
exit 1
|
||||
else
|
||||
@ -269,7 +269,7 @@ Do you really want to update LND now?
|
||||
if [ ${#error} -gt 0 ]; then
|
||||
whiptail --title "ERROR" --msgbox "${error}" 8 30
|
||||
else
|
||||
/home/admin/config.scripts/blitz.shutdown.sh reboot
|
||||
sudo /home/admin/config.scripts/blitz.shutdown.sh reboot
|
||||
sleep 8
|
||||
fi
|
||||
;;
|
||||
@ -293,7 +293,7 @@ Do you really want to update LND now?
|
||||
if [ ${#error} -gt 0 ]; then
|
||||
whiptail --title "ERROR" --msgbox "${error}" 8 30
|
||||
else
|
||||
/home/admin/config.scripts/blitz.shutdown.sh reboot
|
||||
sudo /home/admin/config.scripts/blitz.shutdown.sh reboot
|
||||
sleep 8
|
||||
fi
|
||||
;;
|
||||
@ -418,7 +418,7 @@ Do you really want to update Bitcoin Core now?
|
||||
error=""
|
||||
warn=""
|
||||
sudo -u admin /home/admin/config.scripts/bitcoin.update.sh tested
|
||||
/home/admin/config.scripts/blitz.shutdown.sh reboot
|
||||
sudo /home/admin/config.scripts/blitz.shutdown.sh reboot
|
||||
;;
|
||||
RECKLESS)
|
||||
whiptail --title "UNTESTED Bitcoin Core update to ${bitcoinLatestVersion}" --yes-button "Cancel" \
|
||||
@ -439,11 +439,11 @@ Do you really want to update Bitcoin Core now?
|
||||
if [ ${#error} -gt 0 ]; then
|
||||
whiptail --title "ERROR" --msgbox "${error}" 8 30
|
||||
fi
|
||||
/home/admin/config.scripts/blitz.shutdown.sh reboot
|
||||
sudo /home/admin/config.scripts/blitz.shutdown.sh reboot
|
||||
;;
|
||||
CUSTOM)
|
||||
sudo -u admin /home/admin/config.scripts/bitcoin.update.sh custom
|
||||
/home/admin/config.scripts/blitz.shutdown.sh reboot
|
||||
sudo /home/admin/config.scripts/blitz.shutdown.sh reboot
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
@ -265,6 +265,8 @@ do
|
||||
debuginfo=$(ls -la /var/log/ 2>/dev/null)
|
||||
# dont delete directories - can make services crash
|
||||
sudo rm /var/log/*
|
||||
sudo touch /var/log/auth.log
|
||||
sudo chown root:adm /var/log/auth.log
|
||||
sudo service rsyslog restart
|
||||
/home/admin/config.scripts/blitz.error.sh _background.sh "log-delete" "REPAIR: /var/log/ >5GB" "Logs in /var/log in were bigger then 5GB and got emergency delete to prevent fillup." "${debuginfo}"
|
||||
sleep 10
|
||||
@ -483,8 +485,8 @@ do
|
||||
mkdir -p /home/admin/backups/scb/ 2>/dev/null
|
||||
cp $scbPath $localBackupPath
|
||||
cp $scbPath $localTimestampedPath
|
||||
cp $scbPath /boot/channel.backup
|
||||
echo "OK channel.backup copied to '${localBackupPath}' and '${localTimestampedPath}' and '/boot/channel.backup'"
|
||||
cp $scbPath /boot/firmware/channel.backup
|
||||
echo "OK channel.backup copied to '${localBackupPath}' and '${localTimestampedPath}' and '/boot/firmware/channel.backup'"
|
||||
|
||||
# check if a additional local backup target is set
|
||||
# see ./config.scripts/blitz.backupdevice.sh
|
||||
@ -589,8 +591,8 @@ do
|
||||
mkdir -p /home/admin/backups/er/ 2>/dev/null
|
||||
cp $erPath $localBackupPath
|
||||
cp $erPath $localTimestampedPath
|
||||
cp $erPath /boot/${netprefix}emergency.recover
|
||||
echo "OK emergency.recover copied to '${localBackupPath}' and '${localTimestampedPath}' and '/boot/${netprefix}emergency.recover'"
|
||||
cp $erPath /boot/firmware/${netprefix}emergency.recover
|
||||
echo "OK emergency.recover copied to '${localBackupPath}' and '${localTimestampedPath}' and '/boot/firmware/${netprefix}emergency.recover'"
|
||||
|
||||
# check if a additional local backup target is set
|
||||
# see ./config.scripts/blitz.backupdevice.sh
|
||||
|
@ -127,11 +127,11 @@ source ${configFile} 2>/dev/null
|
||||
######################################
|
||||
# CHECK SD CARD STATE
|
||||
|
||||
# when a file 'stop' is on the sd card boot partition - stop for manual provision
|
||||
flagExists=$(sudo ls /boot/stop | grep -c 'stop')
|
||||
# when a file 'stop' is on the sd card bootfs partition root - stop for manual provision
|
||||
flagExists=$(sudo ls /boot/firmware/stop | grep -c 'stop')
|
||||
if [ "${flagExists}" == "1" ]; then
|
||||
# remove flag
|
||||
sudo rm /boot/stop
|
||||
sudo rm /boot/firmware/stop
|
||||
# set state info
|
||||
/home/admin/_cache.sh set state "stop"
|
||||
/home/admin/_cache.sh set message "stopped for manual provision"
|
||||
@ -230,11 +230,11 @@ systemInitReboot=0
|
||||
################################
|
||||
# FORCED SWITCH TO HDMI
|
||||
# if a file called 'hdmi' gets
|
||||
# placed onto the boot part of
|
||||
# placed onto the bootfs part of
|
||||
# the sd card - switch to hdmi
|
||||
################################
|
||||
|
||||
forceHDMIoutput=$(sudo ls /boot/hdmi* 2>/dev/null | grep -c hdmi)
|
||||
forceHDMIoutput=$(sudo ls /boot/firmware/hdmi* 2>/dev/null | grep -c hdmi)
|
||||
if [ ${forceHDMIoutput} -eq 1 ]; then
|
||||
# delete that file (to prevent loop)
|
||||
sudo rm /boot/hdmi*
|
||||
@ -310,10 +310,10 @@ fi
|
||||
# the sd card - delete old ssh data
|
||||
################################
|
||||
|
||||
sshReset=$(sudo ls /boot/ssh.reset* 2>/dev/null | grep -c reset)
|
||||
sshReset=$(sudo ls /boot/firmware/ssh.reset* 2>/dev/null | grep -c reset)
|
||||
if [ ${sshReset} -eq 1 ]; then
|
||||
# delete that file (to prevent loop)
|
||||
rm /boot/ssh.reset* >> $logFile
|
||||
rm /boot/firmware/ssh.reset* >> $logFile
|
||||
# delete ssh certs
|
||||
echo "SSHRESET switch found ... stopping SSH and deleting old certs" >> $logFile
|
||||
/home/admin/config.scripts/blitz.ssh.sh renew >> $logFile
|
||||
@ -557,7 +557,7 @@ if [ ${isMounted} -eq 0 ]; then
|
||||
|
||||
# check if there is a flag set on sd card boot section to format as btrfs (experimental)
|
||||
filesystem="ext4"
|
||||
flagBTRFS=$(sudo ls /boot/btrfs* 2>/dev/null | grep -c btrfs)
|
||||
flagBTRFS=$(sudo ls /boot/firmware/btrfs* 2>/dev/null | grep -c btrfs)
|
||||
if [ "${flagBTRFS}" != "0" ]; then
|
||||
echo "Found BTRFS flag ---> formatting with experimental BTRFS filesystem" >> ${logFile}
|
||||
filesystem="btrfs"
|
||||
@ -566,7 +566,7 @@ if [ ${isMounted} -eq 0 ]; then
|
||||
# run formatting
|
||||
error=""
|
||||
/home/admin/_cache.sh set state "formathdd"
|
||||
echo "Running Format: (${filesystem}) (${hddCandidate})" >> ${logFile}
|
||||
echo "Running Format: filesystem(${filesystem}) hddCandidate(${hddCandidate})" >> ${logFile}
|
||||
source <(sudo /home/admin/config.scripts/blitz.datadrive.sh format ${filesystem} ${hddCandidate})
|
||||
if [ "${error}" != "" ]; then
|
||||
echo "FAIL ON FORMATTING THE DRIVE:" >> ${logFile}
|
||||
@ -897,8 +897,10 @@ else
|
||||
################################
|
||||
# LND and Blockchain Errors will be still in systemd journals
|
||||
|
||||
# /mnt/hdd/bitcoin/debug.log
|
||||
rm /mnt/hdd/${network}/debug.log 2>/dev/null
|
||||
# limit debug.log to 10MB on start - see #3872
|
||||
if [ $(grep -c "shrinkdebugfile=" < /mnt/hdd/bitcoin/bitcoin.conf) -eq 0 ];then
|
||||
echo "shrinkdebugfile=1" | sudo tee -a /mnt/hdd/bitcoin/bitcoin.conf
|
||||
fi
|
||||
# /mnt/hdd/lnd/logs/bitcoin/mainnet/lnd.log
|
||||
rm /mnt/hdd/lnd/logs/${network}/${chain}net/lnd.log 2>/dev/null
|
||||
# https://github.com/rootzoll/raspiblitz/issues/1700
|
||||
@ -985,7 +987,7 @@ fi
|
||||
# FORCE UASP FLAG
|
||||
####################
|
||||
# if uasp.force flag was set on sd card - now move into raspiblitz.conf
|
||||
if [ -f "/boot/uasp.force" ]; then
|
||||
if [ -f "/boot/firmware/uasp.force" ]; then
|
||||
/home/admin/config.scripts/blitz.conf.sh set forceUasp "on"
|
||||
echo "DONE forceUasp=on recorded in raspiblitz.conf" >> $logFile
|
||||
fi
|
||||
|
@ -120,7 +120,7 @@ function restart() {
|
||||
echo "Command to restart your RaspiBlitz"
|
||||
confirmMsg restart
|
||||
if [ $confirm -eq 1 ]; then
|
||||
/home/admin/config.scripts/blitz.shutdown.sh reboot
|
||||
sudo /home/admin/config.scripts/blitz.shutdown.sh reboot
|
||||
fi
|
||||
}
|
||||
|
||||
@ -220,7 +220,7 @@ function off() {
|
||||
echo "Command to power off your RaspiBlitz"
|
||||
confirmMsg off
|
||||
if [ $confirm -eq 1 ]; then
|
||||
/home/admin/config.scripts/blitz.shutdown.sh
|
||||
sudo /home/admin/config.scripts/blitz.shutdown.sh
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -35,6 +35,6 @@ sudo rm /var/cache/raspiblitz/temp/raspiblitz.setup
|
||||
sudo cp /home/admin/raspiblitz.log /home/admin/raspiblitz.setup.log
|
||||
sudo chmod 640 /home/admin/raspiblitz.setup.log
|
||||
sudo chown root:sudo /home/admin/raspiblitz.setup.log
|
||||
timeout 120 /home/admin/config.scripts/blitz.shutdown.sh reboot finalsetup
|
||||
timeout 120 sudo /home/admin/config.scripts/blitz.shutdown.sh reboot finalsetup
|
||||
# if system has not rebooted yet - force reboot directly
|
||||
sudo shutdown -r now
|
||||
sudo shutdown -r now
|
||||
|
@ -190,6 +190,28 @@ sed -i "s/^setupStep=.*/setupStep=100/g" /home/admin/raspiblitz.info
|
||||
echo "Provisioning BLITZ WEB SERVICE - run config script" >> ${logFile}
|
||||
/home/admin/config.scripts/blitz.web.sh https-on >> ${logFile} 2>&1
|
||||
|
||||
echo "### CHECKING BLITZ-API/FRONT STATUS ###" >> ${logFile}
|
||||
blitzApiInstalled=$(systemctl status blitzapi | grep -c "loaded")
|
||||
echo "# blitzapi(${blitzapi}) blitzApiInstalled(${blitzApiInstalled})"
|
||||
|
||||
# deinstall when not explizit 'on' when blitzapi is installed by fatpack
|
||||
# https://github.com/raspiblitz/raspiblitz/issues/4171#issuecomment-1728302628
|
||||
if [ "${blitzapi}" != "on" ] && [ ${blitzApiInstalled} -gt 0 ]; then
|
||||
echo "blitz_api directory exists & blitzapi is not 'on' - deactivating blitz-api" >> ${logFile}
|
||||
/home/admin/_cache.sh set message "Deactivate API/WebUI"
|
||||
/home/admin/config.scripts/blitz.web.api.sh off >> ${logFile} 2>&1
|
||||
/home/admin/config.scripts/blitz.web.ui.sh off >> ${logFile} 2>&1
|
||||
fi
|
||||
# WebAPI & UI (in case image was not fatpack - but webapi was switchen on)
|
||||
if [ "${blitzapi}" == "on" ] && [ $blitzApiInstalled -eq 0 ]; then
|
||||
echo "Provisioning BlitzAPI - run config script" >> ${logFile}
|
||||
/home/admin/_cache.sh set message "Setup BlitzAPI (takes time)"
|
||||
/home/admin/config.scripts/blitz.web.api.sh on DEFAULT >> ${logFile} 2>&1
|
||||
/home/admin/config.scripts/blitz.web.ui.sh on DEFAULT >> ${logFile} 2>&1
|
||||
else
|
||||
echo "Provisioning BlitzAPI - keep default" >> ${logFile}
|
||||
fi
|
||||
|
||||
echo "### RUNNING PROVISIONING SERVICES ###" >> ${logFile}
|
||||
|
||||
# BITCOIN INTERIMS UPDATE
|
||||
@ -338,17 +360,6 @@ else
|
||||
echo "Provisioning Tor - keep default" >> ${logFile}
|
||||
fi
|
||||
|
||||
# WebAPI & UI (in case image was not fatpack - but webapi was switchen on)
|
||||
blitzApiInstalled=$(systemctl status blitzapi | grep -c "loaded")
|
||||
if [ "${blitzapi}" == "on" ] && [ $blitzApiInstalled -eq 0 ]; then
|
||||
echo "Provisioning BlitzAPI - run config script" >> ${logFile}
|
||||
/home/admin/_cache.sh set message "Setup BlitzAPI (takes time)"
|
||||
/home/admin/config.scripts/blitz.web.api.sh on DEFAULT >> ${logFile} 2>&1
|
||||
/home/admin/config.scripts/blitz.web.ui.sh on DEFAULT >> ${logFile} 2>&1
|
||||
else
|
||||
echo "Provisioning BlitzAPI - keep default" >> ${logFile}
|
||||
fi
|
||||
|
||||
# AUTO PILOT
|
||||
if [ "${autoPilot}" = "on" ]; then
|
||||
echo "Provisioning AUTO PILOT - run config script" >> ${logFile}
|
||||
|
@ -1,3 +1,3 @@
|
||||
# RaspiBlitz Version - always [major].[main].[sub] (sub can be a string like '2rc1')
|
||||
codeVersion="1.10.0"
|
||||
codeVersion="1.11.0rc1"
|
||||
# keep last line with comment
|
@ -1,4 +1,4 @@
|
||||
# Boostrap the RaspiBlitz
|
||||
# Bootstrap the RaspiBlitz
|
||||
# /etc/systemd/system/bootstrap.service
|
||||
|
||||
[Unit]
|
||||
|
@ -11,7 +11,7 @@ server {
|
||||
error_log /var/log/nginx/error_helipad.log;
|
||||
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:3010;
|
||||
proxy_pass http://127.0.0.1:2112;
|
||||
|
||||
include /etc/nginx/snippets/ssl-proxy-params.conf;
|
||||
}
|
||||
|
@ -63,7 +63,7 @@
|
||||
#### basic information about the blockchain
|
||||
#### --> https://developer.bitcoin.org/reference/rpc/getblockchaininfo.html
|
||||
##
|
||||
## Most usefull fields...
|
||||
## Most useful fields...
|
||||
## * blocks
|
||||
## * headers
|
||||
## * verificationprogress
|
||||
@ -79,7 +79,7 @@
|
||||
#### basic information about the mempool
|
||||
#### --> https://developer.bitcoin.org/reference/rpc/getmempoolinfo.html
|
||||
##
|
||||
## Most usefull fields...
|
||||
## Most useful fields...
|
||||
## * loaded (boolean) True if the mempool is fully loaded
|
||||
## * size (numeric) Current tx count
|
||||
## * usage (numeric) Total memory usage for the mempool
|
||||
@ -95,7 +95,7 @@
|
||||
#### information about network traffic, including bytes in, bytes out, and current time window
|
||||
#### --> https://developer.bitcoin.org/reference/rpc/getnettotals.html
|
||||
##
|
||||
## Most usefull fields...
|
||||
## Most useful fields...
|
||||
## * totalbytesrecv
|
||||
## * totalbytessent
|
||||
##
|
||||
@ -136,7 +136,7 @@
|
||||
#### basic information about the LN node
|
||||
#### --> https://api.lightning.community/#getinfo
|
||||
##
|
||||
## Most usefull fields...
|
||||
## Most useful fields...
|
||||
## * block_height
|
||||
## * num_peers
|
||||
## * num_active_channels
|
||||
@ -160,7 +160,7 @@
|
||||
##
|
||||
## * publicIP from /mnt/hdd/raspiblitz.conf
|
||||
## * bitcoind node ip address via: bitcoin-cli getnetworkinfo => "localaddresses"
|
||||
## * lnd ip addess via: lncli getinfo => "uris"
|
||||
## * lnd ip address via: lncli getinfo => "uris"
|
||||
## * IPv6 global from eth0/wlan0
|
||||
## * IPv4 local network address from eth0/wlan0
|
||||
##
|
||||
|
@ -67,6 +67,12 @@ if [ "$1" == "prestart" ]; then
|
||||
echo "# make sure entry(${bitcoinlog_entry}) has the correct value(${bitcoinlog_path})"
|
||||
sed -i "s|^${bitcoinlog_entry}=.*|${bitcoinlog_entry}=${bitcoinlog_path}|g" /mnt/hdd/bitcoin/bitcoin.conf
|
||||
|
||||
# make sure bitcoin debug file exists
|
||||
echo "# make sure bitcoin debug file exists"
|
||||
touch ${bitcoinlog_path}
|
||||
chown bitcoin:bitcoin ${bitcoinlog_path}
|
||||
chmod 600 ${bitcoinlog_path}
|
||||
|
||||
##### STATISTICS #####
|
||||
|
||||
# count startings
|
||||
|
@ -1,58 +1,101 @@
|
||||
#!/bin/bash
|
||||
|
||||
# set version (change if update is available)
|
||||
# https://bitcoincore.org/en/download/
|
||||
bitcoinVersion="26.0"
|
||||
|
||||
|
||||
# command info
|
||||
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ];then
|
||||
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 "bitcoin.install.sh [install|on|off] [signet|testnet|mainnet]"
|
||||
echo "bitcoin.install.sh install"
|
||||
echo "bitcoin.install.sh [on|off] [signet|testnet|mainnet]"
|
||||
echo "Installs Bitcoin Core $bitcoinVersion by default"
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "# Running: bitcoin.install.sh $*"
|
||||
|
||||
# mainnet | testnet | signet
|
||||
CHAIN=${2:-mainnet}
|
||||
if [ "${CHAIN}" != signet ] && [ "${CHAIN}" != testnet ] && [ "${CHAIN}" != mainnet ]; then
|
||||
echo "# ${CHAIN} is not supported"
|
||||
exit 1
|
||||
fi
|
||||
# prefixes for parallel services
|
||||
if [ "${CHAIN}" = testnet ]; then
|
||||
prefix="t"
|
||||
bitcoinprefix="test"
|
||||
zmqprefix=21 # zmqpubrawblock=21332 zmqpubrawtx=21333 zmqpubhashblock=21334
|
||||
rpcprefix=1 # rpcport=18332
|
||||
elif [ ${CHAIN} = signet ]; then
|
||||
prefix="s"
|
||||
bitcoinprefix="signet"
|
||||
zmqprefix=23
|
||||
rpcprefix=3
|
||||
elif [ ${CHAIN} = mainnet ]; then
|
||||
prefix=""
|
||||
bitcoinprefix="main"
|
||||
zmqprefix=28
|
||||
rpcprefix=""
|
||||
fi
|
||||
# bitcoinlogpath
|
||||
if [ ${CHAIN} = signet ]; then
|
||||
bitcoinlogpath="/mnt/hdd/bitcoin/signet/debug.log"
|
||||
elif [ ${CHAIN} = testnet ]; then
|
||||
bitcoinlogpath="/mnt/hdd/bitcoin/testnet3/debug.log"
|
||||
elif [ ${CHAIN} = mainnet ]; then
|
||||
bitcoinlogpath="/mnt/hdd/bitcoin/debug.log"
|
||||
fi
|
||||
|
||||
function addBitcoinAliases {
|
||||
echo "# Add aliases ${prefix}bitcoin-cli, ${prefix}bitcoinlog"
|
||||
sudo -u admin touch /home/admin/_aliases
|
||||
if ! grep "alias ${prefix}bitcoin-cli" /home/admin/_aliases; then
|
||||
echo "alias ${prefix}bitcoin-cli=\"sudo -u bitcoin /usr/local/bin/bitcoin-cli -rpcport=${rpcprefix}8332\"" |
|
||||
sudo tee -a /home/admin/_aliases
|
||||
fi
|
||||
if ! grep "alias ${prefix}bitcoinlog" /home/admin/_aliases; then
|
||||
echo "alias ${prefix}bitcoinlog=\"sudo -u bitcoin tail -n 30 -f ${bitcoinlogpath}\"" |
|
||||
sudo tee -a /home/admin/_aliases
|
||||
fi
|
||||
if ! grep "alias bitcoinconf" /home/admin/_aliases; then
|
||||
echo "alias bitcoinconf=\"sudo nano /mnt/hdd/bitcoin/bitcoin.conf\"" |
|
||||
sudo tee -a /home/admin/_aliases
|
||||
fi
|
||||
sudo chown admin:admin /home/admin/_aliases
|
||||
}
|
||||
|
||||
if [ "$1" = "install" ]; then
|
||||
echo "*** PREPARING BITCOIN ***"
|
||||
|
||||
# set version (change if update is available)
|
||||
# https://bitcoincore.org/en/download/
|
||||
bitcoinVersion="25.1"
|
||||
|
||||
# needed to check code signing
|
||||
# https://github.com/laanwj
|
||||
laanwjPGP="71A3 B167 3540 5025 D447 E8F2 7481 0B01 2346 C9A6"
|
||||
|
||||
# prepare directories
|
||||
sudo rm -rf /home/admin/download
|
||||
sudo -u admin mkdir /home/admin/download
|
||||
cd /home/admin/download || exit 1
|
||||
|
||||
# receive signer key
|
||||
if ! gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-key "71A3 B167 3540 5025 D447 E8F2 7481 0B01 2346 C9A6"
|
||||
then
|
||||
echo "# FAIL # Couldn't download Wladimir J. van der Laan's PGP pubkey"
|
||||
exit 1
|
||||
fi
|
||||
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
|
||||
|
||||
# download signed binary sha256 hash sum file
|
||||
sudo -u admin wget https://bitcoincore.org/bin/bitcoin-core-${bitcoinVersion}/SHA256SUMS
|
||||
sudo -u admin wget --prefer-family=ipv4 --progress=bar:force -O SHA256SUMS https://bitcoincore.org/bin/bitcoin-core-${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
|
||||
|
||||
# download signed binary sha256 hash sum file and check
|
||||
sudo -u admin wget https://bitcoincore.org/bin/bitcoin-core-${bitcoinVersion}/SHA256SUMS.asc
|
||||
verifyResult=$(LANG=en_US.utf8; gpg --verify SHA256SUMS.asc 2>&1)
|
||||
goodSignature=$(echo ${verifyResult} | grep 'Good signature' -c)
|
||||
echo "goodSignature(${goodSignature})"
|
||||
correctKey=$(echo ${verifyResult} | grep "${laanwjPGP}" -c)
|
||||
echo "correctKey(${correctKey})"
|
||||
if [ ${correctKey} -lt 1 ] || [ ${goodSignature} -lt 1 ]; then
|
||||
echo
|
||||
echo "# BUILD FAILED --> PGP Verify not OK / signature(${goodSignature}) verify(${correctKey})"
|
||||
exit 1
|
||||
else
|
||||
if gpg --verify SHA256SUMS.asc; then
|
||||
echo
|
||||
echo "****************************************"
|
||||
echo "OK --> BITCOIN MANIFEST IS CORRECT"
|
||||
echo "****************************************"
|
||||
echo
|
||||
else
|
||||
echo
|
||||
echo "# BUILD FAILED --> the PGP verification failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# bitcoinOSversion
|
||||
@ -74,8 +117,8 @@ if [ "$1" = "install" ]; then
|
||||
sudo -u admin wget --quiet https://bitcoincore.org/bin/bitcoin-core-${bitcoinVersion}/${binaryName}
|
||||
fi
|
||||
if [ ! -f "./${binaryName}" ]; then
|
||||
echo "# FAIL # Could not download the BITCOIN BINARY"
|
||||
exit 1
|
||||
echo "# FAIL # Could not download the BITCOIN BINARY"
|
||||
exit 1
|
||||
else
|
||||
|
||||
# check binary checksum test
|
||||
@ -104,58 +147,21 @@ if [ "$1" = "install" ]; then
|
||||
sudo -u admin 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)
|
||||
if [ ${installed} -lt 1 ]; then
|
||||
if ! sudo /usr/local/bin/bitcoind --version | grep "${bitcoinVersion}"; then
|
||||
echo
|
||||
echo "# BUILD FAILED --> Was not able to install bitcoind version(${bitcoinVersion})"
|
||||
exit 1
|
||||
fi
|
||||
if [ "$(alias | grep -c "alias bitcoinlog")" -eq 0 ];then
|
||||
echo "alias bitcoinlog=\"sudo tail -n 30 -f /mnt/hdd/bitcoin/debug.log\"" | sudo tee -a /home/admin/_aliases
|
||||
fi
|
||||
sudo chown admin:admin /home/admin/_aliases
|
||||
|
||||
addBitcoinAliases
|
||||
|
||||
echo "- Bitcoin install OK"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
||||
# CHAIN is mainnet | testnet | signet
|
||||
CHAIN=$2
|
||||
if [ "${CHAIN}" != signet ]&&[ "${CHAIN}" != testnet ]&&[ "${CHAIN}" != mainnet ];then
|
||||
echo "# ${CHAIN} is not supported"
|
||||
exit 1
|
||||
fi
|
||||
# prefixes for parallel services
|
||||
if [ "${CHAIN}" = testnet ];then
|
||||
prefix="t"
|
||||
bitcoinprefix="test"
|
||||
zmqprefix=21 # zmqpubrawblock=21332 zmqpubrawtx=21333 zmqpubhashblock=21334
|
||||
rpcprefix=1 # rpcport=18332
|
||||
elif [ ${CHAIN} = signet ];then
|
||||
prefix="s"
|
||||
bitcoinprefix="signet"
|
||||
zmqprefix=23
|
||||
rpcprefix=3
|
||||
elif [ ${CHAIN} = mainnet ];then
|
||||
prefix=""
|
||||
bitcoinprefix="main"
|
||||
zmqprefix=28
|
||||
rpcprefix=""
|
||||
fi
|
||||
# bitcoinlogpath
|
||||
if [ ${CHAIN} = signet ]; then
|
||||
bitcoinlogpath="/mnt/hdd/bitcoin/signet/debug.log"
|
||||
elif [ ${CHAIN} = testnet ]; then
|
||||
bitcoinlogpath="/mnt/hdd/bitcoin/testnet3/debug.log"
|
||||
elif [ ${CHAIN} = mainnet ]; then
|
||||
bitcoinlogpath="/mnt/hdd/bitcoin/debug.log"
|
||||
fi
|
||||
|
||||
|
||||
function removeParallelService() {
|
||||
if [ -f "/etc/systemd/system/${prefix}bitcoind.service" ];then
|
||||
if [ ${CHAIN} != mainnet ];then
|
||||
if [ -f "/etc/systemd/system/${prefix}bitcoind.service" ]; then
|
||||
if [ ${CHAIN} != mainnet ]; then
|
||||
/usr/local/bin/bitcoin-cli -${CHAIN} stop
|
||||
else
|
||||
/usr/local/bin/bitcoin-cli stop
|
||||
@ -163,9 +169,9 @@ function removeParallelService() {
|
||||
sudo systemctl stop ${prefix}bitcoind
|
||||
sudo systemctl disable ${prefix}bitcoind
|
||||
sudo rm /etc/systemd/system/${prefix}bitcoind.service 2>/dev/null
|
||||
if [ ${bitcoinprefix} = signet ];then
|
||||
if [ ${bitcoinprefix} = signet ]; then
|
||||
# check for signet service set up by joininbox
|
||||
if [ -f "/etc/systemd/system/signetd.service" ];then
|
||||
if [ -f "/etc/systemd/system/signetd.service" ]; then
|
||||
sudo systemctl stop signetd
|
||||
sudo systemctl disable signetd
|
||||
echo "# The signetd.service is stopped and disabled"
|
||||
@ -178,9 +184,9 @@ function removeParallelService() {
|
||||
function installParallelService() {
|
||||
echo "# Installing Bitcoin Core instance on ${CHAIN}"
|
||||
# bitcoin.conf
|
||||
if [ ! -f /home/bitcoin/.bitcoin/bitcoin.conf ];then
|
||||
if [ ! -f /home/bitcoin/.bitcoin/bitcoin.conf ]; then
|
||||
# add minimal config
|
||||
randomRPCpass=$(< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c8)
|
||||
randomRPCpass=$(tr </dev/urandom -dc _A-Z-a-z-0-9 | head -c8)
|
||||
echo "
|
||||
# bitcoind configuration for ${CHAIN}
|
||||
|
||||
@ -202,41 +208,39 @@ datadir=/mnt/hdd/bitcoin
|
||||
|
||||
# make sure rpcbind is correctly configured
|
||||
sudo sed -i s/^rpcbind=/main.rpcbind=/g /mnt/hdd/bitcoin/bitcoin.conf
|
||||
if [ $(grep -c "rpcallowip" < /mnt/hdd/bitcoin/bitcoin.conf) -gt 0 ];then
|
||||
if [ $(grep -c "${bitcoinprefix}.rpcbind=" < /mnt/hdd/bitcoin/bitcoin.conf) -eq 0 ];then
|
||||
echo "\
|
||||
${bitcoinprefix}.rpcbind=127.0.0.1"|\
|
||||
sudo tee -a /mnt/hdd/bitcoin/bitcoin.conf
|
||||
if grep "rpcallowip" /mnt/hdd/bitcoin/bitcoin.conf; then
|
||||
if ! grep "${bitcoinprefix}.rpcbind=" /mnt/hdd/bitcoin/bitcoin.conf; then
|
||||
echo "${bitcoinprefix}.rpcbind=127.0.0.1" |
|
||||
sudo tee -a /mnt/hdd/bitcoin/bitcoin.conf
|
||||
fi
|
||||
fi
|
||||
|
||||
# correct rpcport entry
|
||||
sudo sed -i s/^rpcport=/main.rpcport=/g /mnt/hdd/bitcoin/bitcoin.conf
|
||||
if [ $(grep -c "${bitcoinprefix}.rpcport" < /mnt/hdd/bitcoin/bitcoin.conf) -eq 0 ];then
|
||||
echo "\
|
||||
${bitcoinprefix}.rpcport=${rpcprefix}8332"|\
|
||||
sudo tee -a /mnt/hdd/bitcoin/bitcoin.conf
|
||||
if ! grep "${bitcoinprefix}.rpcport" /mnt/hdd/bitcoin/bitcoin.conf; then
|
||||
echo "${bitcoinprefix}.rpcport=${rpcprefix}8332" |
|
||||
sudo tee -a /mnt/hdd/bitcoin/bitcoin.conf
|
||||
fi
|
||||
|
||||
# correct zmq entry
|
||||
sudo sed -i s/^zmqpubraw/main.zmqpubraw/g /mnt/hdd/bitcoin/bitcoin.conf
|
||||
if [ $(grep -c "${bitcoinprefix}.zmqpubrawblock" < /mnt/hdd/bitcoin/bitcoin.conf) -eq 0 ];then
|
||||
if ! grep "${bitcoinprefix}.zmqpubrawblock" /mnt/hdd/bitcoin/bitcoin.conf; then
|
||||
echo "\
|
||||
${bitcoinprefix}.zmqpubrawblock=tcp://127.0.0.1:${zmqprefix}332
|
||||
${bitcoinprefix}.zmqpubrawtx=tcp://127.0.0.1:${zmqprefix}333"|\
|
||||
sudo tee -a /mnt/hdd/bitcoin/bitcoin.conf
|
||||
${bitcoinprefix}.zmqpubrawtx=tcp://127.0.0.1:${zmqprefix}333" |
|
||||
sudo tee -a /mnt/hdd/bitcoin/bitcoin.conf
|
||||
fi
|
||||
|
||||
# addnode
|
||||
if [ ${bitcoinprefix} = signet ];then
|
||||
if [ $(grep -c "${bitcoinprefix}.addnode" < /mnt/hdd/bitcoin/bitcoin.conf) -eq 0 ];then
|
||||
if [ ${bitcoinprefix} = signet ]; then
|
||||
if [ $(grep -c "${bitcoinprefix}.addnode" </mnt/hdd/bitcoin/bitcoin.conf) -eq 0 ]; then
|
||||
echo "\
|
||||
signet.addnode=s7fcvn5rblem7tiquhhr7acjdhu7wsawcph7ck44uxyd6sismumemcyd.onion:38333
|
||||
signet.addnode=6megrst422lxzsqvshkqkg6z2zhunywhyrhy3ltezaeyfspfyjdzr3qd.onion:38333
|
||||
signet.addnode=jahtu4veqnvjldtbyxjiibdrltqiiighauai7hmvknwxhptsb4xat4qd.onion:38333
|
||||
signet.addnode=f4kwoin7kk5a5kqpni7yqe25z66ckqu6bv37sqeluon24yne5rodzkqd.onion:38333
|
||||
signet.addnode=nsgyo7begau4yecc46ljfecaykyzszcseapxmtu6adrfagfrrzrlngyd.onion:38333"|\
|
||||
sudo tee -a /mnt/hdd/bitcoin/bitcoin.conf
|
||||
signet.addnode=nsgyo7begau4yecc46ljfecaykyzszcseapxmtu6adrfagfrrzrlngyd.onion:38333" |
|
||||
sudo tee -a /mnt/hdd/bitcoin/bitcoin.conf
|
||||
fi
|
||||
fi
|
||||
|
||||
@ -304,21 +308,7 @@ WantedBy=multi-user.target
|
||||
sudo systemctl enable ${prefix}bitcoind
|
||||
echo "# OK - the bitcoin daemon on ${CHAIN} service is now enabled"
|
||||
|
||||
echo "# Add aliases ${prefix}bitcoin-cli, ${prefix}bitcoind, ${prefix}bitcoinlog"
|
||||
sudo -u admin touch /home/admin/_aliases
|
||||
if [ "$(alias | grep -c "alias ${prefix}bitcoin-cli")" -eq 0 ];then
|
||||
echo "\
|
||||
alias ${prefix}bitcoin-cli=\"sudo -u bitcoin /usr/local/bin/bitcoin-cli\
|
||||
-rpcport=${rpcprefix}8332\"
|
||||
alias ${prefix}bitcoind=\"sudo -u bitcoin /usr/local/bin/bitcoind -${CHAIN}\"\
|
||||
" | sudo tee -a /home/admin/_aliases
|
||||
fi
|
||||
if [ "$(alias | grep -c "alias ${prefix}bitcoinlog")" -eq 0 ];then
|
||||
echo "\
|
||||
alias ${prefix}bitcoinlog=\"sudo -u bitcoin tail -n 30 -f ${bitcoinlogpath}\"\
|
||||
" | sudo tee -a /home/admin/_aliases
|
||||
fi
|
||||
sudo chown admin:admin /home/admin/_aliases
|
||||
addBitcoinAliases
|
||||
|
||||
source <(/home/admin/_cache.sh get state)
|
||||
|
||||
@ -332,7 +322,7 @@ alias ${prefix}bitcoinlog=\"sudo -u bitcoin tail -n 30 -f ${bitcoinlogpath}\"\
|
||||
|
||||
isInstalled=$(systemctl status ${prefix}bitcoind | grep -c active)
|
||||
if [ $isInstalled -gt 0 ]; then
|
||||
echo "# Installed $(bitcoind --version | grep version)"
|
||||
echo "# Installed $(sudo -u bitcoin bitcoind --version | grep version)"
|
||||
echo
|
||||
echo "# Monitor the ${prefix}bitcoind with:"
|
||||
echo "# sudo tail -f /mnt/hdd/bitcoin/${prefix}debug.log"
|
||||
|
@ -7,35 +7,32 @@ if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
|
||||
echo "info -> get actual state and possible actions"
|
||||
echo "tested -> only do a tested update by the RaspiBlitz team"
|
||||
echo "reckless -> the update was not tested by the RaspiBlitz team"
|
||||
echo "custom -> update to a chosen version"
|
||||
echo " the binary will be checked by signature and checksum in all cases"
|
||||
echo "custom <version> <skipverify> -> update to a chosen version"
|
||||
echo " the binary checksum and signatures will be checked in all cases"
|
||||
echo " except when 'skipverify' is used"
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "# Running: bitcoin.update.sh $*"
|
||||
|
||||
# 1. parameter [info|tested|reckless]
|
||||
mode="$1"
|
||||
|
||||
# RECOMMENDED UPDATE BY RASPIBLITZ TEAM (just possible once per sd card update)
|
||||
# comment will be shown as "BEWARE Info" when option is choosen (can be multiple lines)
|
||||
# comment will be shown as "BEWARE Info" when option is chosen (can be multiple lines)
|
||||
bitcoinVersion="" # example: 22.0 .. keep empty if no newer version as sd card build is available
|
||||
|
||||
# needed to check code signing
|
||||
# https://github.com/emzy.gpg
|
||||
fallbackSigner=Emzy
|
||||
|
||||
# GATHER DATA
|
||||
# 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
|
||||
# bitcoinOSversion
|
||||
if [ "$(uname -m | grep -c 'arm')" -gt 0 ]; then
|
||||
bitcoinOSversion="arm-linux-gnueabihf"
|
||||
fi
|
||||
if [ $(uname -m | grep -c 'aarch64') -eq 1 ]; then
|
||||
elif [ "$(uname -m | grep -c 'aarch64')" -gt 0 ]; then
|
||||
bitcoinOSversion="aarch64-linux-gnu"
|
||||
fi
|
||||
if [ $(uname -m | grep -c 'x86_64') -eq 1 ]; then
|
||||
elif [ "$(uname -m | grep -c 'x86_64')" -gt 0 ]; then
|
||||
bitcoinOSversion="x86_64-linux-gnu"
|
||||
fi
|
||||
|
||||
@ -98,16 +95,21 @@ elif [ "${mode}" = "reckless" ]; then
|
||||
pathVersion=${bitcoinVersion}
|
||||
|
||||
elif [ "${mode}" = "custom" ]; then
|
||||
clear
|
||||
echo
|
||||
echo "# Update Bitcoin Core to a chosen version."
|
||||
echo
|
||||
echo "# Input the version you would like to install and press ENTER."
|
||||
echo "# Examples (versions below 22 are not supported):"
|
||||
echo "22.0rc3"
|
||||
echo "24.0.1"
|
||||
echo
|
||||
read bitcoinVersion
|
||||
if [ $# -gt 1 ]; then
|
||||
bitcoinVersion="$2"
|
||||
else
|
||||
clear
|
||||
echo
|
||||
echo "# Update Bitcoin Core 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):"
|
||||
echo "24.0.1"
|
||||
echo "26.0"
|
||||
echo
|
||||
read bitcoinVersion
|
||||
fi
|
||||
|
||||
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}')
|
||||
@ -120,6 +122,9 @@ elif [ "${mode}" = "custom" ]; then
|
||||
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}"
|
||||
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."
|
||||
read key
|
||||
else
|
||||
@ -148,48 +153,34 @@ if [ "${mode}" = "tested" ] || [ "${mode}" = "reckless" ] || [ "${mode}" = "cust
|
||||
mkdir -p "${downloadDir}"
|
||||
cd "${downloadDir}" || exit 1
|
||||
|
||||
# NOTE: this script is run by provision and cannot have user input at this point or it will lock up the provision process
|
||||
# echo "# Enter the github username of a signer. Find the list of signers at: "
|
||||
# echo "https://github.com/bitcoin-core/guix.sigs/tree/main/${pathVersion}"
|
||||
# echo "# Example for Peter Wuille (https://github.com/sipa):"
|
||||
# echo "sipa"
|
||||
# echo "# example for Emzy (https://github.com/Emzy):"
|
||||
# echo "Emzy"
|
||||
# read customSigner
|
||||
# if [ ${#customSigner} -eq 0 ]; then
|
||||
# customSigner=$fallbackSigner
|
||||
# fi
|
||||
customSigner=$fallbackSigner
|
||||
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
|
||||
|
||||
echo "# Download the binary sha256 hash sum file"
|
||||
wget -O all.SHA256SUMS https://raw.githubusercontent.com/bitcoin-core/guix.sigs/main/${pathVersion}/${customSigner}/all.SHA256SUMS
|
||||
echo "# Download signature of the binary sha256 hash sum file"
|
||||
wget -O all.SHA256SUMS.asc https://raw.githubusercontent.com/bitcoin-core/guix.sigs/main/${pathVersion}/${customSigner}/all.SHA256SUMS.asc
|
||||
# download signed binary sha256 hash sum file
|
||||
wget --prefer-family=ipv4 --progress=bar:force -O SHA256SUMS https://bitcoincore.org/bin/bitcoin-core-${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
|
||||
|
||||
echo "# Download PGP pubkey of ${customSigner}"
|
||||
if ! wget -O pubkey.asc https://github.com/${customSigner}.gpg; then
|
||||
echo "# FAIL # Could not down
|
||||
load the PGP pubkey of ${customSigner}"
|
||||
rm pubkey.asc
|
||||
exit 1
|
||||
fi
|
||||
echo "# Import PGP pubkey of ${customSigner}"
|
||||
if ! gpg --import pubkey.asc; then
|
||||
echo "# FAIL # Couldn't import the PGP pubkey of ${customSigner}"
|
||||
rm pubkey.asc
|
||||
exit 1
|
||||
fi
|
||||
rm pubkey.asc
|
||||
|
||||
echo "# Checking PGP signature of the binary sha256 hash sum file"
|
||||
if ! gpg --verify all.SHA256SUMS.asc; then
|
||||
echo
|
||||
echo "# BUILD FAILED --> the signature does not match"
|
||||
exit 1
|
||||
if [ "${mode}" = "custom" ] && [ "$3" = "skipverify" ]; then
|
||||
echo "# skipping signature verification"
|
||||
echo "# display the output of 'gpg --verify SHA256SUMS.asc'"
|
||||
gpg --verify SHA256SUMS.asc
|
||||
else
|
||||
echo
|
||||
echo "# OK --> BITCOIN MANIFEST IS CORRECT"
|
||||
echo
|
||||
if gpg --verify SHA256SUMS.asc; then
|
||||
echo
|
||||
echo "****************************************"
|
||||
echo "OK --> BITCOIN MANIFEST IS CORRECT"
|
||||
echo "****************************************"
|
||||
echo
|
||||
else
|
||||
echo
|
||||
echo "# BUILD FAILED --> the PGP verification failed"
|
||||
echo "# try again or with a different version"
|
||||
echo "# if you want to skip verifying all signatures (and just show them) use the command:"
|
||||
echo "# /home/admin/config.scripts/bonus.bitcoin.sh custom ${bitcoinVersion:-<version>} skipverify"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "# Downloading Bitcoin Core v${bitcoinVersion} for ${bitcoinOSversion} ..."
|
||||
@ -201,9 +192,9 @@ if [ "${mode}" = "tested" ] || [ "${mode}" = "reckless" ] || [ "${mode}" = "cust
|
||||
fi
|
||||
|
||||
echo "# Checking the binary checksum ..."
|
||||
if ! sha256sum -c --ignore-missing all.SHA256SUMS; then
|
||||
if ! sha256sum -c --ignore-missing SHA256SUMS; then
|
||||
# get the sha256 value for the corresponding platform from signed hash sum file
|
||||
bitcoinSHA256=$(grep -i "${binaryName}}" all.SHA256SUMS | 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:"
|
||||
@ -235,7 +226,7 @@ if [ "${mode}" = "tested" ] || [ "${mode}" = "reckless" ] || [ "${mode}" = "cust
|
||||
tar -xvf ${binaryName}
|
||||
sudo install -m 0755 -o root -g root -t /usr/local/bin/ bitcoin-${bitcoinVersion}/bin/*
|
||||
sleep 3
|
||||
if ! bitcoind --version | grep "${bitcoinVersion}"; then
|
||||
if ! sudo /usr/local/bin/bitcoind --version | grep "${bitcoinVersion}"; then
|
||||
echo
|
||||
echo "# BUILD FAILED --> Was not able to install bitcoind version(${bitcoinVersion})"
|
||||
exit 1
|
||||
|
@ -40,7 +40,6 @@ if [ "$1" = "set" ]; then
|
||||
raspiblitzConfExists=$(ls ${configFile} 2>/dev/null | grep -c "${configFile}")
|
||||
if [ ${raspiblitzConfExists} -eq 0 ]; then
|
||||
echo "# blitz.conf.sh $@"
|
||||
echo "# FAIL: missing config file: ${configFile}"
|
||||
exit 3
|
||||
fi
|
||||
|
||||
|
@ -109,10 +109,10 @@ if [ "$1" = "status" ]; then
|
||||
testname=$(echo $line | cut -d " " -f 1 | sed 's/[^a-z0-9]*//g')
|
||||
if [ $(echo $line | grep -c "nvme") = 0 ]; then
|
||||
testdevice=$(echo $testname | sed 's/[^a-z]*//g')
|
||||
testpartition=$(echo $testname | grep -P '[a-z]{3,5}[0-9]{1}')
|
||||
testpartition=$(echo $testname | grep -P '[a-z]{3,5}[0-9]{1}')
|
||||
else
|
||||
testdevice=$(echo $testname | sed 's/\([^p]*\).*/\1/')
|
||||
testpartition=$(echo $testname | grep -P '[p]{1}')
|
||||
testdevice=$(echo $testname | sed 's/\([^p]*\).*/\1/')
|
||||
testpartition=$(echo $testname | grep -P '[p]{1}')
|
||||
fi
|
||||
|
||||
if [ ${#testpartition} -gt 0 ]; then
|
||||
@ -121,8 +121,8 @@ if [ "$1" = "status" ]; then
|
||||
testsize=0
|
||||
fi
|
||||
|
||||
#echo "# line($line)"
|
||||
#echo "# testname(${testname}) testdevice(${testdevice}) testpartition(${testpartition}) testsize(${testsize})"
|
||||
# echo "# line($line)"
|
||||
# echo "# testname(${testname}) testdevice(${testdevice}) testpartition(${testpartition}) testsize(${testsize})"
|
||||
|
||||
# count partitions
|
||||
testpartitioncount=0
|
||||
@ -132,36 +132,37 @@ if [ "$1" = "status" ]; then
|
||||
testpartitioncount=$((testpartitioncount-1))
|
||||
fi
|
||||
|
||||
#echo "# testpartitioncount($testpartitioncount)"
|
||||
#echo "# testpartitioncount(${testpartitioncount})"
|
||||
#echo "# OSPartition(${OSPartition})"
|
||||
#echo "# bootPartition(${bootPartition})"
|
||||
#echo "# hdd(${hdd})"
|
||||
|
||||
if [ "$(uname -m)" = "x86_64" ]; then
|
||||
if [ $(echo "$testpartition" | grep -c "nvme") = 0 ]; then
|
||||
|
||||
# For PC systems
|
||||
|
||||
if [ $(echo "$testpartition" | grep -c "nvme") = 0 ]; then
|
||||
testParentDisk=$(echo "$testpartition" | sed 's/[^a-z]*//g')
|
||||
else
|
||||
else
|
||||
testParentDisk=$(echo "$testpartition" | sed 's/\([^p]*\).*/\1/')
|
||||
fi
|
||||
if [ $(echo "$OSPartition" | grep -c "nvme") = 0 ]; then
|
||||
fi
|
||||
|
||||
if [ $(echo "$OSPartition" | grep -c "nvme") = 0 ]; then
|
||||
OSParentDisk=$(echo "$OSPartition" | sed 's/[^a-z]*//g')
|
||||
else
|
||||
else
|
||||
OSParentDisk=$(echo "$OSPartition" | sed 's/\([^p]*\).*/\1/')
|
||||
fi
|
||||
|
||||
if [ $(echo "$bootPartition" | grep -c "nvme") = 0 ]; then
|
||||
bootParentDisk=$(echo "$bootPartition" | sed 's/[^a-z]*//g')
|
||||
else
|
||||
bootParentDisk=$(echo "$bootPartition" | sed 's/\([^p]*\).*/\1/')
|
||||
fi
|
||||
else
|
||||
bootParentDisk=$(echo "$bootPartition" | sed 's/\([^p]*\).*/\1/')
|
||||
fi
|
||||
|
||||
if [ "$testdevice" != "$OSParentDisk" ] && [ "$testdevice" != "$bootParentDisk" ];then
|
||||
sizeDataPartition=${testsize}
|
||||
hddDataPartition="${testpartition}"
|
||||
hdd="${testdevice}"
|
||||
fi
|
||||
|
||||
elif [ $testpartitioncount -gt 0 ]; then
|
||||
# if a partition was found - make sure to skip the OS and boot partitions
|
||||
# echo "# testpartitioncount > 0"
|
||||
if [ "${testpartition}" != "${OSPartition}" ] && [ "${testpartition}" != "${bootPartition}" ]; then
|
||||
# make sure to use the biggest
|
||||
if [ ${testsize} -gt ${sizeDataPartition} ]; then
|
||||
@ -170,19 +171,34 @@ if [ "$1" = "status" ]; then
|
||||
hdd="${testdevice}"
|
||||
fi
|
||||
fi
|
||||
|
||||
else
|
||||
# default hdd set, when there is no OSpartition and there might be no partitions at all
|
||||
if [ "${OSPartition}" = "root" ] && [ "${hdd}" = "" ] && [ "${testdevice}" != "" ]; then
|
||||
# echo "# else"
|
||||
# echo "# testsize(${testsize})"
|
||||
# echo "# sizeDataPartition(${sizeDataPartition})"
|
||||
|
||||
if [ "${OSPartition}" = "mmcblk0p2" ] && [ "${hdd}" = "" ] && [ "${testdevice}" != "" ]; then
|
||||
# echo "# OSPartition = mmcblk0p2"
|
||||
hdd="${testdevice}"
|
||||
fi
|
||||
# make sure to use the biggest
|
||||
|
||||
# make sure to use the biggest
|
||||
if [ ${testsize} -gt ${sizeDataPartition} ]; then
|
||||
# Partition to be created is smaller than disk so this is not correct (but close)
|
||||
# Partition to be created is smaller than disk so this is not correct (but close)
|
||||
# echo "# testsize > sizeDataPartition"
|
||||
sizeDataPartition=$(fdisk -l /dev/$testdevice | grep GiB | cut -d " " -f 5)
|
||||
hddDataPartition="${testdevice}1"
|
||||
hdd="${testdevice}"
|
||||
fi
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
# echo "# testpartitioncount($testpartitioncount)"
|
||||
# echo "# OSPartition(${OSPartition})"
|
||||
# echo "# bootPartition(${bootPartition})"
|
||||
# echo "# hdd(${hdd})"
|
||||
|
||||
done < .lsblk.tmp
|
||||
rm -f .lsblk.tmp 1>/dev/null 2>/dev/null
|
||||
|
||||
@ -520,7 +536,7 @@ if [ "$1" = "status" ]; then
|
||||
hddAdapterUSAP=0
|
||||
|
||||
# check if force UASP flag is set on sd card
|
||||
if [ -f "/boot/uasp.force" ]; then
|
||||
if [ -f "/boot/firmware/uasp.force" ]; then
|
||||
hddAdapterUSAP=1
|
||||
fi
|
||||
# or UASP is set by config file
|
||||
@ -695,10 +711,13 @@ if [ "$1" = "format" ]; then
|
||||
if [ $wipePartitions -eq 1 ]; then
|
||||
# wipe all partitions and write fresh GPT
|
||||
>&2 echo "# Wiping all partitions (sfdisk/wipefs)"
|
||||
>&2 echo "# sfdisk"
|
||||
sfdisk --delete /dev/${hdd}
|
||||
sleep 4
|
||||
>&2 echo "# wipefs"
|
||||
wipefs -a /dev/${hdd}
|
||||
sleep 4
|
||||
>&2 echo "# lsblk"
|
||||
partitions=$(lsblk | grep -c "─${hdd}")
|
||||
if [ ${partitions} -gt 0 ]; then
|
||||
>&2 echo "# WARNING: partitions are still not clean - try Quick & Dirty"
|
||||
@ -710,6 +729,7 @@ if [ "$1" = "format" ]; then
|
||||
echo "error='partition cleaning failed'"
|
||||
exit 1
|
||||
fi
|
||||
>&2 echo "# parted"
|
||||
parted -s /dev/${hdd} mklabel gpt 1>/dev/null 1>&2
|
||||
sleep 2
|
||||
sync
|
||||
@ -726,9 +746,10 @@ if [ "$1" = "format" ]; then
|
||||
mkdir -p /tmp/ext4 1>/dev/null
|
||||
if [ $ext4IsPartition -eq 0 ]; then
|
||||
# write new EXT4 partition
|
||||
>&2 echo "# Creating the one big partition"
|
||||
parted -s /dev/${hdd} mkpart primary ext4 1024KiB 100% 1>&2
|
||||
>&2 echo "# Creating the one big partition - hdd(${hdd})"
|
||||
parted -s /dev/${hdd} mkpart primary ext4 0% 100% 1>&2
|
||||
sleep 6
|
||||
>&2 echo "# sync"
|
||||
sync
|
||||
# loop until the partition gets available
|
||||
loopdone=0
|
||||
|
@ -457,6 +457,7 @@ sudo /home/admin/config.scripts/blitz.zram.sh status
|
||||
echo
|
||||
|
||||
echo "*** HARDWARE TEST RESULTS ***"
|
||||
sudo vcgencmd get_throttled
|
||||
source <(/home/admin/_cache.sh get system_count_undervoltage)
|
||||
showImproveInfo=0
|
||||
if [ ${#system_count_undervoltage} -gt 0 ]; then
|
||||
|
@ -24,7 +24,7 @@ if [ "${needsExpansion}" == "1" ]; then
|
||||
|
||||
# write a stop file to prevent full bootstrap
|
||||
# after fsexpand reboot
|
||||
touch /boot/stop
|
||||
touch /boot/firmware/stop
|
||||
|
||||
# trigger fsexpand
|
||||
/home/admin/config.scripts/blitz.bootdrive.sh fsexpand
|
||||
|
@ -174,7 +174,7 @@ echo "# checkSumBlitzPyAfter = ${checkSumBlitzPyAfter}"
|
||||
if [ "${checkSumBlitzPyBefore}" = "${checkSumBlitzPyAfter}" ] && [ ${install} -eq 0 ]; then
|
||||
echo "# BlitzPy did not changed."
|
||||
else
|
||||
blitzpy_wheel=$(ls -trR /home/admin/raspiblitz/home.admin/BlitzPy/dist | grep -E "*any.whl" | tail -n 1)
|
||||
blitzpy_wheel=$(ls -trR /home/admin/raspiblitz/home.admin/BlitzPy/dist | grep -E ".*any.whl" | tail -n 1)
|
||||
blitzpy_version=$(echo ${blitzpy_wheel} | grep -oE "([0-9]\.[0-9]\.[0-9])")
|
||||
echo "# BlitzPy changed --> UPDATING to Version ${blitzpy_version}"
|
||||
sudo -H /usr/bin/python -m pip install "/home/admin/raspiblitz/home.admin/BlitzPy/dist/${blitzpy_wheel}" >/dev/null 2>&1
|
||||
|
@ -154,7 +154,7 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
|
||||
confAdd debug i2p /mnt/hdd/bitcoin/bitcoin.conf
|
||||
/home/admin/config.scripts/blitz.conf.sh set i2psam 127.0.0.1:7656 /mnt/hdd/bitcoin/bitcoin.conf noquotes
|
||||
/home/admin/config.scripts/blitz.conf.sh set i2pacceptincoming 1 /mnt/hdd/bitcoin/bitcoin.conf noquotes
|
||||
/home/admin/config.scripts/blitz.conf.sh set onlynet tor /mnt/hdd/bitcoin/bitcoin.conf noquotes
|
||||
/home/admin/config.scripts/blitz.conf.sh set onlynet onion /mnt/hdd/bitcoin/bitcoin.conf noquotes
|
||||
confAdd onlynet i2p /mnt/hdd/bitcoin/bitcoin.conf
|
||||
PASSWORD_B=$(sudo cat /mnt/hdd/bitcoin/bitcoin.conf | grep rpcpassword | cut -c 13-)
|
||||
cat <<EOF | sudo tee /etc/i2pd/i2pd.conf
|
||||
@ -256,7 +256,7 @@ if [ "$1" = "0" ] || [ "$1" = "off" ]; then
|
||||
/home/admin/config.scripts/blitz.conf.sh delete i2psam /mnt/hdd/bitcoin/bitcoin.conf noquotes
|
||||
/home/admin/config.scripts/blitz.conf.sh delete i2pacceptincoming /mnt/hdd/bitcoin/bitcoin.conf noquotes
|
||||
/home/admin/config.scripts/blitz.conf.sh delete onlynet /mnt/hdd/bitcoin/bitcoin.conf noquotes
|
||||
/home/admin/config.scripts/blitz.conf.sh set onlynet tor /mnt/hdd/bitcoin/bitcoin.conf noquotes
|
||||
/home/admin/config.scripts/blitz.conf.sh set onlynet onion /mnt/hdd/bitcoin/bitcoin.conf noquotes
|
||||
|
||||
sudo rm /etc/systemd/system/i2pd.service
|
||||
|
||||
|
@ -510,7 +510,7 @@ if [ "$1" = "export-gui" ]; then
|
||||
read key
|
||||
echo "Shutting down ...."
|
||||
sleep 4
|
||||
/home/admin/config.scripts/blitz.shutdown.sh
|
||||
sudo /home/admin/config.scripts/blitz.shutdown.sh
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
@ -5,18 +5,33 @@
|
||||
# 1) give UI the info that a reboot/shutdown is now happening
|
||||
# 2) shutdown/reboot in a safe way to prevent data corruption
|
||||
|
||||
# check if sudo
|
||||
if [ "$EUID" -ne 0 ]; then
|
||||
echo "Please run as root (with sudo)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
source <(/home/admin/_cache.sh get network)
|
||||
|
||||
# display info
|
||||
echo ""
|
||||
echo "Green activity light stays dark and LCD turns white when shutdown complete."
|
||||
echo
|
||||
rpiModel=$(cat /proc/device-tree/model 2>/dev/null | tr -d '\0')
|
||||
if [ -n "${rpiModel}" ]; then
|
||||
echo "${rpiModel}"
|
||||
if echo ${rpiModel} | grep -Eq 'Raspberry Pi 4'; then
|
||||
echo "When shutdown is complete the green activity light stays dark and the LCD turns white on the ${rpiModel}."
|
||||
elif echo ${rpiModel} | grep -Eq 'Raspberry Pi 5'; then
|
||||
echo "When shutdown is complete the activity light turns red and the LCD turns white on the ${rpiModel}."
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$1" = "reboot" ]; then
|
||||
shutdownParams="-h -r now"
|
||||
echo "It will then reboot again automatically."
|
||||
/home/admin/_cache.sh set state "reboot"
|
||||
/home/admin/_cache.sh set message "$2"
|
||||
else
|
||||
shutdownParams="-h now"
|
||||
shutdownParams="-P -h now"
|
||||
echo "Then wait 5 seconds and disconnect power."
|
||||
/home/admin/_cache.sh set state "shutdown"
|
||||
/home/admin/_cache.sh set message ""
|
||||
@ -26,67 +41,88 @@ fi
|
||||
echo "-----------------------------------------------"
|
||||
sleep 3
|
||||
|
||||
# stopping electRS (if installed)
|
||||
echo "stop electrs - please wait .."
|
||||
sudo timeout 120 systemctl stop electrs 2>/dev/null
|
||||
# general services to stop
|
||||
servicesToStop="electrs fulcrum"
|
||||
for service in ${servicesToStop}; do
|
||||
if systemctl is-active --quiet ${service}; then
|
||||
echo "stopping ${service} - please wait .."
|
||||
timeout 120 systemctl stop ${service}
|
||||
fi
|
||||
done
|
||||
|
||||
# lndg
|
||||
# stopping LNDg (if installed)
|
||||
isInstalled=$(sudo ls /etc/systemd/system/jobs-lndg.service 2>/dev/null | grep -c 'jobs-lndg.service')
|
||||
if ! [ ${isInstalled} -eq 0 ]; then
|
||||
echo "stop LNDg - please wait .."
|
||||
sudo timeout 120 systemctl stop gunicorn.service 2>/dev/null
|
||||
sudo timeout 120 systemctl stop jobs-lndg.timer 2>/dev/null
|
||||
sudo timeout 120 systemctl stop jobs-lndg.service 2>/dev/null
|
||||
sudo timeout 120 systemctl stop rebalancer-lndg.timer 2>/dev/null
|
||||
sudo timeout 120 systemctl stop rebalancer-lndg.service 2>/dev/null
|
||||
sudo timeout 120 systemctl stop htlc-stream-lndg.service 2>/dev/null
|
||||
timeout 120 systemctl stop gunicorn.service 2>/dev/null
|
||||
timeout 120 systemctl stop jobs-lndg.timer 2>/dev/null
|
||||
timeout 120 systemctl stop jobs-lndg.service 2>/dev/null
|
||||
timeout 120 systemctl stop rebalancer-lndg.timer 2>/dev/null
|
||||
timeout 120 systemctl stop rebalancer-lndg.service 2>/dev/null
|
||||
timeout 120 systemctl stop htlc-stream-lndg.service 2>/dev/null
|
||||
fi
|
||||
|
||||
# stopping lightning
|
||||
echo "stop lightning - please wait .."
|
||||
sudo timeout 120 systemctl stop lnd 2>/dev/null
|
||||
sudo timeout 120 systemctl stop lightningd 2>/dev/null
|
||||
sudo timeout 120 systemctl stop tlnd 2>/dev/null
|
||||
sudo timeout 120 systemctl stop tlightningd 2>/dev/null
|
||||
sudo timeout 120 systemctl stop slnd 2>/dev/null
|
||||
sudo timeout 120 systemctl stop slightningd 2>/dev/null
|
||||
# lightning
|
||||
lightningServicesToStop="lnd tlnd slnd lightningd tlightningd slightningd"
|
||||
for service in ${lightningServicesToStop}; do
|
||||
if systemctl is-active --quiet ${service}; then
|
||||
echo "stopping ${service} - please wait .."
|
||||
timeout 120 systemctl stop ${service}
|
||||
fi
|
||||
done
|
||||
|
||||
# bitcoind
|
||||
if [ "${network}" != "" ]; then
|
||||
|
||||
# stopping bitcoin (thru cli)
|
||||
echo "stop ${network}d (1) - please wait .."
|
||||
timeout 10 sudo -u bitcoin ${network}-cli stop 2>/dev/null
|
||||
|
||||
# stopping bitcoind (thru systemd)
|
||||
echo "stop ${network}d (2) - please wait .."
|
||||
sudo timeout 120 systemctl stop ${network}d 2>/dev/null
|
||||
sudo timeout 120 systemctl stop t${network}d 2>/dev/null
|
||||
sudo timeout 120 systemctl stop s${network}d 2>/dev/null
|
||||
timeout 120 systemctl stop ${network}d 2>/dev/null
|
||||
timeout 120 systemctl stop t${network}d 2>/dev/null
|
||||
timeout 120 systemctl stop s${network}d 2>/dev/null
|
||||
sleep 3
|
||||
else
|
||||
echo "skipping stopping layer1 (network=='' in cache)"
|
||||
fi
|
||||
|
||||
# make sure drives are synced before shutdown
|
||||
source <(sudo /home/admin/config.scripts/blitz.datadrive.sh status)
|
||||
source <(/home/admin/config.scripts/blitz.datadrive.sh status)
|
||||
if [ "${isBTRFS}" == "1" ] && [ "${isMounted}" == "1" ]; then
|
||||
echo "STARTING BTRFS RAID DATA CHECK ..."
|
||||
sudo btrfs scrub start /mnt/hdd/
|
||||
btrfs scrub start /mnt/hdd/
|
||||
fi
|
||||
sync
|
||||
|
||||
echo "starting shutdown ..."
|
||||
sudo shutdown ${shutdownParams}
|
||||
# unmount HDD - try to kill all processes first #3114
|
||||
echo "# Killing the processes using /mnt/hdd"
|
||||
processesUsingDisk=$(lsof -t "/mnt/hdd")
|
||||
if [ -n "$processesUsingDisk" ]; then
|
||||
while read -r pid; do
|
||||
processName=$(ps -p $pid -o comm=)
|
||||
echo "# Stop $processName with: 'kill -SIGTERM $pid'"
|
||||
kill -SIGTERM $pid # Send SIGTERM signal
|
||||
sleep 5 # Wait for the process to terminate
|
||||
done <<<"$processesUsingDisk"
|
||||
fi
|
||||
|
||||
# detect missing DBUS
|
||||
echo "# Attempt to unmount /mnt/hdd"
|
||||
umount "/mnt/hdd"
|
||||
|
||||
echo "starting shutdown ..."
|
||||
shutdown ${shutdownParams}
|
||||
|
||||
# detect missing DBUS
|
||||
if [ "${DBUS_SESSION_BUS_ADDRESS}" == "" ]; then
|
||||
echo "WARN: Missing \$DBUS_SESSION_BUS_ADDRESS .. "
|
||||
if [ "$1" = "reboot" ]; then
|
||||
echo "RUNNING FALLBACK REBOOT .. "
|
||||
sudo systemctl --force --force reboot
|
||||
systemctl --force --force reboot
|
||||
else
|
||||
echo "RUNNING FALLBACK SHUTDOWN .. "
|
||||
sudo systemctl --force --force poweroff
|
||||
systemctl --force --force poweroff
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -81,7 +81,7 @@ if [ "$1" = "checkrepair" ]; then
|
||||
# check if sshd host keys are missing / need generation
|
||||
countKeyFiles=$(ls -la /etc/ssh/ssh_host_* 2>/dev/null | grep -c "/etc/ssh/ssh_host")
|
||||
echo "# countKeyFiles(${countKeyFiles})"
|
||||
if [ ${countKeyFiles} -lt 8 ]; then
|
||||
if [ ${countKeyFiles} -lt 6 ]; then
|
||||
echo "# DETECTED: MISSING SSHD KEYFILES --> Generating new ones"
|
||||
/home/admin/config.scripts/blitz.ssh.sh renew
|
||||
fi
|
||||
|
@ -27,7 +27,7 @@ fi
|
||||
if [ "$1" = "info" ]; then
|
||||
|
||||
# check if installed
|
||||
cd /home/blitzapi/blitz_api
|
||||
cd /home/blitzapi/blitz_api 2>/dev/null
|
||||
if [ "$?" != "0" ]; then
|
||||
echo "installed=0"
|
||||
exit 1
|
||||
|
@ -23,7 +23,7 @@ fi
|
||||
if [ "$1" = "info" ]; then
|
||||
|
||||
# check if installed
|
||||
cd /home/blitzapi/blitz_web
|
||||
cd /home/blitzapi/blitz_web 2>/dev/null
|
||||
if [ "$?" != "0" ]; then
|
||||
echo "installed=0"
|
||||
exit 1
|
||||
|
@ -3,22 +3,22 @@
|
||||
# Based on: https://gist.github.com/normandmickey/3f10fc077d15345fb469034e3697d0d0
|
||||
|
||||
# https://github.com/dgarage/NBXplorer/tags
|
||||
NBXplorerVersion="v2.3.67"
|
||||
NBXplorerVersion="v2.4.3"
|
||||
# https://github.com/btcpayserver/btcpayserver/releases
|
||||
BTCPayVersion="v1.11.7"
|
||||
BTCPayVersion="v1.12.3"
|
||||
|
||||
# check who signed the release (person that published release)
|
||||
PGPsigner="nicolasdorier"
|
||||
PGPpubkeyLink="https://keybase.io/nicolasdorier/pgp_keys.asc"
|
||||
PGPpubkeyFingerprint="AB4CFA9895ACA0DBE27F6B346618763EF09186FE"
|
||||
#PGPsigner="nicolasdorier"
|
||||
#PGPpubkeyLink="https://keybase.io/nicolasdorier/pgp_keys.asc"
|
||||
#PGPpubkeyFingerprint="AB4CFA9895ACA0DBE27F6B346618763EF09186FE"
|
||||
# ---
|
||||
#PGPsigner="Kukks"
|
||||
#PGPpubkeyLink="https://github.com/${PGPsigner}.gpg"
|
||||
#PGPpubkeyFingerprint="8E5530D9D1C93097"
|
||||
# ---
|
||||
#PGPsigner="web-flow"
|
||||
#PGPpubkeyLink="https://github.com/web-flow.gpg"
|
||||
#PGPpubkeyFingerprint="4AEE18F83AFDEB23"
|
||||
PGPsigner="web-flow"
|
||||
PGPpubkeyLink="https://github.com/web-flow.gpg"
|
||||
PGPpubkeyFingerprint="4AEE18F83AFDEB23"
|
||||
|
||||
# command info
|
||||
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
|
||||
@ -69,8 +69,8 @@ nomigrateevts=1
|
||||
}
|
||||
|
||||
function BtcPayConfig() {
|
||||
# set thumbprint
|
||||
FINGERPRINT=$(openssl x509 -noout -fingerprint -sha256 -inform pem -in /home/btcpay/.lnd/tls.cert | cut -d"=" -f2)
|
||||
# set thumbprint (remove colons and make lowercase)
|
||||
FINGERPRINT=$(openssl x509 -noout -fingerprint -sha256 -inform pem -in /home/btcpay/.lnd/tls.cert | cut -d"=" -f2 | tr -d ':' | awk '{print tolower($0)}')
|
||||
# set up postgres
|
||||
if sudo -u postgres psql -c '\l' | grep btcpaymainnet; then
|
||||
echo "# btcpaymainnet database already exists"
|
||||
@ -191,7 +191,7 @@ if [ "$1" = "status" ]; then
|
||||
echo "ip2torID='${id}'"
|
||||
echo "ip2torIP='${ip}'"
|
||||
echo "ip2torPort='${port}'"
|
||||
# check for LetsEnryptDomain on IP2TOR
|
||||
# check for LetsEncryptDomain on IP2TOR
|
||||
error=""
|
||||
source <(sudo /home/admin/config.scripts/blitz.subscriptions.letsencrypt.py domain-by-ip $ip)
|
||||
if [ ${#error} -eq 0 ]; then
|
||||
@ -364,23 +364,23 @@ if [ "$1" = "install" ]; then
|
||||
cd /home/btcpay || exit 1
|
||||
|
||||
echo "# install .NET"
|
||||
# https://dotnet.microsoft.com/en-us/download/dotnet/6.0
|
||||
# https://dotnet.microsoft.com/en-us/download/dotnet/8.0
|
||||
sudo apt-get -y install libunwind8 gettext libssl1.0
|
||||
cpu=$(uname -m)
|
||||
if [ "${cpu}" = "aarch64" ]; then
|
||||
binaryVersion="arm64"
|
||||
dotNetdirectLink="https://download.visualstudio.microsoft.com/download/pr/d43345e2-f0d7-4866-b56e-419071f30ebe/68debcece0276e9b25a65ec5798cf07b/dotnet-sdk-6.0.101-linux-arm64.tar.gz"
|
||||
dotNetChecksum="04cd89279f412ae6b11170d1724c6ac42bb5d4fae8352020a1f28511086dd6d6af2106dd48ebe3b39d312a21ee8925115de51979687a9161819a3a29e270a954"
|
||||
dotNetdirectLink="https://download.visualstudio.microsoft.com/download/pr/43e09d57-d0f5-4c92-a75a-b16cfd1983a4/cba02bd4f7c92fb59e22a25573d5a550/dotnet-sdk-8.0.100-linux-arm64.tar.gz"
|
||||
dotNetChecksum="3296d2bc15cc433a0ca13c3da83b93a4e1ba00d4f9f626f5addc60e7e398a7acefa7d3df65273f3d0825df9786e029c89457aea1485507b98a4df2a1193cd765"
|
||||
elif [ "${cpu}" = "x86_64" ]; then
|
||||
binaryVersion="x64"
|
||||
dotNetdirectLink="https://download.visualstudio.microsoft.com/download/pr/ede8a287-3d61-4988-a356-32ff9129079e/bdb47b6b510ed0c4f0b132f7f4ad9d5a/dotnet-sdk-6.0.101-linux-x64.tar.gz"
|
||||
dotNetChecksum="ca21345400bcaceadad6327345f5364e858059cfcbc1759f05d7df7701fec26f1ead297b6928afa01e46db6f84e50770c673146a10b9ff71e4c7f7bc76fbf709"
|
||||
dotNetdirectLink="https://download.visualstudio.microsoft.com/download/pr/5226a5fa-8c0b-474f-b79a-8984ad7c5beb/3113ccbf789c9fd29972835f0f334b7a/dotnet-sdk-8.0.100-linux-x64.tar.gz"
|
||||
dotNetChecksum="13905ea20191e70baeba50b0e9bbe5f752a7c34587878ee104744f9fb453bfe439994d38969722bdae7f60ee047d75dda8636f3ab62659450e9cd4024f38b2a5"
|
||||
else
|
||||
echo "# FAIL! CPU (${cpu}) not supported."
|
||||
echo "result='dotnet cpu not supported'"
|
||||
exit 1
|
||||
fi
|
||||
dotNetName="dotnet-sdk-6.0.101-linux-${binaryVersion}.tar.gz"
|
||||
dotNetName="dotnet-sdk-8.0.100-linux-${binaryVersion}.tar.gz"
|
||||
sudo rm /home/btcpay/${dotnetName} 2>/dev/null
|
||||
sudo -u btcpay wget "${dotNetdirectLink}" -O "${dotNetName}"
|
||||
# check binary is was not manipulated (checksum test)
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
lndVersion=$(lncli -v | cut -d " " -f 3 | cut -d"." -f2)
|
||||
if [ $lndVersion -gt 15 ]; then
|
||||
pinnedVersion="0.11.3"
|
||||
pinnedVersion="0.12.0"
|
||||
else
|
||||
echo "# LND is not installed or is an outdated version (v0.15.x or lower)"
|
||||
lncli -v
|
||||
|
@ -2,7 +2,8 @@
|
||||
|
||||
# https://github.com/lightningequipment/circuitbreaker/releases
|
||||
# https://github.com/lightningequipment/circuitbreaker/commits/master
|
||||
pinnedVersion="e223938d983b756b3893880f3b3bf77e624a9f00"
|
||||
pinnedVersion="60b70d91710efe7227b253e74f0d39ccfc9702c1"
|
||||
|
||||
|
||||
# command info
|
||||
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
|
||||
|
@ -35,8 +35,6 @@ localip=$(hostname -I | awk '{print $1}')
|
||||
if [ "$1" = "status" ]; then
|
||||
|
||||
toraddress=$(sudo cat /mnt/hdd/tor/${USERNAME}/hostname 2>/dev/null)
|
||||
httpPort="3010"
|
||||
httpsPort="3011"
|
||||
|
||||
echo "version='${WEBUI_VERSION}'"
|
||||
echo "installed='${isActive}'"
|
||||
@ -95,7 +93,7 @@ if [ "$1" = "install" ]; then
|
||||
|
||||
# make sure joinmarket is installed
|
||||
sudo /home/admin/config.scripts/bonus.joinmarket.sh install || exit 1
|
||||
|
||||
|
||||
echo "# *** INSTALL JAM (user & code) ***"
|
||||
|
||||
echo "# Creating the ${USERNAME} user"
|
||||
|
@ -192,6 +192,17 @@ if [ -z \"\$TMUX\" ]; then
|
||||
fi
|
||||
" | sudo -u joinmarket tee -a /home/joinmarket/.bashrc
|
||||
|
||||
echo "# Check 'deprecatedrpc=create_bdb' in bitcoin.conf"
|
||||
if ! sudo grep "deprecatedrpc=create_bdb" "/mnt/hdd/bitcoin/bitcoin.conf"; then
|
||||
echo "# Place 'deprecatedrpc=create_bdb' in bitcoin.conf"
|
||||
echo "deprecatedrpc=create_bdb" | sudo tee -a "/mnt/hdd/bitcoin/bitcoin.conf"
|
||||
source <(/home/admin/_cache.sh get state)
|
||||
if [ ${state} != "recovering" ]; then
|
||||
echo "# Restarting bitcoind"
|
||||
sudo systemctl restart bitcoind
|
||||
fi
|
||||
fi
|
||||
|
||||
# make sure the Bitcoin Core wallet is on
|
||||
/home/admin/config.scripts/network.wallet.sh on
|
||||
if [ $(/usr/local/bin/bitcoin-cli -conf=/mnt/hdd/bitcoin/bitcoin.conf listwallets | grep -c wallet.dat) -eq 0 ]; then
|
||||
|
@ -3,7 +3,7 @@
|
||||
# https://github.com/lnbits/lnbits
|
||||
|
||||
# https://github.com/lnbits/lnbits/releases
|
||||
tag="0.10.10"
|
||||
tag="0.11.3"
|
||||
VERSION="${tag}"
|
||||
|
||||
# command info
|
||||
@ -380,7 +380,8 @@ if [ "$1" = "status" ]; then
|
||||
echo "publicIP='${publicIP}'"
|
||||
|
||||
# auth method is to call with a certain useer id
|
||||
admin_userid=$(sudo cat /home/lnbits/lnbits/.super_user)
|
||||
#admin_userid=$(sudo cat /home/lnbits/lnbits/.super_user)
|
||||
admin_userid=$(sudo cat /mnt/hdd/app-data/LNBits/data/.super_user);
|
||||
echo "authMethod='/wallet?usr=${admin_userid}'"
|
||||
|
||||
# check funding source
|
||||
@ -532,7 +533,8 @@ if [ "$1" = "prestart" ]; then
|
||||
fi
|
||||
|
||||
# protect the admin user id if exists
|
||||
chmod 640 /home/lnbits/lnbits/.super_user 2>/dev/null
|
||||
# chmod 640 /home/lnbits/lnbits/.super_user 2>/dev/null
|
||||
chmod 640 /mnt/hdd/app-data/LNBits/data/.super_user 2>/dev/null
|
||||
|
||||
echo "# OK: prestart finished"
|
||||
exit 0 # exit with clean code
|
||||
@ -772,7 +774,7 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
|
||||
|
||||
# config update
|
||||
# example: postgres://<user>:<password>@<host>/<database>
|
||||
sudo bash -c "echo 'LNBITS_DATABASE_URL=postgres://lnbits_user:raspiblitz@localhost:5432/lnbits_db' >> /home/lnbits/lnbits/.env"
|
||||
sudo bash -c "echo 'LNBITS_DATABASE_URL=postgres://postgres:postgres@localhost:5432/lnbits_db' >> /home/lnbits/lnbits/.env"
|
||||
sudo bash -c "echo 'LNBITS_DATA_FOLDER=/mnt/hdd/app-data/LNBits/data' >> /home/lnbits/lnbits/.env"
|
||||
else
|
||||
echo "# install database: SQLite"
|
||||
@ -1164,18 +1166,12 @@ if [ "$1" = "migrate" ]; then
|
||||
# create new backup
|
||||
sudo tar -cf /mnt/hdd/app-data/LNBits_sqlitedb_backup.tar -C /mnt/hdd/app-data LNBits/
|
||||
|
||||
# update to expected tag
|
||||
cd /home/lnbits/lnbits || exit 1
|
||||
|
||||
# remove existent config for database
|
||||
sudo sed -i "/^LNBITS_DATABASE_URL=/d" /home/lnbits/lnbits/.env 2>/dev/null
|
||||
sudo sed -i "/^LNBITS_DATA_FOLDER=/d" /home/lnbits/lnbits/.env 2>/dev/null
|
||||
# restore sqlite database config
|
||||
sudo bash -c "echo 'LNBITS_DATA_FOLDER=/mnt/hdd/app-data/LNBits' >> /home/lnbits/lnbits/.env"
|
||||
|
||||
#sudo -u lnbits git checkout ${tag}
|
||||
sudo -u lnbits git reset --hard 4f05c6c12e284d4a322a9041d19f66d01afa205b # good tested after BIGINT fix (#1135)
|
||||
/home/admin/config.scripts/bonus.lnbits.sh sync || exit 1
|
||||
# stop after sync was done
|
||||
sudo systemctl stop lnbits
|
||||
|
||||
|
@ -81,6 +81,8 @@ if [ "$command" = "1" ] || [ "$command" = "on" ]; then
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
echo "Setting default password for postgres user"
|
||||
sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD 'postgres';"
|
||||
echo "OK PostgreSQL installed"
|
||||
else
|
||||
echo "FAIL - Was not able to install PostgreSQL"
|
||||
@ -96,9 +98,9 @@ if [ "$command" = "0" ] || [ "$command" = "off" ]; then
|
||||
|
||||
# setting value in raspiblitz config
|
||||
echo "*** REMOVING POSTGRESQL ***"
|
||||
sudo apt remove -y postgresql
|
||||
sudo systemctl stop postgresql
|
||||
sudo systemctl disable postgresql
|
||||
sudo apt remove -y postgresql
|
||||
echo "OK PostgreSQL removed."
|
||||
exit 0
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
# https://github.com/Ride-The-Lightning/RTL/releases
|
||||
RTLVERSION="v0.14.0"
|
||||
RTLVERSION="v0.14.1"
|
||||
|
||||
# check and load raspiblitz config
|
||||
# to know which network is running
|
||||
|
@ -43,7 +43,7 @@ function install() {
|
||||
sudo pip3 install --upgrade pip
|
||||
|
||||
# pip dependencies
|
||||
sudo -u bitcoin pip3 install pyln-client tqdm
|
||||
sudo -u bitcoin pip3 install pyln-client tqdm psutil
|
||||
|
||||
# poetry
|
||||
sudo pip3 install poetry || exit 1
|
||||
@ -61,7 +61,7 @@ function install() {
|
||||
echo "# The ${plugin} plugin is already loaded"
|
||||
fi
|
||||
|
||||
# make sure default virtaulenv is used
|
||||
# make sure the default virtualenv is used
|
||||
sudo apt-get remove -y python3-virtualenv 2>/dev/null
|
||||
sudo pip uninstall -y virtualenv 2>/dev/null
|
||||
sudo apt-get install -y python3-virtualenv
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
# https://github.com/ZmnSCPxj/clboss/releases
|
||||
# https://github.com/ZmnSCPxj/clboss/commits/master
|
||||
CLBOSSVERSION="ef5c41612da0d544b0ed1f3e986b4b07126723a1"
|
||||
CLBOSSVERSION="0673c50e7374ea8f5cb7e302f72b7978c6bd1794"
|
||||
|
||||
# command info
|
||||
if [ $# -lt 1 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
|
||||
|
@ -171,7 +171,7 @@ function decryptHSMsecret() {
|
||||
if [ "$1" = "new" ] || [ "$1" = "new-force" ] || [ "$1" = "seed" ] || [ "$1" = "seed-force" ]; then
|
||||
|
||||
# make sure /home/bitcoin/.lightning/bitcoin exists (when lightningd was not run yet)
|
||||
if ! sudo ls /home/bitcoin/.lightning/bitcoin 1>/dev/null; then
|
||||
if ! sudo ls /home/bitcoin/.lightning/bitcoin 2>/dev/null; then
|
||||
echo "# Create /home/bitcoin/.lightning/bitcoin/"
|
||||
sudo -u bitcoin mkdir -p /home/bitcoin/.lightning/bitcoin/
|
||||
fi
|
||||
|
@ -2,21 +2,22 @@
|
||||
# https://lightning.readthedocs.io/
|
||||
|
||||
# https://github.com/ElementsProject/lightning/releases
|
||||
CLVERSION="v23.08.1"
|
||||
CLVERSION="v23.11"
|
||||
|
||||
# install the latest master by using the last commit id
|
||||
# https://github.com/ElementsProject/lightning/commit/master
|
||||
# CLVERSION="063366ed7e3b7cc12a8d1681acc2b639cf07fa23"
|
||||
|
||||
# https://github.com/ElementsProject/lightning/tree/master/contrib/keys
|
||||
# rustyrussell D9200E6CD1ADB8F1 # cdecker A26D6D9FE088ED58 # niftynei BFF0F67810C1EED1 # pneuroth (nepet) C3F21EE387FF4CD2
|
||||
PGPsigner="pneuroth"
|
||||
PGPpubkeyLink="https://raw.githubusercontent.com/ElementsProject/lightning/master/contrib/keys/${PGPsigner}.txt"
|
||||
PGPpubkeyFingerprint="C3F21EE387FF4CD2"
|
||||
|
||||
# PGPsigner="endothermicdev"
|
||||
# PGPpubkeyLink="https://github.com/${PGPsigner}.gpg"
|
||||
# PGPpubkeyFingerprint="8F55EE750D950E3E"
|
||||
|
||||
# https://github.com/ElementsProject/lightning/tree/master/contrib/keys
|
||||
PGPsigner="rustyrussell" # rustyrussell D9200E6CD1ADB8F1 # cdecker A26D6D9FE088ED58 # niftynei BFF0F67810C1EED1 # endothermicdev 8F55EE750D950E3E
|
||||
PGPpubkeyLink="https://raw.githubusercontent.com/ElementsProject/lightning/master/contrib/keys/${PGPsigner}.txt"
|
||||
PGPpubkeyFingerprint="D9200E6CD1ADB8F1"
|
||||
|
||||
# help
|
||||
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
|
||||
echo
|
||||
@ -38,14 +39,18 @@ function installDependencies() {
|
||||
echo "- installDependencies()"
|
||||
# from https://lightning.readthedocs.io/INSTALL.html#to-build-on-ubuntu
|
||||
sudo apt-get install -y \
|
||||
autoconf automake build-essential git libtool libgmp-dev \
|
||||
libsqlite3-dev python3 net-tools zlib1g-dev libsodium-dev \
|
||||
gettext
|
||||
autoconf automake build-essential git libtool libsqlite3-dev \
|
||||
net-tools zlib1g-dev libsodium-dev gettext
|
||||
# additional requirements
|
||||
sudo apt-get install -y postgresql libpq-dev
|
||||
# for clnrest (since v23.11)
|
||||
sudo apt-get install -y python3-json5 python3-flask python3-gunicorn
|
||||
# upgrade pip
|
||||
sudo pip3 install --upgrade pip
|
||||
sudo -u bitcoin pip install mako
|
||||
# for clnrest
|
||||
pip3 install mako
|
||||
cd /home/bitcoin/lightning || exit 1
|
||||
sudo -u bitcoin pip3 install --user -r plugins/clnrest/requirements.txt
|
||||
# poetry
|
||||
sudo pip3 install poetry
|
||||
if ! grep -Eq '^PATH="$HOME/.local/bin:$PATH"' /home/bitcoin/.profile; then
|
||||
@ -56,24 +61,16 @@ function installDependencies() {
|
||||
}
|
||||
|
||||
function buildAndInstallCLbinaries() {
|
||||
echo "- Configuring EXPERIMENTAL_FEATURES enabled"
|
||||
echo "- configure"
|
||||
echo
|
||||
sudo -u bitcoin ./configure
|
||||
echo
|
||||
echo "- Building Core lightning from source"
|
||||
echo "- make"
|
||||
echo
|
||||
sudo -u bitcoin make
|
||||
echo
|
||||
# git reset --hard needed to not show as 'v22.11-modded'
|
||||
sudo -u bitcoin git reset --hard
|
||||
echo "- Install to /usr/local/bin/"
|
||||
echo "- install to /usr/local/bin/"
|
||||
sudo make install || exit 1
|
||||
|
||||
# make sure default virtaulenv is used
|
||||
sudo apt-get remove -y python3-virtualenv 2>/dev/null
|
||||
sudo pip uninstall -y virtualenv 2>/dev/null
|
||||
sudo apt-get install -y python3-virtualenv
|
||||
|
||||
}
|
||||
|
||||
echo "# Running: 'cl.install.sh $*'"
|
||||
@ -269,7 +266,7 @@ if [ "$1" = on ] || [ "$1" = update ] || [ "$1" = testPR ]; then
|
||||
sudo -u bitcoin mkdir /home/bitcoin/.lightning/${CLNETWORK}
|
||||
fi
|
||||
|
||||
if ! sudo ls ${CLCONF}; then
|
||||
if ! sudo ls ${CLCONF} 2>/dev/null; then
|
||||
echo "# Create ${CLCONF}"
|
||||
echo "# lightningd configuration for ${network} ${CHAIN}
|
||||
|
||||
@ -316,7 +313,7 @@ always-use-proxy=true
|
||||
#############
|
||||
echo
|
||||
echo "# Set logrotate for ${netprefix}lightningd"
|
||||
if ! sudo ls /home/bitcoin/.lightning/${CLNETWORK}/cl.log_old; then
|
||||
if ! sudo ls /home/bitcoin/.lightning/${CLNETWORK}/cl.log_old 2>/dev/null; then
|
||||
sudo -u bitcoin mkdir /home/bitcoin/.lightning/${CLNETWORK}/cl.log_old
|
||||
fi
|
||||
echo "\
|
||||
@ -446,6 +443,8 @@ if [ "$1" = "off" ]; then
|
||||
echo "# Removing the binaries"
|
||||
sudo rm -f /usr/local/bin/lightningd
|
||||
sudo rm -f /usr/local/bin/lightning-cli
|
||||
echo "# Removing the source code"
|
||||
sudo rm -rf /home/bitcoin/lightning
|
||||
fi
|
||||
# setting value in the raspiblitz.conf
|
||||
/home/admin/config.scripts/blitz.conf.sh set ${netprefix}cl "off"
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
# https://github.com/Ride-The-Lightning/c-lightning-REST/releases/
|
||||
CLRESTVERSION="v0.10.5"
|
||||
CLRESTVERSION="v0.10.7"
|
||||
|
||||
# help
|
||||
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
|
||||
|
@ -30,7 +30,7 @@ if [ ${#newName} -eq 0 ]; then
|
||||
fi
|
||||
|
||||
# check if cl config file exists
|
||||
if ! sudo ls ${CLCONF}; then
|
||||
if ! sudo ls ${CLCONF} 2>/dev/null; then
|
||||
echo "FAIL - missing ${CLCONF}"
|
||||
exit 1
|
||||
fi
|
||||
|
@ -20,7 +20,7 @@ mode="$1"
|
||||
|
||||
# RECOMMENDED UPDATE BY RASPIBLITZ TEAM
|
||||
# comment will be shown as "BEWARE Info" when option is choosen (can be multiple lines)
|
||||
clUpdateVersion="v23.02.2" # example: v23.02.2 # keep empty if no newer version as sd card build is available
|
||||
clUpdateVersion="" # example: v23.02.2 # keep empty if no newer version as sd card build is available
|
||||
clUpdateComment="Please keep in mind that downgrading afterwards is not tested. Also not all additional apps are fully tested with the this update - but it looked good on first tests."
|
||||
|
||||
# GATHER DATA
|
||||
|
@ -67,7 +67,7 @@ localip_ALL=$(hostname -I | awk '{print $1}')
|
||||
if [ $(isValidIP ${localip_ALL}) -eq 0 ]; then
|
||||
localip_ALL=""
|
||||
fi
|
||||
localip_LAN=$(ip addr 2>/dev/null | grep 'state UP' -A2 | grep -E -v 'docker0|veth' | grep -E -i '(*[eth][0-9]$)*' | tail -n1 | awk '{print $2}' | cut -f1 -d'/')
|
||||
localip_LAN=$(ip addr 2>/dev/null | grep 'state UP' -A2 | grep -E -v 'docker0|veth' | grep -E -i '([eth][0-9]$)*' | tail -n1 | awk '{print $2}' | cut -f1 -d'/')
|
||||
if [ $(isValidIP ${localip_LAN}) -eq 0 ]; then
|
||||
localip_LAN=""
|
||||
fi
|
||||
|
@ -4,7 +4,7 @@
|
||||
## based on https://raspibolt.github.io/raspibolt/raspibolt_40_lnd.html#lightning-lnd
|
||||
## see LND releases: https://github.com/lightningnetwork/lnd/releases
|
||||
### If you change here - make sure to also change interims version in lnd.update.sh #!
|
||||
lndVersion="0.17.2-beta"
|
||||
lndVersion="0.17.3-beta"
|
||||
|
||||
# olaoluwa
|
||||
PGPauthor="roasbeef"
|
||||
|
@ -47,6 +47,8 @@ source <(/home/admin/_cache.sh get \
|
||||
ln_default_ready \
|
||||
ln_default_sync_progress \
|
||||
ln_default_recovery_mode \
|
||||
ln_default_peers \
|
||||
ln_default_sync_chain \
|
||||
system_count_start_lightning \
|
||||
)
|
||||
|
||||
@ -64,6 +66,8 @@ if [ "${lightning}" != "" ] && [ "${ln_default_sync_progress}" == "" ]; then
|
||||
fi
|
||||
elif [ "${ln_default_sync_progress}" == "100.00" ] && [ "${ln_default_recovery_mode}" == "1" ]; then
|
||||
scanProgress="recoverscan"
|
||||
elif [ "${ln_default_sync_progress}" == "100.00" ] && [ "${ln_default_sync_chain}" == "1" ]; then
|
||||
scanProgress="100.00 % ${ln_default_peers} peers"
|
||||
elif [ ${#ln_default_sync_progress} -lt 6 ]; then
|
||||
scanProgress=" ${ln_default_sync_progress} %"
|
||||
else
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
[files]
|
||||
# skip these files
|
||||
extend-exclude = ["*.nodes","*.torrent","*.sh","*.py","*.proto","*.conf","*.json","*.service"]
|
||||
extend-exclude = ["*.nodes","*.torrent","*.sh","*.py","*.proto","*.json"]
|
||||
|
||||
[default.extend-words]
|
||||
# don't correct these false positives
|
||||
|
Loading…
x
Reference in New Issue
Block a user