Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]
python-version: [3.8, 3.9]

steps:
- uses: actions/checkout@v2
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ jobs:
strategy:
fail-fast: false
matrix:
include:
- { LN_IMPL: clightning }
LN_IMPL: [clightning, ldk]

steps:
- uses: actions/checkout@v2
- name: Integration testing
run: |
docker build -f docker/Dockerfile.${{matrix.LN_IMPL}} -t lnprototest-${{matrix.LN_IMPL}} .
docker run lnprototest-${{matrix.LN_IMPL}}
docker run -e LN_IMPL=${{matrix.LN_IMPL}} lnprototest-${{matrix.LN_IMPL}}
49 changes: 49 additions & 0 deletions docker/Dockerfile.ldk
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
FROM ubuntu:22.04
LABEL maintainer="Prakhar Saxena [email protected]"

ENV TZ=Europe/Minsk
ENV BITCOIN_VERSION=23.0

# Set timezone
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

# Install Ubuntu utilities and essential dependencies
RUN apt-get update && apt-get install -y \
software-properties-common \
build-essential \
curl wget jq \
git python3 python3-pip

# Install Rust
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
RUN echo 'source $HOME/.cargo/env' >> $HOME/.bashrc

# Install Bitcoin Core
RUN cd /tmp/ && \
wget https://bitcoincore.org/bin/bitcoin-core-$BITCOIN_VERSION/bitcoin-$BITCOIN_VERSION-x86_64-linux-gnu.tar.gz -O bitcoin.tar.gz && \
tar -xvzf bitcoin.tar.gz && \
mv /tmp/bitcoin-$BITCOIN_VERSION/bin/bitcoin* /usr/local/bin/ && \
rm -rf bitcoin.tar.gz /tmp/bitcoin-$BITCOIN_VERSION

# Clone and build LDK-Sample
RUN git clone https://github.com/Psycho-Pirate/ldk-sample.git
RUN cd ldk-sample && cargo build

# Install Poetry
RUN pip install poetry

# Set PYTHONPATH environment variable
ENV LDK_SRC="/ldk-sample"

# Set workdir and copy project files
RUN mkdir lnprototest
COPY . lnprototest

RUN cd lnprototest && \
poetry install && \
poetry run pip install ldk-lnprototest
RUN cd lnprototest && ls -lha
RUN chmod +x ./lnprototest/docker/ldk-entrypoint.sh

CMD ["./lnprototest/docker/ldk-entrypoint.sh"]
2 changes: 1 addition & 1 deletion docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ services:
lightningd:
build:
context: ../
dockerfile: ./docker/Dockerfile.clightning
dockerfile: ./docker/Dockerfile.${LN_IMPL}
2 changes: 1 addition & 1 deletion docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ do
echo "iteration $i failed"
exit 1
fi
done
done
12 changes: 12 additions & 0 deletions docker/ldk-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#! /bin/bash
cd lnprototest || exit

for i in range{0..5};
do
if poetry run make check PYTEST_ARGS="--runner=ldk_lnprototest.Runner -n8 --dist=loadfile --log-cli-level=DEBUG"; then
echo "iteration $i succeeded"
else
echo "iteration $i failed"
exit 1
fi
done
Loading