From 0613f4477cba9f65cbe78b309549b0cbc6714804 Mon Sep 17 00:00:00 2001 From: Lakshya Singh Date: Wed, 1 Nov 2023 08:52:03 +0530 Subject: [PATCH] lightningd: summary plugin addition - copy only summary plugin folder - add runtime dependency pyln-client - update config assets Signed-off-by: Lakshya Singh --- assets/regtest-config | 3 ++- assets/testnet-config | 3 ++- lightningd/Dockerfile | 14 ++++++++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/assets/regtest-config b/assets/regtest-config index 545c024..cbe65d8 100644 --- a/assets/regtest-config +++ b/assets/regtest-config @@ -6,4 +6,5 @@ log-level=info max-locktime-blocks=288 important-plugin=/usr/bin/clboss clboss-auto-close=true -bind-addr=0.0.0.0:19846 \ No newline at end of file +bind-addr=0.0.0.0:19846 +plugin=/usr/local/src/plugins/summary/summary.py \ No newline at end of file diff --git a/assets/testnet-config b/assets/testnet-config index 06f71f8..274338b 100644 --- a/assets/testnet-config +++ b/assets/testnet-config @@ -6,4 +6,5 @@ log-level=info max-locktime-blocks=288 important-plugin=/usr/bin/clboss clboss-auto-close=true -bind-addr=0.0.0.0:19735 \ No newline at end of file +bind-addr=0.0.0.0:19735 +plugin=/usr/local/src/plugins/summary/summary.py \ No newline at end of file diff --git a/lightningd/Dockerfile b/lightningd/Dockerfile index 864f67d..dd1952f 100644 --- a/lightningd/Dockerfile +++ b/lightningd/Dockerfile @@ -53,6 +53,11 @@ RUN git clone --recurse-submodules https://github.com/ZmnSCPxj/clboss.git /clbos make -j $(nproc) && \ make install +ARG GIT_HASH=ce078bb74e10b5dea779fcd9fbe77e1d3e72db7a +RUN git clone https://github.com/lightningd/plugins.git && \ + cd plugins && \ + git checkout $GIT_HASH + # final stage with runtime dependencies and pkgs FROM --platform=${TARGETPLATFORM:-${BUILDPLATFORM:-linux/amd64}} alpine:3.18 as runner @@ -62,6 +67,7 @@ LABEL maintainer.0="Lakshya Singh (@king-11)" \ RUN apk update && \ apk add \ python3 \ + py3-pip \ postgresql \ bitcoin-cli \ pkgconf \ @@ -79,6 +85,8 @@ ENV LIGHTNINGD_DATA=${LIGHTNINGD_HOME}/.lightning \ LIGHTNINGD_PORT=9735 \ BITCOIND_HOME=/root/.bitcoin +RUN mkdir -p /usr/local/src/plugins + COPY --from=builder /usr/bin/lightningd /usr/bin/ COPY --from=builder /usr/bin/lightning-cli /usr/bin/ COPY --from=builder /usr/bin/lightning-hsmtool /usr/bin/ @@ -86,6 +94,7 @@ 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=builder /usr/bin/clboss /usr/bin/clboss +COPY --from=builder /build/plugins/summary /usr/local/src/plugins/summary RUN addgroup -S lightning && adduser -S lightning -G lightning && \ mkdir -p ${LIGHTNINGD_DATA} && \ @@ -110,6 +119,11 @@ COPY assets/regtest-config /regtest-config USER lightning +RUN pip3 install \ + pyln-client \ + requests \ + packaging + HEALTHCHECK --interval=10s --timeout=10s --start-period=15s \ CMD ["/bin/sh", "-c", "/healthcheck.sh"]