Merge branch 'txoo' into 'main'

feat: txoo in network

See merge request lightning-signer/vls-container!6
This commit is contained in:
dev random 2023-10-19 15:19:32 +00:00
commit 3890fdd2be
6 changed files with 108 additions and 2 deletions

View File

@ -21,5 +21,12 @@ services:
- 9735:9735
env_file:
- ./assets/main-env
environment:
- BITCOIN_CHAIN=main
txoo:
container_name: txoo-main
command:
- -r http://rpcuser:VLSsigner1@bitcoind:8332
environment:
- BITCOIN_CHAIN=main

View File

@ -21,5 +21,12 @@ services:
- 19846:19846
env_file:
- ./assets/regtest-env
environment:
- BITCOIN_CHAIN=regtest
txoo:
container_name: txoo-regtest
command:
- -r http://rpcuser:VLSsigner1@bitcoind:38332
environment:
- BITCOIN_CHAIN=regtest

View File

@ -40,6 +40,30 @@ services:
environment:
- BITCOIN_CHAIN=test
txoo:
build:
dockerfile: ./txood/Dockerfile
content: .
container_name: txood-test
restart: always
build:
dockerfile: ./txood/Dockerfile
context: .
image: txood
container_name: txoo-test
command:
- -r http://rpcuser:VLSsigner1@bitcoind:18332
networks:
- LN_testing
volumes:
- txoo_data:/root/.txoo/
- data:/root/.bitcoin/
depends_on:
bitcoin-core:
condition: service_healthy
environment:
- BITCOIN_CHAIN=test
volumes:
data:
name: bitcoin_data
@ -47,6 +71,9 @@ volumes:
clightning:
name: lightning_data
external: true
txoo_data:
name: txood_data
external: true
networks:
LN_testing:

View File

@ -1,5 +1,5 @@
# build stage for core lightning and clboss
FROM --platform=${TARGETPLATFORM:-${BUILDPLATFORM:-linux/amd64}} alpine:3.18 as bitcoin-core
FROM --platform=${TARGETPLATFORM:-${BUILDPLATFORM:-linux/amd64}} alpine:3.18 as builder
ARG TARGETPLATFORM
@ -27,8 +27,10 @@ RUN apk update && \
zlib-dev \
zlib-static
RUN git clone -b 2023-08-remote-hsmd-v23.08 --recursive https://github.com/lightning-signer/c-lightning.git /repo --recursive && \
ARG GIT_HASH=bd9494c65be09e6f8ecb3bc49b50a859467a65fe
RUN git clone --recursive https://github.com/lightning-signer/c-lightning.git /repo && \
cd /repo && \
git checkout $GIT_HASH && \
./configure --enable-static --prefix=/usr && \
make -j $(nproc) && \
make install
@ -42,8 +44,10 @@ RUN apk add \
pkgconf \
sqlite-dev
ARG GIT_HASH=4f37007f00f1cf41e2ead031ddc4a34ef8dbd9e5
RUN git clone --recurse-submodules https://github.com/ZmnSCPxj/clboss.git /clboss && \
cd /clboss && \
git checkout $GIT_HASH && \
autoreconf -i && \
./configure --prefix=/usr && \
make -j $(nproc) && \

40
txood/Dockerfile Normal file
View File

@ -0,0 +1,40 @@
# build txoo
FROM --platform=${TARGETPLATFORM:-${BUILDPLATFORM:-linux/amd64}} alpine:3.18 as builder
WORKDIR /build
RUN apk update && \
apk add \
git \
rust
RUN apk add cargo
ARG GIT_HASH=528fa92e5def1b6cc19127f2242137bf6f13550d
RUN git clone --recurse-submodules https://gitlab.com/lightning-signer/txoo.git && \
cd txoo && \
git checkout $GIT_HASH && \
cargo build --release -p txood
# txoo runner
FROM --platform=${TARGETPLATFORM:-${BUILDPLATFORM:-linux/amd64}} alpine:3.18 as runner
LABEL maintainer.0="Lakshya Singh (@king-11)" \
maintainer.1="Dev Random (@devrandom01)"
RUN apk update && \
apk add \
build-base \
bind-tools \
libev-dev \
curl-dev
COPY --from=builder /build/txoo/target/release/txood /usr/bin/txood
COPY txood/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
VOLUME ["/root/.txoo/"]
ENTRYPOINT ["/entrypoint.sh"]
CMD ["txood"]

21
txood/entrypoint.sh Normal file
View File

@ -0,0 +1,21 @@
#!/bin/sh
set -e
LIGHTNING_NETWORK=""
case $BITCOIN_CHAIN in
"test") LIGHTNING_NETWORK=testnet ;;
"regtest") LIGHTNING_NETWORK=regtest ;;
"main") LIGHTNING_NETWORK=bitcoin ;;
"signet") LIGHTNING_NETWORK=signet ;;
*) echo "Invalid BITCOIN_CHAIN value: $BITCOIN_CHAIN" && exit 1 ;;
esac
if [ $(echo "$1" | cut -c1) = "-" ]; then
echo "$0: assuming arguments for txood"
set -- txood --network $LIGHTNING_NETWORK "$@"
fi
echo
exec "$@"