-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9a00ccb
commit 03b3d12
Showing
15 changed files
with
232 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
FROM golang:1.13.9-alpine3.10 as builder | ||
RUN apk add --no-cache bash git make gcc musl-dev | ||
RUN git clone -b v0.9.0-beta https://github.com/ltcsuite/lnd $GOPATH/src/github.com/ltcsuite/lnd | ||
WORKDIR $GOPATH/src/github.com/ltcsuite/lnd | ||
ADD patches /tmp/patches/ | ||
RUN go mod vendor | ||
RUN patch vendor/github.com/ltcsuite/neutrino/chainsync/filtercontrol.go /tmp/patches/checkpoints.patch | ||
RUN go install -v -mod=vendor -tags="invoicesrpc" ./cmd/lnd ./cmd/lncli | ||
|
||
# Final stage | ||
FROM alpine:3.10 | ||
RUN apk add --no-cache bash expect supervisor tor | ||
COPY --from=builder /go/bin/lnd /go/bin/lncli /usr/local/bin/ | ||
COPY entrypoint.sh wait-file.sh start_tor.sh / | ||
COPY lnd.conf /root | ||
COPY supervisord.conf /etc/supervisor/conf.d/ | ||
COPY torrc /etc/tor/ | ||
VOLUME [ "/root/.lnd" ] | ||
RUN mkdir -p /root/.lnd/tor | ||
ENTRYPOINT ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"] | ||
EXPOSE 10009 9735 19735 10735 20735 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
images/lnd/0.9.0-beta/lnd-ltc.conf → images/lnd/0.9.0-beta-ltc/lnd.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
debuglevel=debug | ||
rpclisten=0.0.0.0:10009 | ||
restlisten=0.0.0.0:8080 | ||
max-cltv-expiry=20000 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
diff --git a/chainsync/filtercontrol.go b/chainsync/filtercontrol.go | ||
index b710cd0d..be7ab155 100644 | ||
--- a/chainsync/filtercontrol.go | ||
+++ b/chainsync/filtercontrol.go | ||
@@ -37,9 +37,9 @@ var filterHeaderCheckpoints = map[wire.BitcoinNet]map[uint32]*chainhash.Hash{ | ||
1301000: hashFromStr("0074cd8e4c41407320ca0b3d640265114ec184ae29970a9ab04d6d7e6c67cc43"), | ||
1403000: hashFromStr("b99e248cea04bdcf8cc988ea5ebc91b6e7a190c6896a9df718f1b702cf636b28"), | ||
1505000: hashFromStr("ffdf8b4637b533a5848563d8541a116c3cf1584bef07a05fd11ed4ba0b61e10c"), | ||
- 1603000: hashFromStr("c2c90fb353716039127ca73f8535c35e706247eb3d8a11d87fb4f16b9d65bd7e"), | ||
- 1701000: hashFromStr("d7e61b0749447415ee235ce0ca1f470a43da9ffa6d896ffb516f0a60ce8e3830"), | ||
- 1781000: hashFromStr("a65460c214fa771ee389cf50b5b586b2bba42a9ed70f6d93a172b553f5331987"), | ||
+ 1603000: hashFromStr("c9c115714f37e5e325effc9a386a5659844a5abfa6c25695fd591c4a61933b13"), | ||
+ 1701000: hashFromStr("f6bee45920a347c2b245a5c9796c20268c27bc7143c7c62ac0ac2cc9b5dcdace"), | ||
+ 1781000: hashFromStr("6d2505ff9d8ecaa573db0bb3aa34fc48986de30a39d29c3137333d753ae2b868"), | ||
}, | ||
|
||
// Testnet filter header checkpoints. | ||
@@ -48,11 +48,11 @@ var filterHeaderCheckpoints = map[wire.BitcoinNet]map[uint32]*chainhash.Hash{ | ||
101000: hashFromStr("8b54ceec6cde1f1b20e6ac2b28dcf3d72c51799760e625b156fca8b7c5c0a558"), | ||
303000: hashFromStr("3ff217c2f372bc3bb7273e085906183f8afac1858922c710e05d2f961357b21f"), | ||
505000: hashFromStr("1b7ebeabbcc37731932b09a68f36b4a3a54aa6067805a3ea6c057d866e8549d1"), | ||
- 707000: hashFromStr("8655245633fb4970c1bd1138510d77fa2ca46dd562595ce16fb7858ee16c326b"), | ||
- 909000: hashFromStr("d1970e74d93cb8d57e8f68b73bbe75081d965019b9e0e0974e2c379cc33074d7"), | ||
- 1111000: hashFromStr("211dd22de8fcfde9fba0dbecc609ec8f757ec72f886d6a541a31859a3bc4567d"), | ||
- 1313000: hashFromStr("d7390b6fb9387d1222f98d0f8f3c47708b018d03f4ebb6df1951c1a73197df81"), | ||
- 1351000: hashFromStr("2cf080309f34762bb630b9be46da3dd110cd272f6045092f1f255a4d179192f6"), | ||
+ 707000: hashFromStr("ec15c1a28981cb19096b5b9aea2f2389fc41e755a1b0228f27f2976d50851e21"), | ||
+ 909000: hashFromStr("cd51428ecfbe42bcd3920c42eaa1ad14d5b2eecff7d8a57d70df9e0b247f5b4a"), | ||
+ 1111000: hashFromStr("52a74833414ded5b7bdc7e274b0107569adcdb09cdd9f75bf25ad8793aac437c"), | ||
+ 1313000: hashFromStr("c81c0db37c5bcf27ba973215770a8a17630cb85db5035f898c94d1964b9b856a"), | ||
+ 1351000: hashFromStr("fd0d8cd62d0ce53ae003c5bd32db4943f330e4a1cc9ea09be6a34325085016e4"), | ||
}, | ||
} | ||
|
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
set -m | ||
. /wait-file.sh | ||
|
||
SCRIPT_PATH=$(dirname "$0") | ||
cd "$SCRIPT_PATH" || exit 1 | ||
|
||
LND_DIR="/root/.lnd" | ||
mkdir -p $LND_DIR | ||
|
||
if [[ ! -e $LND_DIR/lnd.conf ]]; then | ||
cp /root/lnd.conf $LND_DIR/lnd.conf | ||
fi | ||
|
||
NEUTRINO=${NEUTRINO:-} | ||
|
||
if [ ! -z ${NEUTRINO} ]; then | ||
PEERS="[neutrino]\n" | ||
|
||
case $CHAIN in | ||
bitcoin) | ||
case $NETWORK in | ||
testnet) | ||
PEERS="${PEERS}neutrino.connect=159.203.125.125:18333\nneutrino.connect=64.79.152.132:18333\nneutrino.connect=167.71.109.195:18333\nneutrino.connect=178.128.0.29:18333" | ||
;; | ||
mainnet) | ||
PEERS="${PEERS}neutrino.connect=69.143.97.89:8333\nneutrino.connect=73.31.42.95:8333\nneutrino.connect=96.9.244.139:8333\nneutrino.connect=138.68.244.82:8333" | ||
;; | ||
esac | ||
;; | ||
litecoin) | ||
case $NETWORK in | ||
testnet) | ||
PEERS="${PEERS}neutrino.connect=ltcd.michael1011.at:19335\nneutrino.connect=ltcd.servebeer.com:54795" | ||
;; | ||
mainnet) | ||
PEERS="${PEERS}neutrino.connect=ltcd.michael1011.at:9333\nneutrino.connect=ltcd.servebeer.com:9333" | ||
;; | ||
esac | ||
;; | ||
esac | ||
|
||
echo "[DEBUG] Enabling neutrino" | ||
case $CHAIN in | ||
bitcoin) | ||
sed -i "s/bitcoin.node=bitcoind/bitcoin.node=neutrino\n\n${PEERS}/g" $LND_DIR/lnd.conf | ||
;; | ||
litecoin) | ||
sed -i "s/litecoin.node=litecoind/litecoin.node=neutrino\n\n${PEERS}/g" $LND_DIR/lnd.conf | ||
;; | ||
esac | ||
fi | ||
|
||
set +e | ||
|
||
[[ -n ${RPCHOST:-} ]] && sed -i "s/rpchost.*/rpchost=$RPCHOST/g" $LND_DIR/lnd.conf | ||
[[ -n ${RPCUSER:-} ]] && sed -i "s/rpcuser.*/rpcuser=$RPCUSER/g" $LND_DIR/lnd.conf | ||
[[ -n ${RPCPASS:-} ]] && sed -i "s/rpcpass.*/rpcpass=$RPCPASS/g" $LND_DIR/lnd.conf | ||
[[ -n ${ZMQPUBRAWBLOCK:-} ]] && sed -i "s|zmqpubrawblock.*|zmqpubrawblock=$ZMQPUBRAWBLOCK|g" $LND_DIR/lnd.conf | ||
[[ -n ${ZMQPUBRAWTX:-} ]] && sed -i "s|zmqpubrawtx.*|zmqpubrawtx=$ZMQPUBRAWTX|g" $LND_DIR/lnd.conf | ||
|
||
set -e | ||
|
||
LND_HOSTNAME="$HOME/.lnd/tor/hostname" | ||
echo "Waiting for lnd-$CHAIN onion address..." | ||
|
||
wait_file "$LND_HOSTNAME" && { | ||
LND_ONION_ADDRESS=$(cat "$LND_HOSTNAME") | ||
echo "Onion address for lnd-$CHAIN is $LND_ONION_ADDRESS" | ||
# mark lnd as locked before starting | ||
touch "$HOME/.lnd/wallet.lock" | ||
# notify peers.sh to bootstrap peers | ||
touch "$HOME/.lnd/peers.lock" | ||
|
||
case $CHAIN in | ||
bitcoin) | ||
PORT=9735 | ||
;; | ||
litecoin) | ||
PORT=10735 | ||
;; | ||
esac | ||
|
||
case $NETWORK in | ||
testnet) | ||
PORT=$((PORT + 10000)) | ||
;; | ||
esac | ||
|
||
if [ -z ${EXTERNAL_IP+x} ]; then | ||
lnd --$CHAIN.$NETWORK --lnddir=$LND_DIR --externalip="$LND_ONION_ADDRESS:$PORT" --listen="0.0.0.0:$PORT" | ||
else | ||
lnd --$CHAIN.$NETWORK --lnddir=$LND_DIR --externalip="$LND_ONION_ADDRESS:$PORT" --externalip="$EXTERNAL_IP:$PORT" --listen="0.0.0.0:$PORT" | ||
fi | ||
} || exit 1 |
1 change: 0 additions & 1 deletion
1
images/lnd/0.9.0-beta/lnd-btc.conf → images/lnd/0.9.2-beta/lnd.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
debuglevel=debug | ||
rpclisten=0.0.0.0:10009 | ||
restlisten=0.0.0.0:8080 | ||
max-cltv-expiry=5000 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env bash | ||
|
||
case $CHAIN in | ||
bitcoin) | ||
PORT=9735 | ||
;; | ||
litecoin) | ||
PORT=10735 | ||
;; | ||
esac | ||
|
||
if [[ $NETWORK == "testnet" ]]; then | ||
PORT=$((PORT + 10000)) | ||
fi | ||
|
||
sed -i "s/<port>/$PORT/g" /etc/tor/torrc | ||
|
||
tor -f /etc/tor/torrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[supervisord] | ||
nodaemon=true | ||
logfile=/root/supervisord.log | ||
childlogdir=/root | ||
user=root | ||
|
||
[program:tor] | ||
stdout_logfile=/dev/stdout | ||
stdout_logfile_maxbytes=0 | ||
command=/start_tor.sh | ||
|
||
[program:lnd] | ||
stdout_logfile=/dev/stdout | ||
stdout_logfile_maxbytes=0 | ||
command=/entrypoint.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters