22 Commits

Author SHA1 Message Date
Lakshya Singh
08d2776f20 cln: update to v24.05 clboss to master
add jq as new dependency
Signed-off-by: Lakshya Singh <lakshay.singh1108@gmail.com>
2024-06-12 22:48:02 +05:30
Ken Sedgwick
fbd1eb39d6 Merge branch 'king-11/plugin-update' into 'main'
cln: add summars, monitor and clnrest

See merge request lightning-signer/vls-container!29
2024-06-12 15:35:57 +00:00
Lakshya Singh
d254b95cbe cln: install clnrest dependencies
expose clnrest port to outside by default
Signed-off-by: Lakshya Singh <lakshay.singh1108@gmail.com>
2024-06-12 05:54:41 +05:30
Lakshya Singh
74634931aa 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 <lakshay.singh1108@gmail.com>
2024-06-12 05:54:17 +05:30
dev random
50bebd3700 Merge branch 'fix_build' into 'main'
Fix docker compose build issues

See merge request lightning-signer/vls-container!27
2024-06-03 16:39:43 +00:00
Pascal Grange
e3937d6d28 FIX install of pyln-client
Without python3-dev and libffi-dev we have compilation issues
when pip installing pyln-client.
2024-05-29 14:56:21 +02:00
Pascal Grange
5805f29f6e FIX installation of grpcio-tools
Without linux-headers we have a compilation issue when
pip installing grpcio-tools.

Probably related to https://github.com/grpc/grpc/issues/24722
2024-05-29 14:55:57 +02:00
dev random
625a72bab1 Merge branch 'king-11/reap-zombie' into 'main'
docker images: clean kill using tini

See merge request lightning-signer/vls-container!28
2024-05-28 22:51:48 +00:00
Lakshya Singh
a2b9be40e7 docker images: clean kill using tini
- PID 1 does not have default signal handlers which causes
unclean shutdown of processes
Signed-off-by: Lakshya Singh <lakshay.singh1108@gmail.com>
2024-05-25 18:24:49 +05:30
Lakshya Singh
42c340b5ac docs: add gdb backtrace commands
- update CLN version
Signed-off-by: Lakshya Singh <lakshay.singh1108@gmail.com>
2024-04-15 22:44:21 +05:30
Lakshya Singh
7458e5ea9e Merge branch 'king-11/release-testing' into 'main'
cln: v24.02.2 clboss: v0.13.1

See merge request lightning-signer/vls-container!25
2024-04-13 10:44:36 +00:00
Lakshya Singh
9918df2796 clboss: v0.13.1
Signed-off-by: Lakshya Singh <lakshay.singh1108@gmail.com>
2024-04-11 22:41:42 +05:30
Lakshya Singh
eff3b61785 cln: v24.02.2
Signed-off-by: Lakshya Singh <lakshay.singh1108@gmail.com>
2024-04-11 22:13:03 +05:30
dev random
22a3e0293a add -f flags to single-node section 2024-03-28 12:06:45 +00:00
dev random
6ce34eecd7 Merge branch 'king-11/env_var_change' into 'main'
cln: add VLS_CLN_VERSION env var

See merge request lightning-signer/vls-container!24
2024-03-19 14:55:25 +00:00
Lakshya Singh
ef1eec7f04 cln: add VLS_CLN_VERSION env var
- required for newer remote_hsmd_socket versions
- keep backward compatible by having GREENLIGHT_VERSION
Signed-off-by: Lakshya Singh <lakshay.singh1108@gmail.com>
2024-03-18 22:07:11 +05:30
dev random
ee48f8406b Merge branch 'king-11/maintenance' into 'main'
easy configuration and updates

See merge request lightning-signer/vls-container!23
2024-03-14 10:18:19 +00:00
Lakshya Singh
7e5ac7c0e9 docs: add debugging commands
- remove wallet creation command
Signed-off-by: Lakshya Singh <lakshay.singh1108@gmail.com>
2024-03-13 22:13:26 +05:30
Lakshya Singh
aee7a57c95 bitcoind: v26.0 handle gpg failure
- gpg returns error code 2 for untrusted keys accept it for now
- refresh gpg keys
- directory changes for configure.ac file
Signed-off-by: Lakshya Singh <lakshay.singh1108@gmail.com>
2024-03-13 22:09:24 +05:30
Lakshya Singh
5002b0bb29 cln: v24 fixes new dep and summary plugin
- dir is left dirty if we use make so instead using just make install
- summary plugin is archived
- new dep for cln grpcio tools
Signed-off-by: Lakshya Singh <lakshay.singh1108@gmail.com>
2024-03-13 22:07:58 +05:30
Lakshya Singh
8702d3cc1a env: add versions for all services
- btc 26.0
- cln 24.0
- vls 0.11.0
- txoo 0.6.4
Signed-off-by: Lakshya Singh <lakshay.singh1108@gmail.com>
2024-03-13 22:07:07 +05:30
Lakshya Singh
91e4c9b8af compose: add build args and remove defaults
- repository and hashes
- bitcoin version and sha256sums hash
Signed-off-by: Lakshya Singh <lakshay.singh1108@gmail.com>
2024-03-13 22:03:16 +05:30
18 changed files with 203 additions and 73 deletions

View File

@@ -1,11 +1,9 @@
**/.dockerignore .git
**/.env .gitignore
**/.git
**/.gitignore
**/docker-compose* **/docker-compose*
**/Dockerfile* **/Dockerfile*
**/*.Dockerfile .dockerignore
LICENSE LICENSE
README.md README.md
scripts/ scripts
.gitlab-ci.yml .gitlab-ci.yml

18
.env Normal file
View File

@@ -0,0 +1,18 @@
# bitcoin version 26.0
BITCOIN_VERSION=26.0
BITCOIN_SHA256SUMS_HASH=63487c308a6655f939efd700bfca8e0285fa2f869283aaa7192bdd4b8799a747
# core lightning version v24.05
CORE_LIGHTNING_REPO=https://github.com/ElementsProject/lightning.git
CORE_LIGHTNING_GIT_HASH=11586abf79cad33727c03dfa810ae8bcdd3762bf
# clboss version v0.13.1 (2024-05-31 21:28:55 -0700)
CLBOSS_REPO=https://github.com/ZmnSCPxj/clboss.git
CLBOSS_GIT_HASH=df51d5486b05acbeca16cb9e42d18fa082e6079a
# cln plugins (2024-06-06 17:02:52 +0200)
CLN_PLUGINS_REPO=https://github.com/lightningd/plugins.git
CLN_PLUGINS_GIT_HASH=de0c7af343df25e82536233ac248ef46efea8670
# txoo version 0.6.4
TXOO_REPO=https://gitlab.com/lightning-signer/txoo.git
TXOO_GIT_HASH=6f0718e3f2b9406df5e3cd73306f473199141da0
# vls version v0.11.0
VLS_REPO=https://gitlab.com/lightning-signer/validating-lightning-signer.git
VLS_GIT_HASH=395b604964d5a0b4e9ee32c1b6e440dfbf4874f0

1
.gitignore vendored
View File

@@ -1 +0,0 @@
.env

View File

@@ -49,7 +49,7 @@ compose:
- docker volume create vls_data - docker volume create vls_data
- docker buildx create --name=$BUILDER --use - docker buildx create --name=$BUILDER --use
script: script:
- echo "IMAGE_TAG=${IMAGE_TAG}" > .env - export IMAGE_TAG=${IMAGE_TAG}
- ./scripts/build_from_cache.sh bitcoind - ./scripts/build_from_cache.sh bitcoind
- ./scripts/build_from_cache.sh lightningd - ./scripts/build_from_cache.sh lightningd
- ./scripts/build_from_cache.sh txood - ./scripts/build_from_cache.sh txood

View File

@@ -71,10 +71,11 @@ There is a `docker-compose.yml` in the `vlsd` folder which can be used to run a
```bash ```bash
cd vlsd cd vlsd
export VLS_GIT_HASH=$VLS_GIT_HASH
docker compose up docker compose up
``` ```
**_Note_**: Make sure to set `BITCOIND_RPC_URL` and `CLN_RMEOTE_HSMD_URL` as either environment variables or in the `docker-compose.yml` file before running the above command. **_Note_**: Make sure to set `BITCOIND_RPC_URL`, `VLS_GIT_HASH` and `CLN_RMEOTE_HSMD_URL` as either environment variables or in the `docker-compose.yml` file before running the above command. You can take `VLS_GIT_HASH` from [.env](./.env) or from the main [repo](https://gitlab.com/lightning-signer/validating-lightning-signer)
If you wish to run it as a standalone container without using `docker-compose` you can use the following command: If you wish to run it as a standalone container without using `docker-compose` you can use the following command:
@@ -84,6 +85,7 @@ docker run \
--rm \ --rm \
--name vlsd \ --name vlsd \
--network host \ --network host \
--build_arg VLS_GIT_HASH=$VLS_GIT_HASH
-e VLS_NETWORK=testnet \ -e VLS_NETWORK=testnet \
-e BITCOIND_RPC_URL=$BITCOIND_RPC_URL \ -e BITCOIND_RPC_URL=$BITCOIND_RPC_URL \
--mount 'type=volume,src=vls_data,dst=/home/vls/.lightning-signer' \ --mount 'type=volume,src=vls_data,dst=/home/vls/.lightning-signer' \
@@ -136,21 +138,16 @@ __Note__: Even while using `testnet` running using the override is recommended a
To run a single node without `vls` service we can use the same `docker-compose.yml` file in the main directory by just removing the `profile` flag `vls` from all commands. To run a single node without `vls` service we can use the same `docker-compose.yml` file in the main directory by just removing the `profile` flag `vls` from all commands.
```bash ```bash
docker compose up --build docker compose -f docker-compose.yml -f $DOCKER_COMPOSE_OVERRIDE up --build
``` ```
Above command will run `bitcoind`, `lightningd` and `txood` services on a single node. Above command will run `bitcoind`, `lightningd` and `txood` services on a single node.
### Additional Regtest Commands ## Interacting with Containers
We have to run these commands after bitcoind is up and running. We can use the `docker container exec <CONTAINER_NAME> <COMMAND>` command to interact with containers and interact with setup using command line tools like `bitcoin-cli`, `lightning-cli`, `vls-cli`, etc.
Create wallet and make it load automatically: ### Regtest Commands
```bash
docker container exec bitcoind-regtest bitcoin-cli createwallet default
docker container exec bitcoind-regtest bitcoin-cli unloadwallet default
docker container exec bitcoind-regtest bitcoin-cli loadwallet default true
```
Generate Address for node: Generate Address for node:
```bash ```bash
@@ -182,6 +179,67 @@ docker container exec lightningd-test lightning-cli --testnet clboss-status | le
docker container exec lightningd-test lightning-cli --testnet summary docker container exec lightningd-test lightning-cli --testnet summary
``` ```
## Debugging Containers
Checking running status and health of containers
```bash
docker ps
```
Getting logs from container
```bash
# CONTAINER_NAME=lightningd-test
docker container logs $CONTAINER_NAME > $CONTAINER_NAME.log
```
Restarting containers
```bash
cd vls-container
docker compose --profile vls stop
# to start testnet
docker compose --profile vls up
```
Generating Backtrace from CLN core dump
```bash
# attach to the lightningd container
docker container exec -u root -it lightningd-test sh
# install gdb
apk add gdb
gdb /usr/libexec/c-lightning/plugins/pay /home/lightning/.lightning/testnet/core
# get backtrace
bt
```
Delete containers
```bash
cd vls-container
docker compose --profile vls down
```
**NOTE**: If you want to start fresh make sure to delete the created docker volumes as well.
## Choosing Versions
The currently set default versions for services is as follows in the [.env](.env) file:
- **Bitcoin Core**: v26.0
- **Core Lightning**: v24.02.2
- **TXOO**: v0.6.4
- **VLS**: v0.11.0
You just can switch to a particular version/commit for a service by updating the git hash and then rebuilding the service:
```bash
cd vls-container
# update bitcoin core version
sed -i 's/23.0/23.2/g' .env
# build images again
docker compose --profile vls build
```
Note: For `bitcoind` its also important to update the `BITCOIN_SHA256SUMS_HASH`. It is the *SHA256 HASH* of `SHA256SUMS` file.
## Future Work ## Future Work
- [x] standalone dockerfile for vlsd - [x] standalone dockerfile for vlsd

View File

@@ -25,47 +25,44 @@ RUN mkdir $GNUPGHOME && set -ex \
152812300785C96444D3334D17565732E08E5E41 \ 152812300785C96444D3334D17565732E08E5E41 \
0AD83877C1F0CD1EE9BD660AD7CC770B81FD22A8 \ 0AD83877C1F0CD1EE9BD660AD7CC770B81FD22A8 \
590B7292695AFFA5B672CBB2E13FC145CD3F4304 \ 590B7292695AFFA5B672CBB2E13FC145CD3F4304 \
28F5900B1BB5D1A4B6B6D1A9ED357015286A333D \
637DB1E23370F84AFF88CCE03152347D07DA627C \
CFB16E21C950F67FA95E558F2EEB9F5CC09526C1 \ CFB16E21C950F67FA95E558F2EEB9F5CC09526C1 \
F4FC70F07310028424EFC20A8E4256593F177720 \ F4FC70F07310028424EFC20A8E4256593F177720 \
D1DBF2C4B96F2DEBF4C16654410108112E7EA81F \ D1DBF2C4B96F2DEBF4C16654410108112E7EA81F \
287AE4CA1187C68C08B49CB2D11BD4F33F1DB499 \ 287AE4CA1187C68C08B49CB2D11BD4F33F1DB499 \
F9A8737BF4FF5C89C903DF31DD78544CF91B1514 \
9DEAE0DC7063249FB05474681E4AED62986CD25D \ 9DEAE0DC7063249FB05474681E4AED62986CD25D \
E463A93F5F3117EEDE6C7316BD02942421F4889F \ 3EB0DEE6004A13BE5A0CC758BF2978B068054311 \
9D3CC86A72F8494342EA5FD10A41BDC3F4FAFF1C \ ED9BDF7AD6A55E232E84524257FF9BDBCC301009 \
4DAF18FE948E7A965B30F9457E296D555E7F63A7 \
28E72909F1717FE9607754F8A7BEB2621678D37D \ 28E72909F1717FE9607754F8A7BEB2621678D37D \
74E2DEF5D77260B98BC19438099BAD163C70FBFA \
; do \ ; do \
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" || \ gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" || \
gpg --batch --keyserver keys.openpgp.org --recv-keys "$key" || \ gpg --batch --keyserver keys.openpgp.org --recv-keys "$key" || \
gpg --batch --keyserver pgp.mit.edu --recv-keys "$key" || \
gpg --batch --keyserver keyserver.pgp.com --recv-keys "$key" || \ gpg --batch --keyserver keyserver.pgp.com --recv-keys "$key" || \
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" || \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" || \
gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" ; \ gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" ; \
done && \ done
wget -O- https://raw.githubusercontent.com/Kvaciral/kvaciral/main/kvaciral.asc | gpg --import RUN gpg --keyserver hkps://keys.openpgp.org --refresh-keys
RUN gpg -kv RUN gpg -kv
ARG BITCOIN_VERSION=23.0 COPY verify.sh verify.sh
ARG BITCOIN_PREFIX=/opt/bitcoin-${BITCOIN_VERSION}
ARG SHA256SUMS_HASH=aaff81ea001f499e8f6f3221387d7db960d71a3b7a4a2b1aaf2c8060bc94a391
ARG BITCOIN_VERSION
ARG BITCOIN_PREFIX=/opt/bitcoin-${BITCOIN_VERSION}
ARG BITCOIN_SHA256SUMS_HASH
RUN echo "Building bitcoin core version $BITCOIN_VERSION"
RUN wget https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS && \ RUN wget https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS && \
wget https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS.asc && \ wget https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS.asc && \
wget https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}.tar.gz && \ wget https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}.tar.gz && \
gpg --batch --verify SHA256SUMS.asc SHA256SUMS && \ ./verify.sh && \
echo "${SHA256SUMS_HASH} SHA256SUMS" | sha256sum -c - && \ echo "${BITCOIN_SHA256SUMS_HASH} SHA256SUMS" | sha256sum -c - && \
grep " bitcoin-${BITCOIN_VERSION}.tar.gz\$" SHA256SUMS | sha256sum -c - && \ grep " bitcoin-${BITCOIN_VERSION}.tar.gz\$" SHA256SUMS | sha256sum -c - && \
tar -xzf *.tar.gz tar -xzf *.tar.gz
WORKDIR /bitcoin-${BITCOIN_VERSION} WORKDIR /bitcoin-${BITCOIN_VERSION}
RUN sed -i '/AC_PREREQ/a\AR_FLAGS=cr' src/univalue/configure.ac && \ RUN sed -i '/AC_PREREQ/a\AR_FLAGS=cr' configure.ac && \
sed -i '/AX_PROG_CC_FOR_BUILD/a\AR_FLAGS=cr' src/secp256k1/configure.ac && \ sed -i '/AX_PROG_CC_FOR_BUILD/a\AR_FLAGS=cr' src/secp256k1/configure.ac && \
sed -i s:sys/fcntl.h:fcntl.h: src/compat.h && \ sed -i s:sys/fcntl.h:fcntl.h: src/compat/compat.h && \
./autogen.sh && \ ./autogen.sh && \
./configure LDFLAGS=-L`ls -d /opt/db*`/lib/ CPPFLAGS=-I`ls -d /opt/db*`/include/ \ ./configure LDFLAGS=-L`ls -d /opt/db*`/lib/ CPPFLAGS=-I`ls -d /opt/db*`/include/ \
--prefix=${BITCOIN_PREFIX} \ --prefix=${BITCOIN_PREFIX} \
@@ -106,11 +103,13 @@ RUN apk --no-cache add \
boost-thread \ boost-thread \
sqlite-dev \ sqlite-dev \
libevent \ libevent \
libzmq libzmq \
tini
ARG BITCOIN_VERSION
ARG BITCOIN_PREFIX=/opt/bitcoin-${BITCOIN_VERSION}
ENV BITCOIN_DATA=/home/bitcoin/.bitcoin ENV BITCOIN_DATA=/home/bitcoin/.bitcoin
ARG BITCOIN_VERSION=23.0
ARG BITCOIN_PREFIX=/opt/bitcoin-${BITCOIN_VERSION}
COPY --from=bitcoin-core ${BITCOIN_PREFIX}/bin/bitcoin-cli /usr/bin/bitcoin-cli COPY --from=bitcoin-core ${BITCOIN_PREFIX}/bin/bitcoin-cli /usr/bin/bitcoin-cli
COPY --from=bitcoin-core ${BITCOIN_PREFIX}/bin/bitcoin-tx /usr/bin/bitcoin-tx COPY --from=bitcoin-core ${BITCOIN_PREFIX}/bin/bitcoin-tx /usr/bin/bitcoin-tx
@@ -131,7 +130,7 @@ VOLUME ["${BITCOIN_DATA}"]
USER bitcoin USER bitcoin
ENTRYPOINT ["/entrypoint.sh"] ENTRYPOINT ["/sbin/tini", "--", "/entrypoint.sh"]
RUN bitcoind -version | grep "Bitcoin Core version v${BITCOIN_VERSION}" RUN bitcoind -version | grep "Bitcoin Core version v${BITCOIN_VERSION}"

12
bitcoind/verify.sh Executable file
View File

@@ -0,0 +1,12 @@
#!/bin/sh
# verify SHA256SUMS
gpg --batch --verify SHA256SUMS.asc SHA256SUMS
ret_val=$?
# allow 2 as well in case of untrusted keys
if [ $ret_val -eq 0 ] || [ $ret_val -eq 2 ]; then
exit 0
else
exit $ret_val
fi

View File

@@ -3,6 +3,9 @@ services:
bitcoin-core: bitcoin-core:
build: build:
context: ./bitcoind context: ./bitcoind
args:
- BITCOIN_VERSION
- BITCOIN_SHA256SUMS_HASH
image: bitcoind:${IMAGE_TAG:-latest} image: bitcoind:${IMAGE_TAG:-latest}
container_name: bitcoind-test container_name: bitcoind-test
volumes: volumes:
@@ -19,6 +22,15 @@ services:
core-lightning: core-lightning:
build: build:
context: ./lightningd context: ./lightningd
args:
- CORE_LIGHTNING_REPO
- CORE_LIGHTNING_GIT_HASH
- CLBOSS_REPO
- CLBOSS_GIT_HASH
- CLN_PLUGINS_REPO
- CLN_PLUGINS_GIT_HASH
- VLS_REPO
- VLS_GIT_HASH
image: lightningd:${IMAGE_TAG:-latest} image: lightningd:${IMAGE_TAG:-latest}
container_name: lightningd-test container_name: lightningd-test
command: command:
@@ -31,6 +43,8 @@ services:
expose: expose:
- 19735 - 19735
- 7701 - 7701
ports:
- 3010:3010
networks: networks:
- lightning - lightning
depends_on: depends_on:
@@ -46,6 +60,9 @@ services:
txoo: txoo:
build: build:
context: ./txood context: ./txood
args:
- TXOO_REPO
- TXOO_GIT_HASH
image: txood:${IMAGE_TAG:-latest} image: txood:${IMAGE_TAG:-latest}
container_name: txood-test container_name: txood-test
restart: unless-stopped restart: unless-stopped
@@ -64,6 +81,9 @@ services:
vls: vls:
build: build:
context: ./vlsd context: ./vlsd
args:
- VLS_REPO
- VLS_GIT_HASH
image: vlsd:${IMAGE_TAG:-latest} image: vlsd:${IMAGE_TAG:-latest}
container_name: vlsd-test container_name: vlsd-test
profiles: profiles:

View File

@@ -15,33 +15,43 @@ RUN apk update && \
gettext \ gettext \
git \ git \
gmp-dev \ gmp-dev \
jq \
libsodium \ libsodium \
libtool \ libtool \
net-tools \ net-tools \
postgresql-dev \ postgresql-dev \
py3-mako \ py3-mako \
py3-pip \
python3 \ python3 \
python3-dev \ python3-dev \
sqlite-dev \ sqlite-dev \
sqlite-static \ sqlite-static \
zlib-dev \ zlib-dev \
zlib-static zlib-static \
linux-headers
ARG CORE_LIGHTNING_GIT_HASH=76cd32387a400a2aee607edaf1e0a06e92e1402f \ RUN pip3 install grpcio-tools
CORE_LIGHTNING_REPO=https://github.com/ElementsProject/lightning.git
ARG CORE_LIGHTNING_GIT_HASH \
CORE_LIGHTNING_REPO
RUN git clone --recursive $CORE_LIGHTNING_REPO core-lightning RUN git clone --recursive $CORE_LIGHTNING_REPO core-lightning
RUN cd core-lightning && \ RUN cd core-lightning && \
git checkout $CORE_LIGHTNING_GIT_HASH && \ git checkout $CORE_LIGHTNING_GIT_HASH && \
./configure --enable-static --prefix=/usr && \ ./configure --enable-static --prefix=/usr && \
make -j $(nproc) && \
make -j $(nproc) install && \ make -j $(nproc) install && \
make clean make clean
ARG PLUGINS_GIT_HASH=cf96eb63c1687644042ea85acfd3785527fd98d4 \ ARG CLN_PLUGINS_GIT_HASH \
PLUGINS_REPO=https://github.com/lightningd/plugins.git CLN_PLUGINS_REPO
RUN git clone $PLUGINS_REPO RUN git clone $CLN_PLUGINS_REPO
RUN cd plugins && \ RUN cd plugins && \
git checkout $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 FROM --platform=${TARGETPLATFORM:-${BUILDPLATFORM:-linux/amd64}} alpine:3.18 as clboss_builder
@@ -60,8 +70,8 @@ RUN apk update && \
pkgconf \ pkgconf \
sqlite-dev sqlite-dev
ARG CLBOSS_GIT_HASH=0673c50e7374ea8f5cb7e302f72b7978c6bd1794 \ ARG CLBOSS_GIT_HASH \
CLBOSS_REPO=https://github.com/ZmnSCPxj/clboss.git CLBOSS_REPO
RUN git clone --recurse-submodules $CLBOSS_REPO clboss RUN git clone --recurse-submodules $CLBOSS_REPO clboss
RUN cd clboss && \ RUN cd clboss && \
git checkout $CLBOSS_GIT_HASH && \ git checkout $CLBOSS_GIT_HASH && \
@@ -85,9 +95,9 @@ RUN apk update && \
protobuf-dev \ protobuf-dev \
rust rust
ARG VLS_GIT_HASH=5712eb74b672ffd8b691b9e772e05a827d03e7df \ ARG VLS_GIT_HASH \
VLS_REPO=https://gitlab.com/lightning-signer/validating-lightning-signer.git VLS_REPO
RUN echo building remote_hsmd_socket from hash: $VLS_GIT_HASH RUN echo "building remote_hsmd_socket from hash: $VLS_GIT_HASH"
RUN git clone $VLS_REPO vls RUN git clone $VLS_REPO vls
RUN cd vls && \ RUN cd vls && \
git checkout $VLS_GIT_HASH && \ git checkout $VLS_GIT_HASH && \
@@ -111,7 +121,10 @@ RUN apk update && \
bind-tools \ bind-tools \
libev-dev \ libev-dev \
curl-dev \ curl-dev \
sqlite-dev sqlite-dev \
tini \
python3-dev \
libffi-dev
ARG LIGHTNINGD_UID=101 \ ARG LIGHTNINGD_UID=101 \
LIGHTNINGD_USER=lightning LIGHTNINGD_USER=lightning
@@ -128,8 +141,10 @@ 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/man/man8 /usr/share/man/man8
COPY --from=builder /usr/share/doc/c-lightning /usr/share/doc/c-lightning 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=clboss_builder /usr/bin/clboss /usr/bin/clboss
COPY --from=builder /build/plugins/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 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 && \ RUN addgroup -S lightning && adduser -S lightning -G lightning && \
mkdir -p ${LIGHTNINGD_DATA} && \ mkdir -p ${LIGHTNINGD_DATA} && \
@@ -159,8 +174,10 @@ RUN pip3 install \
requests \ requests \
packaging packaging
RUN pip3 install -r /usr/local/src/plugins/clnrest_requirements.txt
HEALTHCHECK --interval=5s --timeout=10s --start-period=5s \ HEALTHCHECK --interval=5s --timeout=10s --start-period=5s \
CMD ["/healthcheck.sh"] CMD ["/healthcheck.sh"]
ENTRYPOINT ["/entrypoint.sh"] ENTRYPOINT ["/sbin/tini", "--", "/entrypoint.sh"]
CMD ["lightningd"] CMD ["lightningd"]

View File

@@ -5,6 +5,7 @@ cp -u /testnet-config ${LIGHTNINGD_DATA}/testnet-config
cp -u /regtest-config ${LIGHTNINGD_DATA}/regtest-config cp -u /regtest-config ${LIGHTNINGD_DATA}/regtest-config
export GREENLIGHT_VERSION=$(lightningd --version) export GREENLIGHT_VERSION=$(lightningd --version)
export VLS_CLN_VERSION=$(lightningd --version)
if [ $(echo "$1" | cut -c1) = "-" ]; then if [ $(echo "$1" | cut -c1) = "-" ]; then
echo "$0: assuming arguments for lightningd" echo "$0: assuming arguments for lightningd"

View File

@@ -2,4 +2,4 @@
set -ex set -ex
lightning-cli --network $VLS_NETWORK summary lightning-cli --network $VLS_NETWORK getinfo

View File

@@ -3,10 +3,11 @@ bitcoin-rpcuser=rpcuser
bitcoin-rpcpassword=VLSsigner1 bitcoin-rpcpassword=VLSsigner1
bitcoin-rpcport=38332 bitcoin-rpcport=38332
log-level=info log-level=info
max-locktime-blocks=288
important-plugin=/usr/bin/clboss important-plugin=/usr/bin/clboss
clboss-auto-close=true clboss-auto-close=true
bind-addr=0.0.0.0:19846 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 subdaemon=hsmd:remote_hsmd_socket
experimental-anchors experimental-anchors
clnrest-port=3010

View File

@@ -3,10 +3,11 @@ bitcoin-rpcuser=rpcuser
bitcoin-rpcpassword=VLSsigner1 bitcoin-rpcpassword=VLSsigner1
bitcoin-rpcport=18332 bitcoin-rpcport=18332
log-level=info log-level=info
max-locktime-blocks=288
important-plugin=/usr/bin/clboss important-plugin=/usr/bin/clboss
clboss-auto-close=true clboss-auto-close=true
bind-addr=0.0.0.0:19735 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 subdaemon=hsmd:remote_hsmd_socket
experimental-anchors experimental-anchors
clnrest-port=3010

View File

@@ -5,4 +5,5 @@ set -ex
SERVICE=$1 SERVICE=$1
cd $SERVICE cd $SERVICE
docker build --load --builder $BUILDER --cache-from $CACHE/$SERVICE:$CACHE_TAG -t $SERVICE:$IMAGE_TAG .
docker build --load --builder $BUILDER --cache-from $CACHE/$SERVICE:$CACHE_TAG -t $SERVICE:$IMAGE_TAG $(grep -v '^#' ../.env | sed 's/^/--build-arg /' | tr '\n' ' ') .

View File

@@ -7,4 +7,4 @@ SERVICE=$1
docker buildx create --name=$SERVICE --use docker buildx create --name=$SERVICE --use
cd $SERVICE cd $SERVICE
docker build --load --builder=$SERVICE --cache-to type=registry,ref=$CACHE/$SERVICE:$CACHE_TAG --cache-from $CACHE/$SERVICE:$CACHE_TAG -t $SERVICE:$IMAGE_TAG . docker build --load --builder=$SERVICE --cache-to type=registry,ref=$CACHE/$SERVICE:$CACHE_TAG --cache-from $CACHE/$SERVICE:$CACHE_TAG -t $SERVICE:$IMAGE_TAG $(grep -v '^#' ../.env | sed 's/^/--build-arg /' | tr '\n' ' ') .

View File

@@ -9,8 +9,8 @@ RUN apk update && \
rust \ rust \
cargo cargo
ARG TXOO_GIT_HASH=1cfeecf5f806a04a12c97ca17c39566a1a24e732 ARG TXOO_GIT_HASH \
ARG TXOO_REPO=https://gitlab.com/lightning-signer/txoo.git TXOO_REPO
RUN git clone --recurse-submodules $TXOO_REPO RUN git clone --recurse-submodules $TXOO_REPO
RUN cd txoo && \ RUN cd txoo && \
git checkout $TXOO_GIT_HASH && \ git checkout $TXOO_GIT_HASH && \
@@ -32,7 +32,8 @@ RUN apk update && \
libev-dev \ libev-dev \
curl-dev \ curl-dev \
curl \ curl \
jq jq \
tini
COPY --from=builder /usr/local/bin/txood /usr/bin/txood COPY --from=builder /usr/local/bin/txood /usr/bin/txood
@@ -47,5 +48,5 @@ VOLUME ["${TXOO_DATA}"]
HEALTHCHECK --interval=5s --timeout=10s --start-period=5s \ HEALTHCHECK --interval=5s --timeout=10s --start-period=5s \
CMD ["/healthcheck.sh"] CMD ["/healthcheck.sh"]
ENTRYPOINT ["/entrypoint.sh"] ENTRYPOINT ["/sbin/tini", "--", "/entrypoint.sh"]
CMD ["txood"] CMD ["txood"]

View File

@@ -12,9 +12,10 @@ RUN apk update && \
protobuf-dev \ protobuf-dev \
rust rust
ARG VLS_GIT_HASH=5712eb74b672ffd8b691b9e772e05a827d03e7df ARG VLS_GIT_HASH \
RUN echo building vlsd from hash: $VLS_GIT_HASH VLS_REPO
RUN git clone https://gitlab.com/lightning-signer/validating-lightning-signer.git vls RUN echo "building vlsd from hash: $VLS_GIT_HASH"
RUN git clone $VLS_REPO vls
RUN cd vls && \ RUN cd vls && \
git checkout $VLS_GIT_HASH && \ git checkout $VLS_GIT_HASH && \
cargo install --locked --path ./vls-proxy --bin vlsd2 --profile release --root /usr/local/ && \ cargo install --locked --path ./vls-proxy --bin vlsd2 --profile release --root /usr/local/ && \
@@ -37,7 +38,8 @@ RUN apk update && \
build-base \ build-base \
curl-dev \ curl-dev \
protobuf \ protobuf \
bind-tools bind-tools \
tini
COPY --from=builder /usr/local/bin/vlsd2 /usr/local/bin/vlsd2 COPY --from=builder /usr/local/bin/vlsd2 /usr/local/bin/vlsd2
COPY --from=builder /usr/local/bin/vls-cli /usr/local/bin/vls-cli COPY --from=builder /usr/local/bin/vls-cli /usr/local/bin/vls-cli
@@ -64,7 +66,7 @@ USER vls
HEALTHCHECK --interval=10s --timeout=10s --start-period=10s \ HEALTHCHECK --interval=10s --timeout=10s --start-period=10s \
CMD ["/healthcheck.sh"] CMD ["/healthcheck.sh"]
ENTRYPOINT ["/entrypoint.sh"] ENTRYPOINT ["/sbin/tini", "--", "/entrypoint.sh"]
RUN vlsd2 --git-desc RUN vlsd2 --git-desc

View File

@@ -4,6 +4,8 @@ services:
build: build:
context: . context: .
dockerfile: Dockerfile dockerfile: Dockerfile
args:
- VLS_GIT_HASH
image: vlsd image: vlsd
container_name: vlsd-standalone container_name: vlsd-standalone
command: command: