From a86d64e43928bf895641962389a603de1c969be9 Mon Sep 17 00:00:00 2001 From: "Andreas M. Antonopoulos" Date: Mon, 24 Feb 2020 17:24:35 -0600 Subject: [PATCH 01/14] Development Environment: Dockerfile draft Installs dev tools, bitcoind, c-lightning, lnd --- code/devenv/Dockerfile | 66 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 code/devenv/Dockerfile diff --git a/code/devenv/Dockerfile b/code/devenv/Dockerfile new file mode 100644 index 0000000..21d4f35 --- /dev/null +++ b/code/devenv/Dockerfile @@ -0,0 +1,66 @@ +FROM ubuntu:18.04 + +# Install development tools prerequisites +RUN apt-get update && apt-get install -y \ + build-essential \ + libtool \ + autotools-dev \ + automake \ + pkg-config \ + python3 \ + wget \ + git \ + curl \ + unzip + +# Install additional Bitcoin Core (bitcoind) requirements +RUN apt-get install -y \ + libssl-dev \ + libevent-dev \ + bsdmainutils \ + libboost-system-dev \ + libboost-filesystem-dev \ + libboost-chrono-dev \ + libboost-test-dev \ + libboost-thread-dev \ + libminiupnpc-dev \ + libzmq3-dev + +# Install software-properties-common to add apt repositories +RUN apt-get install -y \ + software-properties-common + +# Add Bitcoin Core PPA repository +RUN add-apt-repository ppa:bitcoin/bitcoin +RUN apt-get update && apt-get install -y \ + bitcoind + + +# c-lightning +RUN add-apt-repository -u ppa:lightningnetwork/ppa +RUN apt-get install -y \ + lightningd + +# Go 1.13 for LND +RUN curl -SL https://dl.google.com/go/go1.13.linux-amd64.tar.gz \ + | tar -xzC /usr/local +ENV PATH $PATH:/usr/local/go/bin +ENV GOPATH /root/gocode +ENV PATH $PATH:$GOPATH/bin + +# LND +RUN go get -d github.com/lightningnetwork/lnd +WORKDIR $GOPATH/src/github.com/lightningnetwork/lnd +RUN make && make install +# +# # OpenJDK11 for eclair +# RUN mkdir -p /usr/src/openjdk \ +# && curl -SL https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.6%2B10/OpenJDK11U-jdk_x64_linux_hotspot_11.0.6_10.tar.gz \ +# | tar -xzC /usr/local +# ENV PATH $PATH:/usr/local/jdk-11.0.6+10/bin/ +# +# # eclair-node +# RUN mkdir -p /usr/src/eclair +# WORKDIR /usr/src/eclair +# RUN curl -SL https://github.com/ACINQ/eclair/releases/download/v0.3.3/eclair-node-0.3.3-12ac145.jar -o eclair-node.zip +# RUN unzip eclair-node.zip From 58a895c1a2556bbae1f3d494353460dcc9ade007 Mon Sep 17 00:00:00 2001 From: "Andreas M. Antonopoulos" Date: Mon, 24 Feb 2020 20:12:19 -0600 Subject: [PATCH 02/14] Added eclair 0.3.3 --- code/devenv/Dockerfile | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/code/devenv/Dockerfile b/code/devenv/Dockerfile index 21d4f35..9dbd247 100644 --- a/code/devenv/Dockerfile +++ b/code/devenv/Dockerfile @@ -45,22 +45,20 @@ RUN apt-get install -y \ RUN curl -SL https://dl.google.com/go/go1.13.linux-amd64.tar.gz \ | tar -xzC /usr/local ENV PATH $PATH:/usr/local/go/bin -ENV GOPATH /root/gocode +ENV GOPATH /gocode +RUN mkdir -p $GOPATH ENV PATH $PATH:$GOPATH/bin # LND RUN go get -d github.com/lightningnetwork/lnd WORKDIR $GOPATH/src/github.com/lightningnetwork/lnd RUN make && make install -# -# # OpenJDK11 for eclair -# RUN mkdir -p /usr/src/openjdk \ -# && curl -SL https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.6%2B10/OpenJDK11U-jdk_x64_linux_hotspot_11.0.6_10.tar.gz \ -# | tar -xzC /usr/local -# ENV PATH $PATH:/usr/local/jdk-11.0.6+10/bin/ -# -# # eclair-node -# RUN mkdir -p /usr/src/eclair -# WORKDIR /usr/src/eclair -# RUN curl -SL https://github.com/ACINQ/eclair/releases/download/v0.3.3/eclair-node-0.3.3-12ac145.jar -o eclair-node.zip -# RUN unzip eclair-node.zip + +# OpenJDK11 for eclair +RUN apt install -y \ + openjdk-11-jdk + +# eclair-node +RUN mkdir -p /usr/src/eclair +WORKDIR /usr/src/eclair +RUN curl -SLO https://github.com/ACINQ/eclair/releases/download/v0.3.3/eclair-node-0.3.3-12ac145.jar From 7b491a92ad0c3f9f03e2ac0aa4988d9e320b7728 Mon Sep 17 00:00:00 2001 From: "Andreas M. Antonopoulos" Date: Mon, 2 Mar 2020 07:43:25 -0600 Subject: [PATCH 03/14] Separate dockerfiles and docker-compose --- code/docker/bitcoind-base/Dockerfile | 36 +++++++++++++++++++ code/docker/c-lightning-base/Dockerfile | 25 +++++++++++++ code/{ => docker}/devenv/Dockerfile | 1 + code/docker/docker-compose/docker-compose.yml | 26 ++++++++++++++ code/docker/eclair-base/Dockerfile | 23 ++++++++++++ code/docker/lnd-base/Dockerfile | 28 +++++++++++++++ 6 files changed, 139 insertions(+) create mode 100644 code/docker/bitcoind-base/Dockerfile create mode 100644 code/docker/c-lightning-base/Dockerfile rename code/{ => docker}/devenv/Dockerfile (96%) create mode 100644 code/docker/docker-compose/docker-compose.yml create mode 100644 code/docker/eclair-base/Dockerfile create mode 100644 code/docker/lnd-base/Dockerfile diff --git a/code/docker/bitcoind-base/Dockerfile b/code/docker/bitcoind-base/Dockerfile new file mode 100644 index 0000000..f18aa81 --- /dev/null +++ b/code/docker/bitcoind-base/Dockerfile @@ -0,0 +1,36 @@ +FROM ubuntu:18.04 + +# Install development tools prerequisites +RUN apt-get update && apt-get install -y \ + build-essential \ + libtool \ + autotools-dev \ + automake \ + pkg-config \ + python3 \ + wget \ + git \ + curl \ + unzip + +# Install additional Bitcoin Core (bitcoind) requirements +RUN apt-get install -y \ + libssl-dev \ + libevent-dev \ + bsdmainutils \ + libboost-system-dev \ + libboost-filesystem-dev \ + libboost-chrono-dev \ + libboost-test-dev \ + libboost-thread-dev \ + libminiupnpc-dev \ + libzmq3-dev + +# Install software-properties-common to add apt repositories +RUN apt-get install -y \ + software-properties-common + +# Add Bitcoin Core PPA repository +RUN add-apt-repository ppa:bitcoin/bitcoin +RUN apt-get update && apt-get install -y \ + bitcoind diff --git a/code/docker/c-lightning-base/Dockerfile b/code/docker/c-lightning-base/Dockerfile new file mode 100644 index 0000000..848cdba --- /dev/null +++ b/code/docker/c-lightning-base/Dockerfile @@ -0,0 +1,25 @@ +FROM ubuntu:18.04 + +# Install development tools prerequisites +RUN apt-get update && apt-get install -y \ + build-essential \ + libtool \ + autotools-dev \ + automake \ + pkg-config \ + python3 \ + wget \ + git \ + curl \ + unzip + + +# Install software-properties-common to add apt repositories +RUN apt-get install -y \ + software-properties-common + + +# c-lightning +RUN add-apt-repository -u ppa:lightningnetwork/ppa +RUN apt-get install -y \ + lightningd diff --git a/code/devenv/Dockerfile b/code/docker/devenv/Dockerfile similarity index 96% rename from code/devenv/Dockerfile rename to code/docker/devenv/Dockerfile index 9dbd247..4896237 100644 --- a/code/devenv/Dockerfile +++ b/code/docker/devenv/Dockerfile @@ -1,3 +1,4 @@ +# syntax = docker/dockerfile:1.0-experimental FROM ubuntu:18.04 # Install development tools prerequisites diff --git a/code/docker/docker-compose/docker-compose.yml b/code/docker/docker-compose/docker-compose.yml new file mode 100644 index 0000000..73245e5 --- /dev/null +++ b/code/docker/docker-compose/docker-compose.yml @@ -0,0 +1,26 @@ +version: "3.3" +services: + bitcoind-base: + container_name: bitcoind-base + build: + context: ../bitcoind-base/. + dockerfile: ./Dockerfile + image: lnbook/bitcoind_base:latest + c-lightning-base: + container_name: c-lightning-base + build: + context: ../c-lightning-base + dockerfile: ./Dockerfile + image: lnbook/c-lightning_base:latest + lnd-base: + container_name: lnd-base + build: + context: ../lnd-base + dockerfile: ./Dockerfile + image: lnbook/lnd_base:latest + eclair-base: + container_name: eclair-base + build: + context: ../eclair-base + dockerfile: ./Dockerfile + image: lnbook/eclair_base:latest diff --git a/code/docker/eclair-base/Dockerfile b/code/docker/eclair-base/Dockerfile new file mode 100644 index 0000000..f6f7fdc --- /dev/null +++ b/code/docker/eclair-base/Dockerfile @@ -0,0 +1,23 @@ +FROM ubuntu:18.04 + +# Install development tools prerequisites +RUN apt-get update && apt-get install -y \ + build-essential \ + libtool \ + autotools-dev \ + automake \ + pkg-config \ + python3 \ + wget \ + git \ + curl \ + unzip + +# OpenJDK11 for eclair +RUN apt install -y \ + openjdk-11-jdk + +# eclair-node +RUN mkdir -p /usr/src/eclair +WORKDIR /usr/src/eclair +RUN curl -SLO https://github.com/ACINQ/eclair/releases/download/v0.3.3/eclair-node-0.3.3-12ac145.jar diff --git a/code/docker/lnd-base/Dockerfile b/code/docker/lnd-base/Dockerfile new file mode 100644 index 0000000..218ba27 --- /dev/null +++ b/code/docker/lnd-base/Dockerfile @@ -0,0 +1,28 @@ +FROM ubuntu:18.04 + +# Install development tools prerequisites +RUN apt-get update && apt-get install -y \ + build-essential \ + libtool \ + autotools-dev \ + automake \ + pkg-config \ + python3 \ + wget \ + git \ + curl \ + unzip + + +# Go 1.13 for LND +RUN curl -SL https://dl.google.com/go/go1.13.linux-amd64.tar.gz \ + | tar -xzC /usr/local +ENV PATH $PATH:/usr/local/go/bin +ENV GOPATH /gocode +RUN mkdir -p $GOPATH +ENV PATH $PATH:$GOPATH/bin + +# LND +RUN go get -d github.com/lightningnetwork/lnd +WORKDIR $GOPATH/src/github.com/lightningnetwork/lnd +RUN make && make install From 3b854531c1c79198aae0f51e4c3638b4ef11865c Mon Sep 17 00:00:00 2001 From: "Andreas M. Antonopoulos" Date: Thu, 5 Mar 2020 12:15:08 -0600 Subject: [PATCH 04/14] Use golang docker image for lnd_base --- code/docker/lnd-base/Dockerfile | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/code/docker/lnd-base/Dockerfile b/code/docker/lnd-base/Dockerfile index 218ba27..6754d4f 100644 --- a/code/docker/lnd-base/Dockerfile +++ b/code/docker/lnd-base/Dockerfile @@ -1,26 +1,6 @@ -FROM ubuntu:18.04 +FROM golang:1.13 -# Install development tools prerequisites -RUN apt-get update && apt-get install -y \ - build-essential \ - libtool \ - autotools-dev \ - automake \ - pkg-config \ - python3 \ - wget \ - git \ - curl \ - unzip - - -# Go 1.13 for LND -RUN curl -SL https://dl.google.com/go/go1.13.linux-amd64.tar.gz \ - | tar -xzC /usr/local -ENV PATH $PATH:/usr/local/go/bin -ENV GOPATH /gocode -RUN mkdir -p $GOPATH -ENV PATH $PATH:$GOPATH/bin +WORKDIR /go/src/ # LND RUN go get -d github.com/lightningnetwork/lnd From d7ff4c65f67b99d71ba63aa4bb2e6aff317c4e73 Mon Sep 17 00:00:00 2001 From: "Andreas M. Antonopoulos" Date: Thu, 5 Mar 2020 12:15:27 -0600 Subject: [PATCH 05/14] Use openjdk:11 docker image for eclair --- code/docker/eclair-base/Dockerfile | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/code/docker/eclair-base/Dockerfile b/code/docker/eclair-base/Dockerfile index f6f7fdc..558fdfa 100644 --- a/code/docker/eclair-base/Dockerfile +++ b/code/docker/eclair-base/Dockerfile @@ -1,21 +1,4 @@ -FROM ubuntu:18.04 - -# Install development tools prerequisites -RUN apt-get update && apt-get install -y \ - build-essential \ - libtool \ - autotools-dev \ - automake \ - pkg-config \ - python3 \ - wget \ - git \ - curl \ - unzip - -# OpenJDK11 for eclair -RUN apt install -y \ - openjdk-11-jdk +FROM openjdk:11 # eclair-node RUN mkdir -p /usr/src/eclair From ba57fe3f8421cccf671569a4be1afa822e7c5b19 Mon Sep 17 00:00:00 2001 From: "Andreas M. Antonopoulos" Date: Thu, 5 Mar 2020 12:15:41 -0600 Subject: [PATCH 06/14] bitcoind regtest docker image --- code/docker/bitcoind-regtest/Dockerfile | 10 ++++++++++ .../docker/bitcoind-regtest/bitcoind/bitcoin.conf | 15 +++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 code/docker/bitcoind-regtest/Dockerfile create mode 100644 code/docker/bitcoind-regtest/bitcoind/bitcoin.conf diff --git a/code/docker/bitcoind-regtest/Dockerfile b/code/docker/bitcoind-regtest/Dockerfile new file mode 100644 index 0000000..4956a47 --- /dev/null +++ b/code/docker/bitcoind-regtest/Dockerfile @@ -0,0 +1,10 @@ +FROM bitcoind_base:latest + +ADD bitcoind /bitcoind +WORKDIR /bitcoind + +EXPOSE 12001 + +RUN ln -sf /dev/stdout /bitcoind/debug.log + +CMD ["bitcoind", "-datadir=/bitcoind"] diff --git a/code/docker/bitcoind-regtest/bitcoind/bitcoin.conf b/code/docker/bitcoind-regtest/bitcoind/bitcoin.conf new file mode 100644 index 0000000..2577ef0 --- /dev/null +++ b/code/docker/bitcoind-regtest/bitcoind/bitcoin.conf @@ -0,0 +1,15 @@ +regtest=1 +dnsseed=0 +upnp=0 +server=1 +debuglogfile=debug.log +debug=1 +printtoconsole=0 + +[regtest] +port=12000 +rpcport=12001 +rpcbind=0.0.0.0 +rpcallowip=0.0.0.0/0 +rpcuser=regtest +rpcpassword=regtest From e84677b1c4bd627775540a9a972958ff8870424e Mon Sep 17 00:00:00 2001 From: "Andreas M. Antonopoulos" Date: Sun, 19 Apr 2020 16:13:18 -0400 Subject: [PATCH 07/14] updates --- code/docker/bitcoind-regtest/Dockerfile | 10 +++++-- code/docker/docker-compose/docker-compose.yml | 30 +++++++------------ code/docker/lnd-run/Dockerfile | 5 ++++ code/docker/lnd-run/lnd/lnd.conf | 16 ++++++++++ 4 files changed, 39 insertions(+), 22 deletions(-) create mode 100644 code/docker/lnd-run/Dockerfile create mode 100644 code/docker/lnd-run/lnd/lnd.conf diff --git a/code/docker/bitcoind-regtest/Dockerfile b/code/docker/bitcoind-regtest/Dockerfile index 4956a47..2e75622 100644 --- a/code/docker/bitcoind-regtest/Dockerfile +++ b/code/docker/bitcoind-regtest/Dockerfile @@ -2,9 +2,15 @@ FROM bitcoind_base:latest ADD bitcoind /bitcoind WORKDIR /bitcoind +RUN ln -sf /dev/stdout /bitcoind/debug.log EXPOSE 12001 -RUN ln -sf /dev/stdout /bitcoind/debug.log -CMD ["bitcoind", "-datadir=/bitcoind"] +CMD bitcoind -datadir=/bitcoind -daemon \ + && sleep 2 \ + && address=$(bitcoin-cli -datadir=/bitcoind getnewaddress) \ + && bitcoin-cli -datadir=/bitcoind generatetoaddress 101 $address \ + && while sleep 10 \ + ; do bitcoin-cli -datadir=/bitcoind generatetoaddress 1 $address \ + ; done diff --git a/code/docker/docker-compose/docker-compose.yml b/code/docker/docker-compose/docker-compose.yml index 73245e5..8ca032b 100644 --- a/code/docker/docker-compose/docker-compose.yml +++ b/code/docker/docker-compose/docker-compose.yml @@ -1,26 +1,16 @@ version: "3.3" services: - bitcoind-base: - container_name: bitcoind-base + bitcoind-regtest: + container_name: bitcoind-regtest build: - context: ../bitcoind-base/. + context: ../bitcoind-regtest/. dockerfile: ./Dockerfile - image: lnbook/bitcoind_base:latest - c-lightning-base: - container_name: c-lightning-base + image: lnbook/bitcoind_regtest:latest + ports: + - "12001:12001" + lnd-run: + container_name: lnd-run build: - context: ../c-lightning-base + context: ../lnd-run dockerfile: ./Dockerfile - image: lnbook/c-lightning_base:latest - lnd-base: - container_name: lnd-base - build: - context: ../lnd-base - dockerfile: ./Dockerfile - image: lnbook/lnd_base:latest - eclair-base: - container_name: eclair-base - build: - context: ../eclair-base - dockerfile: ./Dockerfile - image: lnbook/eclair_base:latest + image: lnbook/lnd_run:latest diff --git a/code/docker/lnd-run/Dockerfile b/code/docker/lnd-run/Dockerfile new file mode 100644 index 0000000..3b46f57 --- /dev/null +++ b/code/docker/lnd-run/Dockerfile @@ -0,0 +1,5 @@ +FROM lnbook/lnd_base + +ADD lnd /lnd + +CMD lnd --lnddir=/lnd diff --git a/code/docker/lnd-run/lnd/lnd.conf b/code/docker/lnd-run/lnd/lnd.conf new file mode 100644 index 0000000..e5067e7 --- /dev/null +++ b/code/docker/lnd-run/lnd/lnd.conf @@ -0,0 +1,16 @@ +[Application Options] +no-macaroons=1 +rpclisten=0.0.0.0:18001 +restlisten=0.0.0.0:18080 +listen=0.0.0.0:19735 +nobootstrap=1 +debug=1 + +[bitcoin] +bitcoin.active=1 +bitcoin.regtest=1 + +[bitcoind] +bitcoind.rpchost=localhost +bitcoind.rpcuser=regtest +bitcoind.rpcpass=regtest From 9844fdee0f7550a038720c330d3f64b8ef4284d2 Mon Sep 17 00:00:00 2001 From: "Andreas M. Antonopoulos" Date: Mon, 24 Feb 2020 17:24:35 -0600 Subject: [PATCH 08/14] Development Environment: Dockerfile draft Installs dev tools, bitcoind, c-lightning, lnd --- code/devenv/Dockerfile | 66 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 code/devenv/Dockerfile diff --git a/code/devenv/Dockerfile b/code/devenv/Dockerfile new file mode 100644 index 0000000..21d4f35 --- /dev/null +++ b/code/devenv/Dockerfile @@ -0,0 +1,66 @@ +FROM ubuntu:18.04 + +# Install development tools prerequisites +RUN apt-get update && apt-get install -y \ + build-essential \ + libtool \ + autotools-dev \ + automake \ + pkg-config \ + python3 \ + wget \ + git \ + curl \ + unzip + +# Install additional Bitcoin Core (bitcoind) requirements +RUN apt-get install -y \ + libssl-dev \ + libevent-dev \ + bsdmainutils \ + libboost-system-dev \ + libboost-filesystem-dev \ + libboost-chrono-dev \ + libboost-test-dev \ + libboost-thread-dev \ + libminiupnpc-dev \ + libzmq3-dev + +# Install software-properties-common to add apt repositories +RUN apt-get install -y \ + software-properties-common + +# Add Bitcoin Core PPA repository +RUN add-apt-repository ppa:bitcoin/bitcoin +RUN apt-get update && apt-get install -y \ + bitcoind + + +# c-lightning +RUN add-apt-repository -u ppa:lightningnetwork/ppa +RUN apt-get install -y \ + lightningd + +# Go 1.13 for LND +RUN curl -SL https://dl.google.com/go/go1.13.linux-amd64.tar.gz \ + | tar -xzC /usr/local +ENV PATH $PATH:/usr/local/go/bin +ENV GOPATH /root/gocode +ENV PATH $PATH:$GOPATH/bin + +# LND +RUN go get -d github.com/lightningnetwork/lnd +WORKDIR $GOPATH/src/github.com/lightningnetwork/lnd +RUN make && make install +# +# # OpenJDK11 for eclair +# RUN mkdir -p /usr/src/openjdk \ +# && curl -SL https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.6%2B10/OpenJDK11U-jdk_x64_linux_hotspot_11.0.6_10.tar.gz \ +# | tar -xzC /usr/local +# ENV PATH $PATH:/usr/local/jdk-11.0.6+10/bin/ +# +# # eclair-node +# RUN mkdir -p /usr/src/eclair +# WORKDIR /usr/src/eclair +# RUN curl -SL https://github.com/ACINQ/eclair/releases/download/v0.3.3/eclair-node-0.3.3-12ac145.jar -o eclair-node.zip +# RUN unzip eclair-node.zip From ed023ffa68c37029c703bb75515f1ed4e646816b Mon Sep 17 00:00:00 2001 From: "Andreas M. Antonopoulos" Date: Mon, 24 Feb 2020 20:12:19 -0600 Subject: [PATCH 09/14] Added eclair 0.3.3 --- code/devenv/Dockerfile | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/code/devenv/Dockerfile b/code/devenv/Dockerfile index 21d4f35..9dbd247 100644 --- a/code/devenv/Dockerfile +++ b/code/devenv/Dockerfile @@ -45,22 +45,20 @@ RUN apt-get install -y \ RUN curl -SL https://dl.google.com/go/go1.13.linux-amd64.tar.gz \ | tar -xzC /usr/local ENV PATH $PATH:/usr/local/go/bin -ENV GOPATH /root/gocode +ENV GOPATH /gocode +RUN mkdir -p $GOPATH ENV PATH $PATH:$GOPATH/bin # LND RUN go get -d github.com/lightningnetwork/lnd WORKDIR $GOPATH/src/github.com/lightningnetwork/lnd RUN make && make install -# -# # OpenJDK11 for eclair -# RUN mkdir -p /usr/src/openjdk \ -# && curl -SL https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.6%2B10/OpenJDK11U-jdk_x64_linux_hotspot_11.0.6_10.tar.gz \ -# | tar -xzC /usr/local -# ENV PATH $PATH:/usr/local/jdk-11.0.6+10/bin/ -# -# # eclair-node -# RUN mkdir -p /usr/src/eclair -# WORKDIR /usr/src/eclair -# RUN curl -SL https://github.com/ACINQ/eclair/releases/download/v0.3.3/eclair-node-0.3.3-12ac145.jar -o eclair-node.zip -# RUN unzip eclair-node.zip + +# OpenJDK11 for eclair +RUN apt install -y \ + openjdk-11-jdk + +# eclair-node +RUN mkdir -p /usr/src/eclair +WORKDIR /usr/src/eclair +RUN curl -SLO https://github.com/ACINQ/eclair/releases/download/v0.3.3/eclair-node-0.3.3-12ac145.jar From e5e36d95019cdd2e7456c20d1047aecabe040c54 Mon Sep 17 00:00:00 2001 From: "Andreas M. Antonopoulos" Date: Mon, 2 Mar 2020 07:43:25 -0600 Subject: [PATCH 10/14] Separate dockerfiles and docker-compose --- code/docker/bitcoind-base/Dockerfile | 36 +++++++++++++++++++ code/docker/c-lightning-base/Dockerfile | 25 +++++++++++++ code/{ => docker}/devenv/Dockerfile | 1 + code/docker/docker-compose/docker-compose.yml | 26 ++++++++++++++ code/docker/eclair-base/Dockerfile | 23 ++++++++++++ code/docker/lnd-base/Dockerfile | 28 +++++++++++++++ 6 files changed, 139 insertions(+) create mode 100644 code/docker/bitcoind-base/Dockerfile create mode 100644 code/docker/c-lightning-base/Dockerfile rename code/{ => docker}/devenv/Dockerfile (96%) create mode 100644 code/docker/docker-compose/docker-compose.yml create mode 100644 code/docker/eclair-base/Dockerfile create mode 100644 code/docker/lnd-base/Dockerfile diff --git a/code/docker/bitcoind-base/Dockerfile b/code/docker/bitcoind-base/Dockerfile new file mode 100644 index 0000000..f18aa81 --- /dev/null +++ b/code/docker/bitcoind-base/Dockerfile @@ -0,0 +1,36 @@ +FROM ubuntu:18.04 + +# Install development tools prerequisites +RUN apt-get update && apt-get install -y \ + build-essential \ + libtool \ + autotools-dev \ + automake \ + pkg-config \ + python3 \ + wget \ + git \ + curl \ + unzip + +# Install additional Bitcoin Core (bitcoind) requirements +RUN apt-get install -y \ + libssl-dev \ + libevent-dev \ + bsdmainutils \ + libboost-system-dev \ + libboost-filesystem-dev \ + libboost-chrono-dev \ + libboost-test-dev \ + libboost-thread-dev \ + libminiupnpc-dev \ + libzmq3-dev + +# Install software-properties-common to add apt repositories +RUN apt-get install -y \ + software-properties-common + +# Add Bitcoin Core PPA repository +RUN add-apt-repository ppa:bitcoin/bitcoin +RUN apt-get update && apt-get install -y \ + bitcoind diff --git a/code/docker/c-lightning-base/Dockerfile b/code/docker/c-lightning-base/Dockerfile new file mode 100644 index 0000000..848cdba --- /dev/null +++ b/code/docker/c-lightning-base/Dockerfile @@ -0,0 +1,25 @@ +FROM ubuntu:18.04 + +# Install development tools prerequisites +RUN apt-get update && apt-get install -y \ + build-essential \ + libtool \ + autotools-dev \ + automake \ + pkg-config \ + python3 \ + wget \ + git \ + curl \ + unzip + + +# Install software-properties-common to add apt repositories +RUN apt-get install -y \ + software-properties-common + + +# c-lightning +RUN add-apt-repository -u ppa:lightningnetwork/ppa +RUN apt-get install -y \ + lightningd diff --git a/code/devenv/Dockerfile b/code/docker/devenv/Dockerfile similarity index 96% rename from code/devenv/Dockerfile rename to code/docker/devenv/Dockerfile index 9dbd247..4896237 100644 --- a/code/devenv/Dockerfile +++ b/code/docker/devenv/Dockerfile @@ -1,3 +1,4 @@ +# syntax = docker/dockerfile:1.0-experimental FROM ubuntu:18.04 # Install development tools prerequisites diff --git a/code/docker/docker-compose/docker-compose.yml b/code/docker/docker-compose/docker-compose.yml new file mode 100644 index 0000000..73245e5 --- /dev/null +++ b/code/docker/docker-compose/docker-compose.yml @@ -0,0 +1,26 @@ +version: "3.3" +services: + bitcoind-base: + container_name: bitcoind-base + build: + context: ../bitcoind-base/. + dockerfile: ./Dockerfile + image: lnbook/bitcoind_base:latest + c-lightning-base: + container_name: c-lightning-base + build: + context: ../c-lightning-base + dockerfile: ./Dockerfile + image: lnbook/c-lightning_base:latest + lnd-base: + container_name: lnd-base + build: + context: ../lnd-base + dockerfile: ./Dockerfile + image: lnbook/lnd_base:latest + eclair-base: + container_name: eclair-base + build: + context: ../eclair-base + dockerfile: ./Dockerfile + image: lnbook/eclair_base:latest diff --git a/code/docker/eclair-base/Dockerfile b/code/docker/eclair-base/Dockerfile new file mode 100644 index 0000000..f6f7fdc --- /dev/null +++ b/code/docker/eclair-base/Dockerfile @@ -0,0 +1,23 @@ +FROM ubuntu:18.04 + +# Install development tools prerequisites +RUN apt-get update && apt-get install -y \ + build-essential \ + libtool \ + autotools-dev \ + automake \ + pkg-config \ + python3 \ + wget \ + git \ + curl \ + unzip + +# OpenJDK11 for eclair +RUN apt install -y \ + openjdk-11-jdk + +# eclair-node +RUN mkdir -p /usr/src/eclair +WORKDIR /usr/src/eclair +RUN curl -SLO https://github.com/ACINQ/eclair/releases/download/v0.3.3/eclair-node-0.3.3-12ac145.jar diff --git a/code/docker/lnd-base/Dockerfile b/code/docker/lnd-base/Dockerfile new file mode 100644 index 0000000..218ba27 --- /dev/null +++ b/code/docker/lnd-base/Dockerfile @@ -0,0 +1,28 @@ +FROM ubuntu:18.04 + +# Install development tools prerequisites +RUN apt-get update && apt-get install -y \ + build-essential \ + libtool \ + autotools-dev \ + automake \ + pkg-config \ + python3 \ + wget \ + git \ + curl \ + unzip + + +# Go 1.13 for LND +RUN curl -SL https://dl.google.com/go/go1.13.linux-amd64.tar.gz \ + | tar -xzC /usr/local +ENV PATH $PATH:/usr/local/go/bin +ENV GOPATH /gocode +RUN mkdir -p $GOPATH +ENV PATH $PATH:$GOPATH/bin + +# LND +RUN go get -d github.com/lightningnetwork/lnd +WORKDIR $GOPATH/src/github.com/lightningnetwork/lnd +RUN make && make install From 39d70405df6e533762647432560757a4759ea542 Mon Sep 17 00:00:00 2001 From: "Andreas M. Antonopoulos" Date: Thu, 5 Mar 2020 12:15:08 -0600 Subject: [PATCH 11/14] Use golang docker image for lnd_base --- code/docker/lnd-base/Dockerfile | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/code/docker/lnd-base/Dockerfile b/code/docker/lnd-base/Dockerfile index 218ba27..6754d4f 100644 --- a/code/docker/lnd-base/Dockerfile +++ b/code/docker/lnd-base/Dockerfile @@ -1,26 +1,6 @@ -FROM ubuntu:18.04 +FROM golang:1.13 -# Install development tools prerequisites -RUN apt-get update && apt-get install -y \ - build-essential \ - libtool \ - autotools-dev \ - automake \ - pkg-config \ - python3 \ - wget \ - git \ - curl \ - unzip - - -# Go 1.13 for LND -RUN curl -SL https://dl.google.com/go/go1.13.linux-amd64.tar.gz \ - | tar -xzC /usr/local -ENV PATH $PATH:/usr/local/go/bin -ENV GOPATH /gocode -RUN mkdir -p $GOPATH -ENV PATH $PATH:$GOPATH/bin +WORKDIR /go/src/ # LND RUN go get -d github.com/lightningnetwork/lnd From 6e5eecc1f850baeb8d4376b6b38a968406310b40 Mon Sep 17 00:00:00 2001 From: "Andreas M. Antonopoulos" Date: Thu, 5 Mar 2020 12:15:27 -0600 Subject: [PATCH 12/14] Use openjdk:11 docker image for eclair --- code/docker/eclair-base/Dockerfile | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/code/docker/eclair-base/Dockerfile b/code/docker/eclair-base/Dockerfile index f6f7fdc..558fdfa 100644 --- a/code/docker/eclair-base/Dockerfile +++ b/code/docker/eclair-base/Dockerfile @@ -1,21 +1,4 @@ -FROM ubuntu:18.04 - -# Install development tools prerequisites -RUN apt-get update && apt-get install -y \ - build-essential \ - libtool \ - autotools-dev \ - automake \ - pkg-config \ - python3 \ - wget \ - git \ - curl \ - unzip - -# OpenJDK11 for eclair -RUN apt install -y \ - openjdk-11-jdk +FROM openjdk:11 # eclair-node RUN mkdir -p /usr/src/eclair From 98fa63d338c0ad94fcaf36f217d372bed6f46a76 Mon Sep 17 00:00:00 2001 From: "Andreas M. Antonopoulos" Date: Thu, 5 Mar 2020 12:15:41 -0600 Subject: [PATCH 13/14] bitcoind regtest docker image --- code/docker/bitcoind-regtest/Dockerfile | 10 ++++++++++ .../docker/bitcoind-regtest/bitcoind/bitcoin.conf | 15 +++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 code/docker/bitcoind-regtest/Dockerfile create mode 100644 code/docker/bitcoind-regtest/bitcoind/bitcoin.conf diff --git a/code/docker/bitcoind-regtest/Dockerfile b/code/docker/bitcoind-regtest/Dockerfile new file mode 100644 index 0000000..4956a47 --- /dev/null +++ b/code/docker/bitcoind-regtest/Dockerfile @@ -0,0 +1,10 @@ +FROM bitcoind_base:latest + +ADD bitcoind /bitcoind +WORKDIR /bitcoind + +EXPOSE 12001 + +RUN ln -sf /dev/stdout /bitcoind/debug.log + +CMD ["bitcoind", "-datadir=/bitcoind"] diff --git a/code/docker/bitcoind-regtest/bitcoind/bitcoin.conf b/code/docker/bitcoind-regtest/bitcoind/bitcoin.conf new file mode 100644 index 0000000..2577ef0 --- /dev/null +++ b/code/docker/bitcoind-regtest/bitcoind/bitcoin.conf @@ -0,0 +1,15 @@ +regtest=1 +dnsseed=0 +upnp=0 +server=1 +debuglogfile=debug.log +debug=1 +printtoconsole=0 + +[regtest] +port=12000 +rpcport=12001 +rpcbind=0.0.0.0 +rpcallowip=0.0.0.0/0 +rpcuser=regtest +rpcpassword=regtest From 1672b0b2d8e5429db40936098cf51e05dc9fea71 Mon Sep 17 00:00:00 2001 From: "Andreas M. Antonopoulos" Date: Sun, 19 Apr 2020 16:13:18 -0400 Subject: [PATCH 14/14] updates --- code/docker/bitcoind-regtest/Dockerfile | 10 +++++-- code/docker/docker-compose/docker-compose.yml | 30 +++++++------------ code/docker/lnd-run/Dockerfile | 5 ++++ code/docker/lnd-run/lnd/lnd.conf | 16 ++++++++++ 4 files changed, 39 insertions(+), 22 deletions(-) create mode 100644 code/docker/lnd-run/Dockerfile create mode 100644 code/docker/lnd-run/lnd/lnd.conf diff --git a/code/docker/bitcoind-regtest/Dockerfile b/code/docker/bitcoind-regtest/Dockerfile index 4956a47..2e75622 100644 --- a/code/docker/bitcoind-regtest/Dockerfile +++ b/code/docker/bitcoind-regtest/Dockerfile @@ -2,9 +2,15 @@ FROM bitcoind_base:latest ADD bitcoind /bitcoind WORKDIR /bitcoind +RUN ln -sf /dev/stdout /bitcoind/debug.log EXPOSE 12001 -RUN ln -sf /dev/stdout /bitcoind/debug.log -CMD ["bitcoind", "-datadir=/bitcoind"] +CMD bitcoind -datadir=/bitcoind -daemon \ + && sleep 2 \ + && address=$(bitcoin-cli -datadir=/bitcoind getnewaddress) \ + && bitcoin-cli -datadir=/bitcoind generatetoaddress 101 $address \ + && while sleep 10 \ + ; do bitcoin-cli -datadir=/bitcoind generatetoaddress 1 $address \ + ; done diff --git a/code/docker/docker-compose/docker-compose.yml b/code/docker/docker-compose/docker-compose.yml index 73245e5..8ca032b 100644 --- a/code/docker/docker-compose/docker-compose.yml +++ b/code/docker/docker-compose/docker-compose.yml @@ -1,26 +1,16 @@ version: "3.3" services: - bitcoind-base: - container_name: bitcoind-base + bitcoind-regtest: + container_name: bitcoind-regtest build: - context: ../bitcoind-base/. + context: ../bitcoind-regtest/. dockerfile: ./Dockerfile - image: lnbook/bitcoind_base:latest - c-lightning-base: - container_name: c-lightning-base + image: lnbook/bitcoind_regtest:latest + ports: + - "12001:12001" + lnd-run: + container_name: lnd-run build: - context: ../c-lightning-base + context: ../lnd-run dockerfile: ./Dockerfile - image: lnbook/c-lightning_base:latest - lnd-base: - container_name: lnd-base - build: - context: ../lnd-base - dockerfile: ./Dockerfile - image: lnbook/lnd_base:latest - eclair-base: - container_name: eclair-base - build: - context: ../eclair-base - dockerfile: ./Dockerfile - image: lnbook/eclair_base:latest + image: lnbook/lnd_run:latest diff --git a/code/docker/lnd-run/Dockerfile b/code/docker/lnd-run/Dockerfile new file mode 100644 index 0000000..3b46f57 --- /dev/null +++ b/code/docker/lnd-run/Dockerfile @@ -0,0 +1,5 @@ +FROM lnbook/lnd_base + +ADD lnd /lnd + +CMD lnd --lnddir=/lnd diff --git a/code/docker/lnd-run/lnd/lnd.conf b/code/docker/lnd-run/lnd/lnd.conf new file mode 100644 index 0000000..e5067e7 --- /dev/null +++ b/code/docker/lnd-run/lnd/lnd.conf @@ -0,0 +1,16 @@ +[Application Options] +no-macaroons=1 +rpclisten=0.0.0.0:18001 +restlisten=0.0.0.0:18080 +listen=0.0.0.0:19735 +nobootstrap=1 +debug=1 + +[bitcoin] +bitcoin.active=1 +bitcoin.regtest=1 + +[bitcoind] +bitcoind.rpchost=localhost +bitcoind.rpcuser=regtest +bitcoind.rpcpass=regtest