Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix some issues with docker starting state #12

Merged
merged 4 commits into from
Dec 11, 2018
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
17 changes: 16 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,21 @@ COPY . .
ARG DEVELOPER=0
RUN ./configure && make -j3 DEVELOPER=${DEVELOPER} && cp lightningd/lightning* cli/lightning-cli /usr/bin/

FROM debian:stretch-slim

FROM microsoft/dotnet:2.1.403-sdk-alpine3.7 AS dotnetbuilder

RUN apk add --no-cache git

WORKDIR /source

RUN git clone https://github.com/dgarage/NBXplorer && cd NBXplorer && git checkout 88a8db8be3911f59b4b6109845b547368c5f02fb

# Cache some dependencies
RUN cd NBXplorer/NBXplorer.NodeWaiter && dotnet restore && cd ..
RUN cd NBXplorer/NBXplorer.NodeWaiter && \
dotnet publish --output /app/ --configuration Release

FROM microsoft/dotnet:2.2-runtime-deps-stretch-slim

RUN apt-get update && apt-get install -y \
autoconf automake build-essential git libtool libgmp-dev \
Expand All @@ -41,6 +55,7 @@ VOLUME [ "/root/.lightning" ]
COPY --from=builder /opt/lightningd/cli/lightning-cli /usr/bin
COPY --from=builder /opt/lightningd/lightningd/lightning* /usr/bin/
COPY --from=builder /opt/groestlcoin /usr/bin
COPY --from=dotnetbuilder /app /opt/NBXplorer.NodeWaiter
COPY tools/docker-entrypoint.sh entrypoint.sh

EXPOSE 9735 9835
Expand Down
2 changes: 1 addition & 1 deletion contrib/compose/.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
NETWORK=testnet
NETWORK=groestlcoin
LIGHTNING_ALIAS=
HOST=127.0.0.1
SPARK_LOGIN=admin:admin
Expand Down
3 changes: 2 additions & 1 deletion contrib/compose/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ This is an example of how to run a GRS node, GRS c-lightning node and Spark wall

### Configuration & Running

Ensure you have docker & docker-compose installed, edit the `.env` options to your liking and run `docker-compose up`. By default it will run testnet and spark wallet wil lbe available at `localhost:9876` (after GRS syncs)
Ensure you have docker & docker-compose installed, edit the `.env` options to your liking and run `docker-compose up`. By default it will run mainnet and spark wallet will be available at `localhost:9876` (after GRS syncs)

4 changes: 2 additions & 2 deletions contrib/compose/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ services:
volumes:
- "./groestlcoin_datadir:/data"
clightning_groestlcoin:
image: kukks/grs-clightning:latest
image: groestlcoin/lightning:v0.6.2-1
stop_signal: SIGKILL
container_name: clightning_groestlcoin
restart: unless-stopped
Expand Down Expand Up @@ -53,4 +53,4 @@ services:
- "clightning_groestlcoin_datadir:/etc/lightning"

volumes:
clightning_groestlcoin_datadir:
clightning_groestlcoin_datadir:
7 changes: 7 additions & 0 deletions tools/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ if [[ $REPLACEDNETWORK ]]; then
echo "Replaced network $NETWORK by $REPLACEDNETWORK in $LIGHTNINGD_DATA/config"
fi

if [[ $LIGHTNINGD_EXPLORERURL && $LIGHTNINGD_NETWORK ]]; then
# We need to do that because clightning behave weird if it starts at same time as bitcoin core, or if the node is not synched
echo "Waiting for the node to start and sync"
dotnet /opt/NBXplorer.NodeWaiter/NBXplorer.NodeWaiter.dll --chains "grs" --network "$NETWORK" --explorerurl "$LIGHTNINGD_EXPLORERURL"
echo "Node synched"
fi

if [ "$EXPOSE_TCP" == "true" ]; then
set -m
lightningd "$@" &
Expand Down