From 1c9803d5350d35ef76d792108044878c29b96ea0 Mon Sep 17 00:00:00 2001 From: Luke Childs Date: Tue, 7 Jun 2022 18:10:58 +0700 Subject: [PATCH] Add Core Lightning and RTL for CLN (#7) --- core-lightning-rtl/data/rtl/.gitkeep | 0 core-lightning-rtl/docker-compose.yml | 25 +++++++ core-lightning-rtl/exports.sh | 1 + core-lightning-rtl/umbrel-app.yml | 38 +++++++++++ .../data/c-lightning-rest/certs/.gitkeep | 0 core-lightning/data/lightningd/.gitkeep | 0 core-lightning/docker-compose.yml | 65 +++++++++++++++++++ core-lightning/exports.sh | 12 ++++ core-lightning/torrc.template | 7 ++ core-lightning/umbrel-app.yml | 38 +++++++++++ 10 files changed, 186 insertions(+) create mode 100644 core-lightning-rtl/data/rtl/.gitkeep create mode 100644 core-lightning-rtl/docker-compose.yml create mode 100644 core-lightning-rtl/exports.sh create mode 100644 core-lightning-rtl/umbrel-app.yml create mode 100644 core-lightning/data/c-lightning-rest/certs/.gitkeep create mode 100644 core-lightning/data/lightningd/.gitkeep create mode 100644 core-lightning/docker-compose.yml create mode 100644 core-lightning/exports.sh create mode 100644 core-lightning/torrc.template create mode 100644 core-lightning/umbrel-app.yml diff --git a/core-lightning-rtl/data/rtl/.gitkeep b/core-lightning-rtl/data/rtl/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/core-lightning-rtl/docker-compose.yml b/core-lightning-rtl/docker-compose.yml new file mode 100644 index 0000000..1163b06 --- /dev/null +++ b/core-lightning-rtl/docker-compose.yml @@ -0,0 +1,25 @@ +version: "3.8" + +services: + app_proxy: + environment: + APP_HOST: $APP_CORE_LIGHTNING_RTL_IP + APP_PORT: 3000 + + rtl: + image: shahanafarooqui/rtl:0.12.3 + restart: on-failure + environment: + PORT: 3000 + APP_PASSWORD: $APP_PASSWORD + LN_IMPLEMENTATION: CLT + 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 + volumes: + - "${APP_DATA_DIR}/data/rtl:/data" + - "${APP_CORE_LIGHTNING_REST_CERT_DIR}:/c-lightning-rest/certs" + networks: + default: + ipv4_address: ${APP_CORE_LIGHTNING_RTL_IP} \ No newline at end of file diff --git a/core-lightning-rtl/exports.sh b/core-lightning-rtl/exports.sh new file mode 100644 index 0000000..cfcaa3f --- /dev/null +++ b/core-lightning-rtl/exports.sh @@ -0,0 +1 @@ +export APP_CORE_LIGHTNING_RTL_IP="10.21.21.97" \ No newline at end of file diff --git a/core-lightning-rtl/umbrel-app.yml b/core-lightning-rtl/umbrel-app.yml new file mode 100644 index 0000000..523c790 --- /dev/null +++ b/core-lightning-rtl/umbrel-app.yml @@ -0,0 +1,38 @@ +manifestVersion: 1 +id: core-lightning-rtl +category: Finance +name: Ride The Lightning (Core Lightning) +version: "0.14.2-beta" +tagline: Run your personal Lightning Network node +description: >- + Run your personal Lightning Network node, and join the future of Bitcoin today. + + + The Lightning Network allows ultra cheap and almost instant Bitcoin transactions. + By running a Lightning node, you can not only self-custody your Bitcoin on + Lightning, but also earn sats by routing payments on the network. + + + Connect Zeus Wallet, Zap, or any other wallet that supports lndconnect + to remotely manage and access your node from anywhere. + + + Powered by LND. + + + An official app from Umbrel. +developer: Umbrel +website: https://umbrel.com +dependencies: + - core-lightning +repo: https://github.com/getumbrel/umbrel-lightning +support: https://community.getumbrel.com/c/bitcoin-and-lightning +port: 3100 +gallery: + - 1.jpg + - 2.jpg + - 3.jpg + - 4.jpg + - 5.jpg +path: "" +deterministicPassword: true \ No newline at end of file diff --git a/core-lightning/data/c-lightning-rest/certs/.gitkeep b/core-lightning/data/c-lightning-rest/certs/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/core-lightning/data/lightningd/.gitkeep b/core-lightning/data/lightningd/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/core-lightning/docker-compose.yml b/core-lightning/docker-compose.yml new file mode 100644 index 0000000..fa561d4 --- /dev/null +++ b/core-lightning/docker-compose.yml @@ -0,0 +1,65 @@ +version: "3.8" + +services: + app_proxy: + environment: + APP_HOST: $APP_CORE_LIGHTNING_IP + APP_PORT: $APP_CORE_LIGHTNING_PORT + + app: + image: getumbrel/umbrel-core-lightning:v0.1.0@sha256:8586dc018f82f5663a50a11c785ceeb025f9bf1e547372f18de4a1fb3f3641e2 + command: npm run dev:backend + restart: on-failure + volumes: + - ${APP_DATA_DIR}/data/lightningd:/lightningd + - "${APP_CORE_LIGHTNING_REST_CERT_DIR}:/c-lightning-rest/certs" + environment: + PORT: "${APP_CORE_LIGHTNING_PORT}" + LIGHTNING_HOST: ${APP_CORE_LIGHTNING_DAEMON_IP} + LIGHTNING_NETWORK: bitcoin + LIGHTNING_GRPC_PORT: ${APP_CORE_LIGHTNING_DAEMON_GRPC_PORT} + LIGHTNING_REST_PORT: ${APP_CORE_LIGHTNING_REST_PORT} + LIGHTNING_REST_MACAROON_PATH: "/c-lightning-rest/certs/access.macaroon" + LIGHTNING_REST_HIDDEN_SERVICE: http://${APP_CORE_LIGHTNING_REST_HIDDEN_SERVICE} + LOCAL_HOST: http://${DEVICE_DOMAIN_NAME} + CA_CERT: /lightningd/bitcoin/ca.pem + CLIENT_KEY: /lightningd/bitcoin/client-key.pem + CLIENT_CERT: /lightningd/bitcoin/client.pem + networks: + default: + ipv4_address: ${APP_CORE_LIGHTNING_IP} + + c-lightning-rest: + image: saubyk/c-lightning-rest:0.7.2 + restart: on-failure + ports: + - ${APP_CORE_LIGHTNING_REST_PORT}:${APP_CORE_LIGHTNING_REST_PORT} + environment: + PORT: "${APP_CORE_LIGHTNING_REST_PORT}" + PROTOCOL: "http" + volumes: + - "${APP_CORE_LIGHTNING_REST_CERT_DIR}:/usr/src/app/certs" + - "${APP_DATA_DIR}/data/lightningd:/root/.lightning" + networks: + default: + ipv4_address: ${APP_CORE_LIGHTNING_REST_IP} + + lightningd: + image: elementsproject/lightningd:v0.11.1 + restart: on-failure + ports: + - ${APP_CORE_LIGHTNING_DAEMON_PORT}:9735 + command: + - --bitcoin-rpcconnect=${APP_BITCOIN_NODE_IP} + - --bitcoin-rpcuser=${APP_BITCOIN_RPC_USER} + - --bitcoin-rpcpassword=${APP_BITCOIN_RPC_PASS} + - --proxy=${TOR_PROXY_IP}:${TOR_PROXY_PORT} + - --bind-addr=${APP_CORE_LIGHTNING_DAEMON_IP}:9735 + - --addr=statictor:${TOR_PROXY_IP}:29051 + - --tor-service-password=${TOR_PASSWORD} + - --grpc-port=${APP_CORE_LIGHTNING_DAEMON_GRPC_PORT} + volumes: + - "${APP_DATA_DIR}/data/lightningd:/root/.lightning" + networks: + default: + ipv4_address: ${APP_CORE_LIGHTNING_DAEMON_IP} \ No newline at end of file diff --git a/core-lightning/exports.sh b/core-lightning/exports.sh new file mode 100644 index 0000000..0ed28d7 --- /dev/null +++ b/core-lightning/exports.sh @@ -0,0 +1,12 @@ +export APP_CORE_LIGHTNING_IP="10.21.21.94" +export APP_CORE_LIGHTNING_PORT="2103" +export APP_CORE_LIGHTNING_REST_IP="10.21.21.95" +export APP_CORE_LIGHTNING_REST_PORT="2104" +export APP_CORE_LIGHTNING_DAEMON_IP="10.21.21.96" +export APP_CORE_LIGHTNING_DAEMON_PORT="9736" +export APP_CORE_LIGHTNING_DAEMON_GRPC_PORT="2105" + +export APP_CORE_LIGHTNING_REST_CERT_DIR="${EXPORTS_APP_DIR}/data/c-lightning-rest/certs" + +rest_hidden_service_file="${EXPORTS_TOR_DATA_DIR}/app-${EXPORTS_APP_ID}-rest/hostname" +export APP_CORE_LIGHTNING_REST_HIDDEN_SERVICE="$(cat "${rest_hidden_service_file}" 2>/dev/null || echo "notyetset.onion")" \ No newline at end of file diff --git a/core-lightning/torrc.template b/core-lightning/torrc.template new file mode 100644 index 0000000..7aa070d --- /dev/null +++ b/core-lightning/torrc.template @@ -0,0 +1,7 @@ +# Core Lightning Frontend Hidden Service +HiddenServiceDir /data/app-$APP_ID +HiddenServicePort 80 $APP_PROXY_HOSTNAME:$APP_PROXY_PORT + +# Core Lightning REST Hidden Service +HiddenServiceDir /data/app-$APP_ID-rest +HiddenServicePort $APP_CORE_LIGHTNING_REST_PORT $APP_CORE_LIGHTNING_REST_IP:$APP_CORE_LIGHTNING_REST_PORT \ No newline at end of file diff --git a/core-lightning/umbrel-app.yml b/core-lightning/umbrel-app.yml new file mode 100644 index 0000000..bcbdbb0 --- /dev/null +++ b/core-lightning/umbrel-app.yml @@ -0,0 +1,38 @@ +manifestVersion: 1 +id: core-lightning +category: Finance +name: Core Lightning +version: "0.14.2-beta" +tagline: Run your personal Lightning Network node +description: >- + Run your personal Lightning Network node, and join the future of Bitcoin today. + + + The Lightning Network allows ultra cheap and almost instant Bitcoin transactions. + By running a Lightning node, you can not only self-custody your Bitcoin on + Lightning, but also earn sats by routing payments on the network. + + + Connect Zeus Wallet, Zap, or any other wallet that supports lndconnect + to remotely manage and access your node from anywhere. + + + Powered by LND. + + + An official app from Umbrel. +developer: Umbrel +website: https://umbrel.com +dependencies: + - bitcoin +repo: https://github.com/getumbrel/umbrel-lightning +support: https://community.getumbrel.com/c/bitcoin-and-lightning +port: 2103 +gallery: + - 1.jpg + - 2.jpg + - 3.jpg + - 4.jpg + - 5.jpg +path: "" +defaultPassword: "" \ No newline at end of file