diff --git a/Dockerfile b/Dockerfile index 66263f60d3b4..b13b2f5b1494 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 \ @@ -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 diff --git a/contrib/compose/.env b/contrib/compose/.env index b77f27b8dccc..38b7e775d6b4 100644 --- a/contrib/compose/.env +++ b/contrib/compose/.env @@ -1,4 +1,4 @@ -NETWORK=testnet +NETWORK=groestlcoin LIGHTNING_ALIAS= HOST=127.0.0.1 SPARK_LOGIN=admin:admin diff --git a/contrib/compose/README.md b/contrib/compose/README.md index ab5778a964a5..570294d45969 100644 --- a/contrib/compose/README.md +++ b/contrib/compose/README.md @@ -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) + diff --git a/contrib/compose/docker-compose.yml b/contrib/compose/docker-compose.yml index 32839f4a198f..788c22d1326d 100644 --- a/contrib/compose/docker-compose.yml +++ b/contrib/compose/docker-compose.yml @@ -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 @@ -53,4 +53,4 @@ services: - "clightning_groestlcoin_datadir:/etc/lightning" volumes: - clightning_groestlcoin_datadir: \ No newline at end of file + clightning_groestlcoin_datadir: diff --git a/tools/docker-entrypoint.sh b/tools/docker-entrypoint.sh index bebb7d10512c..8e74f936e648 100755 --- a/tools/docker-entrypoint.sh +++ b/tools/docker-entrypoint.sh @@ -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 "$@" &