txoo: connect to vls and cln
- set env var for vls frontend - set arg for vlsd2 - create txoo-server service - cln uses http source - vls fetch public key using curl with retries fail if not set - update README for vls standalone Signed-off-by: Lakshya Singh <lakshay.singh1108@gmail.com>
This commit is contained in:
parent
a406c2a7ec
commit
e46298a6f8
15
README.md
15
README.md
@ -65,19 +65,28 @@ Required command arguments:
|
|||||||
|
|
||||||
For information on all possible arguments to `vlsd` see [documentation](https://gitlab.com/lightning-signer/validating-lightning-signer/-/blob/main/vls-proxy/src/config.rs?ref_type=heads).
|
For information on all possible arguments to `vlsd` see [documentation](https://gitlab.com/lightning-signer/validating-lightning-signer/-/blob/main/vls-proxy/src/config.rs?ref_type=heads).
|
||||||
|
|
||||||
|
### Build Arguments
|
||||||
|
|
||||||
|
For building the container its required to provide following build arguments:
|
||||||
|
- `VLS_REPO` url for git repo to use for building binaries.
|
||||||
|
- `VLS_GIT_HASH` commit sha/tag/branch to use from git repo.
|
||||||
|
- `TXOO_PUBLIC_KEY` public key for trusted TXOO.
|
||||||
|
|
||||||
### Running container
|
### Running container
|
||||||
|
|
||||||
There is a `docker-compose.yml` in the `vlsd` folder which can be used to run a standalone `vlsd` service with `network_mode` set to host.
|
There is a `docker-compose.yml` in the `vlsd` folder which can be used to run a standalone `vlsd` service with `network_mode` set to host.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd vlsd
|
cd vlsd
|
||||||
|
export VLS_REPO=$VLS_REPO
|
||||||
export VLS_GIT_HASH=$VLS_GIT_HASH
|
export VLS_GIT_HASH=$VLS_GIT_HASH
|
||||||
|
export TXOO_PUBLIC_KEY=$TXOO_PUBLIC_KEY
|
||||||
docker compose up
|
docker compose up
|
||||||
```
|
```
|
||||||
|
|
||||||
**_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)
|
**_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.
|
||||||
|
|
||||||
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:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker run \
|
docker run \
|
||||||
@ -86,6 +95,8 @@ docker run \
|
|||||||
--name vlsd \
|
--name vlsd \
|
||||||
--network host \
|
--network host \
|
||||||
--build_arg VLS_GIT_HASH=$VLS_GIT_HASH
|
--build_arg VLS_GIT_HASH=$VLS_GIT_HASH
|
||||||
|
--build_arg VLS_REPO=$VLS_REPO
|
||||||
|
--build_arg TXOO_PUBLIC_KEY=$TXOO_PUBLIC_KEY
|
||||||
-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' \
|
||||||
|
@ -40,6 +40,15 @@ services:
|
|||||||
- BITCOIN_NETWORK=regtest
|
- BITCOIN_NETWORK=regtest
|
||||||
- BITCOIND_RPC_URL=http://rpcuser:VLSsigner1@bitcoind:38332
|
- BITCOIND_RPC_URL=http://rpcuser:VLSsigner1@bitcoind:38332
|
||||||
|
|
||||||
|
txoo-server:
|
||||||
|
container_name: txoo-server-regtest
|
||||||
|
volumes:
|
||||||
|
- type: volume
|
||||||
|
source: txoo_regtest
|
||||||
|
target: /usr/share/nginx/html
|
||||||
|
volume:
|
||||||
|
subpath: regtest/public
|
||||||
|
|
||||||
vls:
|
vls:
|
||||||
container_name: vlsd-regtest
|
container_name: vlsd-regtest
|
||||||
volumes:
|
volumes:
|
||||||
|
@ -50,8 +50,11 @@ services:
|
|||||||
depends_on:
|
depends_on:
|
||||||
bitcoin-core:
|
bitcoin-core:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
txoo-server:
|
||||||
|
condition: service_started
|
||||||
environment:
|
environment:
|
||||||
- BITCOIND_RPC_URL=http://rpcuser:VLSsigner1@bitcoind:18332
|
- BITCOIND_RPC_URL=http://rpcuser:VLSsigner1@bitcoind:18332
|
||||||
|
- TXOO_SOURCE_URL=http://txoo-server:80
|
||||||
- RUST_LOG=info
|
- RUST_LOG=info
|
||||||
- VLS_NETWORK=testnet
|
- VLS_NETWORK=testnet
|
||||||
- VLS_BIND=0.0.0.0
|
- VLS_BIND=0.0.0.0
|
||||||
@ -78,6 +81,23 @@ services:
|
|||||||
- BITCOIN_NETWORK=testnet
|
- BITCOIN_NETWORK=testnet
|
||||||
- BITCOIND_RPC_URL=http://rpcuser:VLSsigner1@bitcoind:18332
|
- BITCOIND_RPC_URL=http://rpcuser:VLSsigner1@bitcoind:18332
|
||||||
|
|
||||||
|
txoo-server:
|
||||||
|
image: nginx:1.27-alpine3.20
|
||||||
|
container_name: txoo-server-test
|
||||||
|
networks:
|
||||||
|
- lightning
|
||||||
|
depends_on:
|
||||||
|
txoo:
|
||||||
|
condition: service_started
|
||||||
|
volumes:
|
||||||
|
- type: volume
|
||||||
|
source: txoo_data
|
||||||
|
target: /usr/share/nginx/html
|
||||||
|
volume:
|
||||||
|
subpath: testnet/public
|
||||||
|
ports:
|
||||||
|
- "8080:80"
|
||||||
|
|
||||||
lss:
|
lss:
|
||||||
build:
|
build:
|
||||||
context: ./lss
|
context: ./lss
|
||||||
@ -109,11 +129,12 @@ services:
|
|||||||
args:
|
args:
|
||||||
- VLS_REPO
|
- VLS_REPO
|
||||||
- VLS_GIT_HASH
|
- VLS_GIT_HASH
|
||||||
|
- TXOO_PUBLIC_KEY
|
||||||
image: vlsd:${IMAGE_TAG:-latest}
|
image: vlsd:${IMAGE_TAG:-latest}
|
||||||
container_name: vlsd-test
|
container_name: vlsd-test
|
||||||
profiles:
|
profiles:
|
||||||
- vls
|
- vls
|
||||||
command:
|
command:
|
||||||
--log-level=info
|
--log-level=info
|
||||||
--connect=http://core-lightning:7701
|
--connect=http://core-lightning:7701
|
||||||
${LSS_REMOTE_URL:+--lss=$LSS_REMOTE_URL}
|
${LSS_REMOTE_URL:+--lss=$LSS_REMOTE_URL}
|
||||||
@ -121,15 +142,18 @@ services:
|
|||||||
- lightning
|
- lightning
|
||||||
volumes:
|
volumes:
|
||||||
- vls_data:/home/vls/.lightning-signer
|
- vls_data:/home/vls/.lightning-signer
|
||||||
|
depends_on:
|
||||||
|
txoo-server:
|
||||||
|
condition: service_started
|
||||||
|
lss:
|
||||||
|
condition: service_started
|
||||||
|
required: false
|
||||||
environment:
|
environment:
|
||||||
|
- LSS_REMOTE_URL
|
||||||
- VLS_NETWORK=testnet
|
- VLS_NETWORK=testnet
|
||||||
- VLS_PERMISSIVE=1
|
- VLS_PERMISSIVE=1
|
||||||
- RUST_LOG=info
|
- RUST_LOG=info
|
||||||
- BITCOIND_RPC_URL=http://rpcuser:VLSsigner1@bitcoind:18332
|
- BITCOIND_RPC_URL=http://rpcuser:VLSsigner1@bitcoind:18332
|
||||||
depends_on:
|
|
||||||
lss:
|
|
||||||
condition: service_started
|
|
||||||
required: false
|
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
bitcoin_data:
|
bitcoin_data:
|
||||||
|
@ -4,6 +4,7 @@ set -e
|
|||||||
cp -u /testnet-config ${LIGHTNINGD_DATA}/testnet-config
|
cp -u /testnet-config ${LIGHTNINGD_DATA}/testnet-config
|
||||||
cp -u /regtest-config ${LIGHTNINGD_DATA}/regtest-config
|
cp -u /regtest-config ${LIGHTNINGD_DATA}/regtest-config
|
||||||
|
|
||||||
|
# this is kept for backward compatibility purposes
|
||||||
export GREENLIGHT_VERSION=$(lightningd --version)
|
export GREENLIGHT_VERSION=$(lightningd --version)
|
||||||
export VLS_CLN_VERSION=$(lightningd --version)
|
export VLS_CLN_VERSION=$(lightningd --version)
|
||||||
|
|
||||||
|
@ -28,6 +28,8 @@ ARG VLSD_UID=100 \
|
|||||||
VLSD_GID=101 \
|
VLSD_GID=101 \
|
||||||
VLSD_USER=vls
|
VLSD_USER=vls
|
||||||
ARG VLSD_HOME=/home/${VLSD_USER}
|
ARG VLSD_HOME=/home/${VLSD_USER}
|
||||||
|
ARG TXOO_PUBLIC_KEY
|
||||||
|
ENV TXOO_PUBLIC_KEY=${TXOO_PUBLIC_KEY}
|
||||||
|
|
||||||
LABEL maintainer.0="Lakshya Singh (@king-11)" \
|
LABEL maintainer.0="Lakshya Singh (@king-11)" \
|
||||||
maintainer.1="Dev Random (@devrandom01)"
|
maintainer.1="Dev Random (@devrandom01)"
|
||||||
@ -39,6 +41,7 @@ RUN apk update && \
|
|||||||
apk add \
|
apk add \
|
||||||
build-base \
|
build-base \
|
||||||
curl-dev \
|
curl-dev \
|
||||||
|
curl \
|
||||||
protobuf \
|
protobuf \
|
||||||
bind-tools \
|
bind-tools \
|
||||||
tini
|
tini
|
||||||
@ -58,6 +61,8 @@ ENV VLSD_DATA=/home/vls/.lightning-signer
|
|||||||
RUN mkdir -p ${VLSD_DATA} && \
|
RUN mkdir -p ${VLSD_DATA} && \
|
||||||
chown ${VLSD_USER}:${VLSD_USER} ${VLSD_DATA}
|
chown ${VLSD_USER}:${VLSD_USER} ${VLSD_DATA}
|
||||||
|
|
||||||
|
RUN mkdir -p ${VLSD_HOME}/.txoo
|
||||||
|
|
||||||
ENV REMOTE_SIGNER_ALLOWLIST=${VLSD_DATA}/ALLOWLIST
|
ENV REMOTE_SIGNER_ALLOWLIST=${VLSD_DATA}/ALLOWLIST
|
||||||
RUN touch ${REMOTE_SIGNER_ALLOWLIST}
|
RUN touch ${REMOTE_SIGNER_ALLOWLIST}
|
||||||
|
|
||||||
|
@ -5,7 +5,9 @@ services:
|
|||||||
context: .
|
context: .
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
args:
|
args:
|
||||||
|
- VLS_REPO
|
||||||
- VLS_GIT_HASH
|
- VLS_GIT_HASH
|
||||||
|
- TXOO_PUBLIC_KEY
|
||||||
image: vlsd
|
image: vlsd
|
||||||
container_name: vlsd-standalone
|
container_name: vlsd-standalone
|
||||||
command:
|
command:
|
||||||
|
@ -4,6 +4,10 @@ set -e
|
|||||||
cp /vlsd2.toml $VLSD_DATA/
|
cp /vlsd2.toml $VLSD_DATA/
|
||||||
sed -i "1s/^/network = \"$VLS_NETWORK\"\n/" $VLSD_DATA/vlsd2.toml
|
sed -i "1s/^/network = \"$VLS_NETWORK\"\n/" $VLSD_DATA/vlsd2.toml
|
||||||
|
|
||||||
|
TXOO_PUBLIC_KEY=${TXOO_PUBLIC_KEY:=$(curl -s --retry 5 --retry-all-errors --fail http://txoo-server:80/config | grep public_key | cut -d ' ' -f 2)}
|
||||||
|
|
||||||
|
test -n "$TXOO_PUBLIC_KEY" || (echo "TXOO_PUBLIC_KEY build arg not set" && false)
|
||||||
|
|
||||||
if [ $(echo "$1" | cut -c1) = "-" ]; then
|
if [ $(echo "$1" | cut -c1) = "-" ]; then
|
||||||
echo "$0: assuming arguments for vlsd2"
|
echo "$0: assuming arguments for vlsd2"
|
||||||
|
|
||||||
@ -13,7 +17,8 @@ fi
|
|||||||
if [ $(echo "$1" | cut -c1) = "-" ] || [ "$1" = "vlsd2" ]; then
|
if [ $(echo "$1" | cut -c1) = "-" ] || [ "$1" = "vlsd2" ]; then
|
||||||
echo "$0: setting config to $VLSD_DATA/vlsd2.toml"
|
echo "$0: setting config to $VLSD_DATA/vlsd2.toml"
|
||||||
|
|
||||||
set -- "$@" --config=$VLSD_DATA/vlsd2.toml
|
echo "$0: using $TXOO_PUBLIC_KEY as trusted oracle pubkey"
|
||||||
|
set -- "$@" --config=$VLSD_DATA/vlsd2.toml -t=$TXOO_PUBLIC_KEY
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo
|
echo
|
||||||
|
Loading…
x
Reference in New Issue
Block a user