Docker eclair initial setup

pull/264/head
Andreas M. Antonopoulos 4 years ago
parent a60a3c89f9
commit 975df977ac

@ -1,6 +0,0 @@
FROM openjdk:11
# 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

@ -0,0 +1,27 @@
FROM ubuntu:18.04 AS eclair-base
RUN apt update && apt install -yqq \
curl gosu jq bash-completion
RUN apt update && apt install -yqq \
openjdk-11-jdk unzip
# Install eclair
ENV ECLAIR_VER 0.4
ENV ECLAIR_COMMIT 69c538e
WORKDIR /usr/src
RUN curl -sLO https://github.com/ACINQ/eclair/releases/download/v${ECLAIR_VER}/eclair-node-${ECLAIR_VER}-${ECLAIR_COMMIT}-bin.zip
RUN unzip eclair-node-${ECLAIR_VER}-${ECLAIR_COMMIT}-bin.zip -d eclair
ADD eclair /eclair
WORKDIR /eclair
RUN ln -s /eclair /root/.eclair
ADD bashrc /root/.bashrc
ADD eclair-entrypoint.sh /usr/local/bin
RUN chmod +x /usr/local/bin/eclair-entrypoint.sh
ADD fund-eclair.sh /usr/local/bin
RUN chmod +x /usr/local/bin/fund-eclair.sh
EXPOSE 9735
ENTRYPOINT ["/usr/local/bin/eclair-entrypoint.sh"]

@ -0,0 +1,4 @@
# alias lightning-cli="lightning-cli --network regtest --lightning-dir=/lightningd"
#
# [[ $PS1 && -f /usr/share/bash-completion/bash_completion ]] && \
# . /usr/share/bash-completion/bash_completion

@ -0,0 +1,22 @@
#!/bin/bash
set -Eeuo pipefail
echo Starting eclair...
# bitcoind -datadir=/bitcoind -daemon
# until bitcoin-cli -datadir=/bitcoind getblockchaininfo > /dev/null 2>&1
# do
# sleep 1
# done
# echo bitcoind started
# export address=`cat /bitcoind/keys/demo_address.txt`
# export privkey=`cat /bitcoind/keys/demo_privkey.txt`
# echo "================================================"
# echo "Importing demo private key"
# echo "Bitcoin address: " ${address}
# echo "Private key: " ${privkey}
# echo "================================================"
# bitcoin-cli -datadir=/bitcoind importprivkey $privkey
# Executing CMD
echo "$@"
exec "$@"

@ -0,0 +1,22 @@
#!/bin/bash
set -Eeuo pipefail
# Generate a new receiving address for LND wallet
address=$(lightning-cli --lightning-dir=/lightningd --network regtest newaddr | jq .address)
# Ask Bitcoin Core to send 10 BTC to the address, using JSON-RPC call
curl --user regtest:regtest \
-H 'content-type: text/plain;' \
http://bitcoind:18443/ \
--data-binary @- <<EOF
{
"jsonrpc": "1.0",
"id": "c-lightning-container",
"method": "sendtoaddress",
"params": [
${address},
10,
"funding c-lightning"
]
}
EOF
Loading…
Cancel
Save