diff --git a/rootfs/standard/usr/bin/mynode_post_upgrade.sh b/rootfs/standard/usr/bin/mynode_post_upgrade.sh index dd417fda..ec62ba61 100755 --- a/rootfs/standard/usr/bin/mynode_post_upgrade.sh +++ b/rootfs/standard/usr/bin/mynode_post_upgrade.sh @@ -564,6 +564,44 @@ if [ "$CURRENT" != "$LIT_VERSION" ]; then fi fi +# Upgrade Lightning Chantools +echo "Upgrading chantools..." +CHANTOOLS_ARCH="chantools-linux-armv7" +if [ $IS_X86 = 1 ]; then + CHANTOOLS_ARCH="chantools-linux-amd64" +fi +if [ $IS_RASPI4_ARM64 = 1 ]; then + CHANTOOLS_ARCH="chantools-linux-arm64" +fi +CHANTOOLS_UPGRADE_URL=https://github.com/lightninglabs/chantools/releases/download/$CHANTOOLS_VERSION/$CHANTOOLS_ARCH-$CHANTOOLS_VERSION.tar.gz +CURRENT="" +if [ -f $CHANTOOLS_VERSION_FILE ]; then + CURRENT=$(cat $CHANTOOLS_VERSION_FILE) +fi +if [ "$CURRENT" != "$CHANTOOLS_VERSION" ]; then + # Download and install lit + rm -rf /opt/download + mkdir -p /opt/download + cd /opt/download + + wget $CHANTOOLS_UPGRADE_URL + wget $CHANTOOLS_UPGRADE_MANIFEST_URL -O manifest.txt + wget $CHANTOOLS_UPGRADE_MANIFEST_SIG_URL -O manifest.txt.sig + + gpg --verify manifest.txt.sig manifest.txt + if [ $? == 0 ]; then + # Install lit + tar -xzf chantools-*.tar.gz + mv $CHANTOOLS_ARCH-$CHANTOOLS_VERSION chantools + install -m 0755 -o root -g root -t /usr/local/bin chantools/chantools + + # Mark current version + echo $CHANTOOLS_VERSION > $CHANTOOLS_VERSION_FILE + else + echo "ERROR UPGRADING CHANTOOLS - GPG FAILED" + fi +fi + # Install LndHub if should_install_app "lndhub" ; then LNDHUB_UPGRADE_URL=https://github.com/BlueWallet/LndHub/archive/$LNDHUB_VERSION.tar.gz diff --git a/rootfs/standard/usr/bin/mynode_update_latest_version_files.sh b/rootfs/standard/usr/bin/mynode_update_latest_version_files.sh index 08b018db..3dd2c322 100755 --- a/rootfs/standard/usr/bin/mynode_update_latest_version_files.sh +++ b/rootfs/standard/usr/bin/mynode_update_latest_version_files.sh @@ -7,6 +7,7 @@ echo $LND_VERSION > $LND_LATEST_VERSION_FILE echo $LOOP_VERSION > $LOOP_LATEST_VERSION_FILE echo $POOL_VERSION > $POOL_LATEST_VERSION_FILE echo $LIT_VERSION > $LIT_LATEST_VERSION_FILE +echo $CHANTOOLS_VERSION > $CHANTOOLS_LATEST_VERSION_FILE echo $ELECTRS_VERSION > $ELECTRS_LATEST_VERSION_FILE echo $LNDHUB_VERSION > $LNDHUB_LATEST_VERSION_FILE echo $MEMPOOL_VERSION > $MEMPOOL_LATEST_VERSION_FILE diff --git a/rootfs/standard/usr/share/mynode/application_info.json b/rootfs/standard/usr/share/mynode/application_info.json index cd486fb7..fa74ed15 100644 --- a/rootfs/standard/usr/share/mynode/application_info.json +++ b/rootfs/standard/usr/share/mynode/application_info.json @@ -63,6 +63,19 @@ "requires_lightning": true, "show_on_status_page": true }, + { + "name": "Channel Tools", + "short_name": "chantools", + "author": {"name": "Lightning Labs", "link":"https://lightning.engineering/"}, + "website": {"name": "GitHub", "link": "https://github.com/lightninglabs/chantools"}, + "description": "This tool provides helper functions that can be used to rescue funds locked in lnd channels in case lnd itself cannot run properly anymore.", + "category": "lightning_app", + "short_description": "Lightning Diagnostic Tool", + "requires_lightning": true, + "hide_status_icon": true, + "can_enable_disable": false, + "show_on_status_page": true + }, { "name": "Ride the Lightning", "short_name": "rtl", diff --git a/rootfs/standard/usr/share/mynode/mynode_app_versions.sh b/rootfs/standard/usr/share/mynode/mynode_app_versions.sh index f9067528..431dcc41 100644 --- a/rootfs/standard/usr/share/mynode/mynode_app_versions.sh +++ b/rootfs/standard/usr/share/mynode/mynode_app_versions.sh @@ -50,6 +50,13 @@ LIT_LATEST_VERSION_FILE=/home/bitcoin/.mynode/lit_version_latest LIT_UPGRADE_MANIFEST_URL=https://github.com/lightninglabs/lightning-terminal/releases/download/$LIT_VERSION/manifest-$LIT_VERSION.txt LIT_UPGRADE_MANIFEST_SIG_URL=https://github.com/lightninglabs/lightning-terminal/releases/download/$LIT_VERSION/manifest-$LIT_VERSION.sig +CHANTOOLS_VERSION="v0.11.3" +CHANTOOLS_VERSION=$(get_app_version "$CHANTOOLS_VERSION" "chantools") +CHANTOOLS_VERSION_FILE=/home/bitcoin/.mynode/chantools_version +CHANTOOLS_LATEST_VERSION_FILE=/home/bitcoin/.mynode/chantools_version_latest +CHANTOOLS_UPGRADE_MANIFEST_URL=https://github.com/lightninglabs/chantools/releases/download/$CHANTOOLS_VERSION/manifest-$CHANTOOLS_VERSION.txt +CHANTOOLS_UPGRADE_MANIFEST_SIG_URL=https://github.com/lightninglabs/chantools/releases/download/$CHANTOOLS_VERSION/manifest-$CHANTOOLS_VERSION.sig + ELECTRS_VERSION="v0.9.9" ELECTRS_VERSION_FILE=/home/bitcoin/.mynode/electrs_version ELECTRS_LATEST_VERSION_FILE=/home/bitcoin/.mynode/electrs_version_latest diff --git a/rootfs/standard/var/www/mynode/static/images/app_icons/chantools.png b/rootfs/standard/var/www/mynode/static/images/app_icons/chantools.png new file mode 100644 index 00000000..3fa6b3ff Binary files /dev/null and b/rootfs/standard/var/www/mynode/static/images/app_icons/chantools.png differ diff --git a/scripts/check_app_versions.py b/scripts/check_app_versions.py index 2e72c5ac..b4c9b34d 100755 --- a/scripts/check_app_versions.py +++ b/scripts/check_app_versions.py @@ -9,6 +9,7 @@ apps = [{"name": "bitcoin/bitcoin", "current_version_var {"name": "lightninglabs/loop", "current_version_variable": "LOOP_VERSION"}, {"name": "lightninglabs/pool", "current_version_variable": "POOL_VERSION"}, {"name": "lightninglabs/lightning-terminal", "current_version_variable": "LIT_VERSION"}, + {"name": "lightninglabs/chantools", "current_version_variable": "CHANTOOLS_VERSION"}, {"name": "romanz/electrs", "current_version_variable": "ELECTRS_VERSION"}, {"name": "mempool/mempool", "current_version_variable": "MEMPOOL_VERSION"}, {"name": "Ride-The-Lightning/RTL", "current_version_variable": "RTL_VERSION"}, diff --git a/setup/setup_device.sh b/setup/setup_device.sh index d92bae42..0c47fe31 100755 --- a/setup/setup_device.sh +++ b/setup/setup_device.sh @@ -630,6 +630,45 @@ if [ "$CURRENT" != "$LIT_VERSION" ]; then fi cd ~ +# Upgrade Lightning Chantools +echo "Upgrading chantools..." +CHANTOOLS_ARCH="chantools-linux-armv7" +if [ $IS_X86 = 1 ]; then + CHANTOOLS_ARCH="chantools-linux-amd64" +fi +if [ $IS_RASPI4_ARM64 = 1 ]; then + CHANTOOLS_ARCH="chantools-linux-arm64" +fi +CHANTOOLS_UPGRADE_URL=https://github.com/lightninglabs/chantools/releases/download/$CHANTOOLS_VERSION/$CHANTOOLS_ARCH-$CHANTOOLS_VERSION.tar.gz +CURRENT="" +if [ -f $CHANTOOLS_VERSION_FILE ]; then + CURRENT=$(cat $CHANTOOLS_VERSION_FILE) +fi +if [ "$CURRENT" != "$CHANTOOLS_VERSION" ]; then + # Download and install lit + rm -rf /opt/download + mkdir -p /opt/download + cd /opt/download + + wget $CHANTOOLS_UPGRADE_URL + wget $CHANTOOLS_UPGRADE_MANIFEST_URL -O manifest.txt + wget $CHANTOOLS_UPGRADE_MANIFEST_SIG_URL -O manifest.txt.sig + + gpg --verify manifest.txt.sig manifest.txt + if [ $? == 0 ]; then + # Install lit + tar -xzf chantools-*.tar.gz + mv $CHANTOOLS_ARCH-$CHANTOOLS_VERSION chantools + install -m 0755 -o root -g root -t /usr/local/bin chantools/chantools + + # Mark current version + echo $CHANTOOLS_VERSION > $CHANTOOLS_VERSION_FILE + else + echo "ERROR UPGRADING CHANTOOLS - GPG FAILED" + fi +fi +cd ~ + # Setup "install" location for some apps mkdir -p /opt/mynode