From 74634931aa7806c2d4884874b61054e8b82ca936 Mon Sep 17 00:00:00 2001 From: Lakshya Singh Date: Tue, 11 Jun 2024 22:47:30 +0530 Subject: [PATCH 1/2] cln: add summars and monitor plugin remove summary plugin archived update plugin repo to latest cln healthcheck don't use plugins rely to getinfo command Signed-off-by: Lakshya Singh --- .env | 4 ++-- lightningd/Dockerfile | 11 +++++++++-- lightningd/healthcheck.sh | 2 +- lightningd/regtest-config | 5 +++-- lightningd/testnet-config | 5 +++-- 5 files changed, 18 insertions(+), 9 deletions(-) diff --git a/.env b/.env index 96af618..b704cee 100644 --- a/.env +++ b/.env @@ -7,9 +7,9 @@ CORE_LIGHTNING_GIT_HASH=a2a136fe3ebef1d028d1e20ebf1f987b8c05bbf8 # clboss version v0.13.1 CLBOSS_REPO=https://github.com/ZmnSCPxj/clboss.git CLBOSS_GIT_HASH=e4f15b6aeccc0548b8c80f7948d2265111c4e9c5 -# cln plugins +# cln plugins (2024-06-06 17:02:52 +0200) CLN_PLUGINS_REPO=https://github.com/lightningd/plugins.git -CLN_PLUGINS_GIT_HASH=a525e6c42033a6270c81065a559301ceb2a761fa +CLN_PLUGINS_GIT_HASH=de0c7af343df25e82536233ac248ef46efea8670 # txoo version 0.6.4 TXOO_REPO=https://gitlab.com/lightning-signer/txoo.git TXOO_GIT_HASH=6f0718e3f2b9406df5e3cd73306f473199141da0 diff --git a/lightningd/Dockerfile b/lightningd/Dockerfile index c491fe9..56ac767 100644 --- a/lightningd/Dockerfile +++ b/lightningd/Dockerfile @@ -44,7 +44,13 @@ ARG CLN_PLUGINS_GIT_HASH \ CLN_PLUGINS_REPO RUN git clone $CLN_PLUGINS_REPO RUN cd plugins && \ - git checkout $CLN_PLUGINS_GIT_HASH + git checkout $CLN_PLUGINS_GIT_HASH && \ + git submodule update --init --recursive + +# Build summars plugin +RUN cd plugins/summars && \ + cargo install --locked --path . --bin summars --profile release --root /usr/local/ && \ + cargo clean FROM --platform=${TARGETPLATFORM:-${BUILDPLATFORM:-linux/amd64}} alpine:3.18 as clboss_builder @@ -134,7 +140,8 @@ COPY --from=builder /usr/libexec/c-lightning /usr/libexec/c-lightning COPY --from=builder /usr/share/man/man8 /usr/share/man/man8 COPY --from=builder /usr/share/doc/c-lightning /usr/share/doc/c-lightning COPY --from=clboss_builder /usr/bin/clboss /usr/bin/clboss -COPY --from=builder /build/plugins/archived/summary /usr/local/src/plugins/summary +COPY --from=builder /build/plugins/monitor/monitor.py /usr/local/src/plugins/monitor.py +COPY --from=builder /usr/local/bin/summars /usr/local/src/plugins/summars COPY --from=vls_builder /usr/local/bin/remote_hsmd_socket /usr/libexec/c-lightning/remote_hsmd_socket RUN addgroup -S lightning && adduser -S lightning -G lightning && \ diff --git a/lightningd/healthcheck.sh b/lightningd/healthcheck.sh index 3766c35..a53969a 100755 --- a/lightningd/healthcheck.sh +++ b/lightningd/healthcheck.sh @@ -2,4 +2,4 @@ set -ex -lightning-cli --network $VLS_NETWORK summary +lightning-cli --network $VLS_NETWORK getinfo diff --git a/lightningd/regtest-config b/lightningd/regtest-config index 97adebc..46bf42e 100644 --- a/lightningd/regtest-config +++ b/lightningd/regtest-config @@ -7,6 +7,7 @@ max-locktime-blocks=288 important-plugin=/usr/bin/clboss clboss-auto-close=true bind-addr=0.0.0.0:19846 -plugin=/usr/local/src/plugins/summary/summary.py +plugin=/usr/local/src/plugins/summars +plugin=/usr/local/src/plugins/monitor.py subdaemon=hsmd:remote_hsmd_socket -experimental-anchors \ No newline at end of file +experimental-anchors diff --git a/lightningd/testnet-config b/lightningd/testnet-config index d33565d..0c559d9 100644 --- a/lightningd/testnet-config +++ b/lightningd/testnet-config @@ -7,6 +7,7 @@ max-locktime-blocks=288 important-plugin=/usr/bin/clboss clboss-auto-close=true bind-addr=0.0.0.0:19735 -plugin=/usr/local/src/plugins/summary/summary.py +plugin=/usr/local/src/plugins/summars +plugin=/usr/local/src/plugins/monitor.py subdaemon=hsmd:remote_hsmd_socket -experimental-anchors \ No newline at end of file +experimental-anchors From d254b95cbe60203384d9a63e2b7bc4620d457dae Mon Sep 17 00:00:00 2001 From: Lakshya Singh Date: Tue, 11 Jun 2024 23:16:10 +0530 Subject: [PATCH 2/2] cln: install clnrest dependencies expose clnrest port to outside by default Signed-off-by: Lakshya Singh --- docker-compose.yml | 2 ++ lightningd/Dockerfile | 3 +++ lightningd/regtest-config | 1 + lightningd/testnet-config | 1 + 4 files changed, 7 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 5fe055d..9204ce8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -43,6 +43,8 @@ services: expose: - 19735 - 7701 + ports: + - 3010:3010 networks: - lightning depends_on: diff --git a/lightningd/Dockerfile b/lightningd/Dockerfile index 56ac767..403d462 100644 --- a/lightningd/Dockerfile +++ b/lightningd/Dockerfile @@ -143,6 +143,7 @@ COPY --from=clboss_builder /usr/bin/clboss /usr/bin/clboss COPY --from=builder /build/plugins/monitor/monitor.py /usr/local/src/plugins/monitor.py COPY --from=builder /usr/local/bin/summars /usr/local/src/plugins/summars COPY --from=vls_builder /usr/local/bin/remote_hsmd_socket /usr/libexec/c-lightning/remote_hsmd_socket +COPY --from=builder /build/core-lightning/plugins/clnrest/requirements.txt /usr/local/src/plugins/clnrest_requirements.txt RUN addgroup -S lightning && adduser -S lightning -G lightning && \ mkdir -p ${LIGHTNINGD_DATA} && \ @@ -172,6 +173,8 @@ RUN pip3 install \ requests \ packaging +RUN pip3 install -r /usr/local/src/plugins/clnrest_requirements.txt + HEALTHCHECK --interval=5s --timeout=10s --start-period=5s \ CMD ["/healthcheck.sh"] diff --git a/lightningd/regtest-config b/lightningd/regtest-config index 46bf42e..4364535 100644 --- a/lightningd/regtest-config +++ b/lightningd/regtest-config @@ -11,3 +11,4 @@ plugin=/usr/local/src/plugins/summars plugin=/usr/local/src/plugins/monitor.py subdaemon=hsmd:remote_hsmd_socket experimental-anchors +clnrest-port=3010 diff --git a/lightningd/testnet-config b/lightningd/testnet-config index 0c559d9..73a0d33 100644 --- a/lightningd/testnet-config +++ b/lightningd/testnet-config @@ -11,3 +11,4 @@ plugin=/usr/local/src/plugins/summars plugin=/usr/local/src/plugins/monitor.py subdaemon=hsmd:remote_hsmd_socket experimental-anchors +clnrest-port=3010