From 11b019c6f256f4b2a198a008861211750bdfc0d1 Mon Sep 17 00:00:00 2001 From: ShahanaFarooqui Date: Mon, 8 Jul 2024 18:07:27 -0700 Subject: [PATCH] Update Core Lightning to v24.05 and RTL(CLN) to v0.15.2 (#1155) Co-authored-by: nmfretz --- core-lightning-rtl/data/rtl/RTL-Config.json | 25 +++++++ core-lightning-rtl/docker-compose.yml | 16 ++-- core-lightning-rtl/exports.sh | 17 +++++ core-lightning-rtl/hooks/pre-start | 40 ++++++++++ core-lightning-rtl/umbrel-app.yml | 16 ++-- core-lightning/docker-compose.yml | 5 +- core-lightning/exports.sh | 2 +- core-lightning/umbrel-app.yml | 82 +++------------------ 8 files changed, 117 insertions(+), 86 deletions(-) create mode 100644 core-lightning-rtl/data/rtl/RTL-Config.json create mode 100644 core-lightning-rtl/exports.sh create mode 100755 core-lightning-rtl/hooks/pre-start diff --git a/core-lightning-rtl/data/rtl/RTL-Config.json b/core-lightning-rtl/data/rtl/RTL-Config.json new file mode 100644 index 00000000..e3d3e737 --- /dev/null +++ b/core-lightning-rtl/data/rtl/RTL-Config.json @@ -0,0 +1,25 @@ +{ + "multiPass": "$APP_PASSWORD", + "defaultNodeIndex": 1, + "SSO": { + "rtlSSO": 0, + "rtlCookiePath": "", + "logoutRedirectLink": "" + }, + "nodes": [ + { + "index": 1, + "lnNode": "CLN Umbrel", + "authentication": { + "configPath": "" + }, + "settings": { + "userPersona": "MERCHANT", + "themeMode": "NIGHT", + "themeColor": "YELLOW", + "enableLogging": true, + "fiatConversion": true + } + } + ] +} \ No newline at end of file diff --git a/core-lightning-rtl/docker-compose.yml b/core-lightning-rtl/docker-compose.yml index 73774326..f9508ae0 100644 --- a/core-lightning-rtl/docker-compose.yml +++ b/core-lightning-rtl/docker-compose.yml @@ -7,16 +7,18 @@ services: APP_PORT: 3000 web: - image: shahanafarooqui/rtl:0.14.1@sha256:88bbf2dac4a5eedd0b692e97bc6c50a5266f44aff8215770ea2fc4eb7495e41e + image: shahanafarooqui/rtl:v0.15.2@sha256:e2c40d04821a1a6e9bcb55b4276c428c6c416ab1c33b4efd256366430234ea6a restart: on-failure environment: PORT: 3000 APP_PASSWORD: $APP_PASSWORD - LN_IMPLEMENTATION: CLN - LN_SERVER_URL: http://${APP_CORE_LIGHTNING_REST_IP}:${APP_CORE_LIGHTNING_REST_PORT}/v1 - MACAROON_PATH: /c-lightning-rest/certs - RTL_CONFIG_PATH: /data/ - RTL_COOKIE_PATH: /data/.cookie + LN_IMPLEMENTATION: "CLN" + lnImplementation: "CLN" + LN_SERVER_URL: "https://$APP_CORE_LIGHTNING_DAEMON_IP:$CORE_LIGHTNING_REST_PORT" + RUNE_PATH: "/root/.lightning/.commando-env" + RTL_CONFIG_PATH: "/data" + RTL_COOKIE_PATH: "/data/.cookie" + BLOCK_EXPLORER_URL: "${APP_CORE_RTL_BLOCK_EXPLORER_URL}" volumes: - "${APP_DATA_DIR}/data/rtl:/data" - - "${APP_CORE_LIGHTNING_REST_CERT_DIR}:/c-lightning-rest/certs" + - "${APP_CORE_LIGHTNING_DATA_DIR}:/root/.lightning:ro" diff --git a/core-lightning-rtl/exports.sh b/core-lightning-rtl/exports.sh new file mode 100644 index 00000000..670d6b3a --- /dev/null +++ b/core-lightning-rtl/exports.sh @@ -0,0 +1,17 @@ +# Dynamically export the block explorer URL based on what network the Bitcoin node is running on + +BLOCK_EXPLORER_URL="https://mempool.space" + +# TODO: check for umbrelOS Mempool app and use local URL if installed +# e.g., "${UMBREL_ROOT}/scripts/app" ls-installed | grep --quiet 'mempool' +# RTL would need a way to dynamically construct the URL for the local Mempool app +# e.g., localExplorerUrl = `${window.location.protocol}//${window.location.hostname}:${LOCAL_MEMPOOL_PORT}`; + +# Append APP_BITCOIN_NETWORK to the URL if it is not mainnet (e.g., https://mempool.space/testnet) +if [[ "${APP_BITCOIN_NETWORK}" != "mainnet" ]]; then + echo "Bitcoin is running on ${APP_BITCOIN_NETWORK}. Appending ${APP_BITCOIN_NETWORK} to the block explorer URL." + BLOCK_EXPLORER_URL="${BLOCK_EXPLORER_URL}/${APP_BITCOIN_NETWORK}" + echo "BLOCK_EXPLORER_URL: ${BLOCK_EXPLORER_URL}" +fi + +export APP_CORE_RTL_BLOCK_EXPLORER_URL="${BLOCK_EXPLORER_URL}" \ No newline at end of file diff --git a/core-lightning-rtl/hooks/pre-start b/core-lightning-rtl/hooks/pre-start new file mode 100755 index 00000000..f43a6db1 --- /dev/null +++ b/core-lightning-rtl/hooks/pre-start @@ -0,0 +1,40 @@ +#!/usr/bin/env bash + +# This pre-start script ensures that legacy Core-Lightning-RTL installs receive the default RTL-Config.json file on update. + +APP_DATA_DIR="$(readlink -f "$(dirname "${BASH_SOURCE[0]}")/..")" +RTL_CONFIG_FILE="${APP_DATA_DIR}/data/rtl/RTL-Config.json" + +# We check if the RTL config file does not exist or if it exists and lnImplementation is set to "LND", which tells us that this is a legacy RTL install that needs to be modified. +if [ ! -f "${RTL_CONFIG_FILE}" ] || jq -e '.nodes[] | select(.lnImplementation == "LND")' "${RTL_CONFIG_FILE}" >/dev/null 2>&1; then + echo "Creating a default configuration file for RTL." + # We overwrite/create the RTL configuration file with settings for CLN Umbrel + # RTL-Config.json is owned by root + cat >"${RTL_CONFIG_FILE}" <- This version of RTL is specifically configured to use your Core Lightning node. @@ -44,11 +44,15 @@ gallery: path: "" deterministicPassword: true releaseNotes: >- - - Bug fix to support forked core lightning versions on BTCPayserver - - - Default onchain address type is now P2TR (dependent on c-lightning-rest v0.10.7) + ⚠️ This version of Ride The Lightning is compatible with Core Lightning v24.05 and above. Please update the Core Lightning app to the latest version in the Umbrel App Store before updating Ride The Lightning. + If you have already updated Ride The Lightning, then simply restart the Ride The Lightning app after updating Core Lightning to the latest version. - - and more! + + - Integration with mempool.space api to display prevailing fee rates on various channel open/close modals + + - Links enabled for viewing transactions on mempool.space from modals of on-chain transactions and channel info + + - Added a new config param blockExplorerUrl (-e BLOCK_EXPLORER_URL) to customize for a local/testnet instances of mempool.space Full release notes can be found here: https://github.com/Ride-The-Lightning/RTL/releases diff --git a/core-lightning/docker-compose.yml b/core-lightning/docker-compose.yml index 413bc2b5..f86207a7 100644 --- a/core-lightning/docker-compose.yml +++ b/core-lightning/docker-compose.yml @@ -55,11 +55,12 @@ services: ipv4_address: ${APP_CORE_LIGHTNING_REST_IP} lightningd: - image: elementsproject/lightningd:v24.02.2@sha256:131e2ce65c3b051e240a294dccb61b565d3909efc5c23b15d8240e014a34f866 + image: elementsproject/lightningd:v24.05@sha256:fc02cfbf0921ab731d8b680db9d1f85b7dbb3b57db596c6dd400659678e5770b restart: on-failure ports: - ${APP_CORE_LIGHTNING_DAEMON_PORT}:9735 - ${APP_CORE_LIGHTNING_WEBSOCKET_PORT}:${APP_CORE_LIGHTNING_WEBSOCKET_PORT} + - ${CORE_LIGHTNING_REST_PORT}:${CORE_LIGHTNING_REST_PORT} command: - --bitcoin-rpcconnect=${APP_BITCOIN_NODE_IP} - --bitcoin-rpcuser=${APP_BITCOIN_RPC_USER} @@ -75,6 +76,8 @@ services: - --database-upgrade=true - --experimental-offers - --grpc-port=${APP_CORE_LIGHTNING_DAEMON_GRPC_PORT} + - --clnrest-host=${APP_CORE_LIGHTNING_DAEMON_IP} + - --clnrest-port=${CORE_LIGHTNING_REST_PORT} volumes: - "${APP_CORE_LIGHTNING_DATA_DIR}:${CORE_LIGHTNING_PATH}" networks: diff --git a/core-lightning/exports.sh b/core-lightning/exports.sh index 1074a850..08791959 100644 --- a/core-lightning/exports.sh +++ b/core-lightning/exports.sh @@ -7,7 +7,7 @@ export APP_CORE_LIGHTNING_DAEMON_PORT="9736" export APP_CORE_LIGHTNING_DAEMON_GRPC_PORT="2105" export APP_CORE_LIGHTNING_WEBSOCKET_PORT="2106" export APP_CORE_LIGHTNING_DATA_DIR="${EXPORTS_APP_DIR}/data/lightningd" - +export CORE_LIGHTNING_REST_PORT="2107" export APP_CORE_LIGHTNING_REST_CERT_DIR="${EXPORTS_APP_DIR}/data/c-lightning-rest/certs" diff --git a/core-lightning/umbrel-app.yml b/core-lightning/umbrel-app.yml index 13fa81b8..98ec849f 100644 --- a/core-lightning/umbrel-app.yml +++ b/core-lightning/umbrel-app.yml @@ -2,7 +2,7 @@ manifestVersion: 1.1 id: core-lightning category: bitcoin name: Core Lightning -version: "24.02.2" +version: "24.05" tagline: Run your personal Core Lightning node description: >- Get started with the Lightning network today with Core Lightning - a @@ -32,84 +32,24 @@ defaultPassword: "" submitter: Blockstream submission: https://github.com/getumbrel/umbrel-apps/pull/475 releaseNotes: >- - This updates cln-application to v0.0.5, and lightningd to v24.02.2. + This updates lightningd to v24.05. If you are running the Ride The Lightning app, please update it to the latest version in the Umbrel App Store after updating Core Lightning to maintain compatibility. - cln-application: - - - bug fix for opening channel - - - fixed message on the empty transactions channel card - - - bug fix for RC version compatibility check - - - added gRPC options on connect wallet - - - listpeers no longer returns channel, updated the endpoint to listpeerchannels - - - Full cln-application release notes are available at https://github.com/ElementsProject/cln-application/releases/tag/v0.0.4 - - - c-lightning-REST v0.10.5: - - - plugin.js renamed to clrest.js (required for reckless plugin manager) + lightningd v24.05: - - allow an option to specify an IP address to bind with the server + - New rune restrictions can now be applied to invoices with the pinv restriction. + + - Stability fixes to gossip and anchor channel spends. - - bug fix for error on generating new certificates + - Increased file descriptor limits for large nodes. - - bug fix for websocket notifications + - Pruned node operation is better supported by bcli with more robust block fetching. - - setchannelfee rpc has been replaced by setchannel (no impact to the developers as REST API signature remains unchanged) + - Pay can now pay part of an invoice with the partial_msat parameter. Get someone else to pay the remainder. - - fixed the issue of server failing to initialize if IPV6 is disabled + - Check can now be used to validate setconfig settings and values. It can also check for approval by the hsmd of keysend payments. - - pay api updated with the latest params - - - the msat purge - - - new API endpoint for listpeerchannels rpc - - - issue in the remote balance calculation fixed - - - issue in the pending balance calculation fixed - - - version compatibility check to address BTCPayserver forked version - - - all available filtering options (invoice, payment hash & offer) for listInvoices api - - - all CLN filtering options (payment hash & status) for listPays and listPayments apis - - - Full c-lightning-REST release notes are available at https://github.com/Ride-The-Lightning/c-lightning-REST/releases - - - lightningd v24.02.2: - - - pay route algorithm doesn't bias against our own "expensive" channels any more - - - pay route algorithm fixed and refined to balance fees and capacity far better - - - prevents repeating the preapproveinvoice check - - - gossip feature bit deprecation for LDK compatibility fix - - - renepay bugfix with situation htlcmax=htlcmin - - - recover plugin can now detect dataloss and guide you through the recovery process, making emergency recoveries less stressful - - - logic of the anchor channels has been overhauled and channel fundings and closing should now be more flexible and reliable - - - dual-funding has been merged into the Lightning Specification! This is a major milestone for more efficient channel management - - - gossip_store file can now be shared with others, since it no longer contains local unpublished gossip - - - optimizations in the way we process blocks means that we can sync with the blockchain 50% faster than before - - - new --no-reconnect-private flag, which tells lightningd not to reconnect private peers. This is useful for service-providers and LSPs if the majority of peers is flaky - - - newest version of the splicing proposal was implemented + - Offers will now make an outgoing connection if necessary to reply to an invoice request. Full lightningd release notes are available at https://github.com/ElementsProject/lightning/releases