mirror of
https://github.com/Ride-The-Lightning/RTL.git
synced 2024-11-19 09:50:36 +01:00
parent
a624b6a76e
commit
bcf650ba67
19
docker/.env
Normal file
19
docker/.env
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
BITCOIN_HOST=bitcoind
|
||||||
|
BITCOIN_PORT=18889
|
||||||
|
BITCOIN_RPC_USER=bitcoin
|
||||||
|
BITCOIN_RPC_PASSWORD=bitcoin
|
||||||
|
BITCOIN_RPC_PORT=18888
|
||||||
|
BITCOIN_ZMQ_TX_PORT=28888
|
||||||
|
BITCOIN_ZMQ_BLOCK_PORT=28889
|
||||||
|
|
||||||
|
LIGHTNING_HOST=lnd
|
||||||
|
LIGHTNING_PORT=9735
|
||||||
|
LIGHTNING_RPC_PORT=10009
|
||||||
|
LIGHTNING_REST_PORT=8080
|
||||||
|
|
||||||
|
RTL_PORT=3000
|
||||||
|
RTL_NODE_AUTH_TYPE=CUSTOM
|
||||||
|
RTL_PASS=changeme
|
||||||
|
|
||||||
|
COMPOSE_FILE=docker-compose.yml
|
||||||
|
COMPOSE_PROJECT_NAME=rtldev
|
51
docker/README.md
Normal file
51
docker/README.md
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
# RTL Docker Dev Setup
|
||||||
|
|
||||||
|
### This is not suitable for production deployments. ONLY FOR DEVELOPMENT.
|
||||||
|
|
||||||
|
This `docker-compose` template launches `bitcoind`, `lnd` and `rtl` containers.
|
||||||
|
|
||||||
|
It is configured to run in **regtest** mode but can be modified to suit your needs.
|
||||||
|
|
||||||
|
### Notes
|
||||||
|
- `bitcoind` is built from an Ubuntu repository and should not be used in production.
|
||||||
|
- `lnd` will not sync to chain until Bitcoin regtest blocks are generated (see below).
|
||||||
|
- `rtl` image is from the Docker Hub repository but you can change this to your needs.
|
||||||
|
- Various ports and configs can be adjusted in the `.env` or `docker-compose.yml` files.
|
||||||
|
|
||||||
|
## How to run
|
||||||
|
It may take several minutes if containers need to be built. From the terminal in this folder:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ docker-compose up -d bitcoind
|
||||||
|
$ bin/b-cli generate 101
|
||||||
|
$ docker-compose up -d lnd rtl
|
||||||
|
```
|
||||||
|
|
||||||
|
Check containers are up and running with:
|
||||||
|
```
|
||||||
|
$ docker-compose ps
|
||||||
|
```
|
||||||
|
|
||||||
|
Use the cli tools to get responses from the containers:
|
||||||
|
```
|
||||||
|
$ bin/ln-cli getinfo
|
||||||
|
$ bin/b-cli getblockchaininfo
|
||||||
|
```
|
||||||
|
|
||||||
|
View daemon logs as follows:
|
||||||
|
```
|
||||||
|
$ docker-compose logs bitcoind lnd rtl
|
||||||
|
```
|
||||||
|
|
||||||
|
Once the containers are running you can access the RTL UI at http://localhost:3000
|
||||||
|
|
||||||
|
- Default password is `changeme`.
|
||||||
|
- Default host, port and password can be changed in `.env`.
|
||||||
|
|
||||||
|
When you are done you can destroy containers with:
|
||||||
|
```
|
||||||
|
$ docker-compose down -v
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
@hashamadeus on Twitter
|
10
docker/bin/b-cli
Executable file
10
docker/bin/b-cli
Executable file
@ -0,0 +1,10 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
source .env
|
||||||
|
|
||||||
|
docker-compose exec bitcoind bitcoin-cli \
|
||||||
|
-datadir=/bitcoin \
|
||||||
|
-rpcuser=$BITCOIN_RPC_USER \
|
||||||
|
-rpcpassword=$BITCOIN_RPC_PASSWORD \
|
||||||
|
-rpcport=$BITCOIN_RPC_PORT \
|
||||||
|
"$@"
|
8
docker/bin/ln-cli
Executable file
8
docker/bin/ln-cli
Executable file
@ -0,0 +1,8 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
source .env
|
||||||
|
|
||||||
|
docker-compose exec lnd lncli \
|
||||||
|
--macaroonpath /shared/admin.macaroon \
|
||||||
|
--tlscertpath /shared/tls.cert \
|
||||||
|
"$@"
|
10
docker/bitcoind/Dockerfile
Normal file
10
docker/bitcoind/Dockerfile
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
FROM ubuntu:18.04
|
||||||
|
|
||||||
|
RUN apt-get -qq update && apt-get install -y software-properties-common
|
||||||
|
|
||||||
|
RUN add-apt-repository -y ppa:bitcoin/bitcoin \
|
||||||
|
&& add-apt-repository -y universe && apt-get update
|
||||||
|
|
||||||
|
RUN apt-get install -y bitcoind
|
||||||
|
|
||||||
|
ADD ./bitcoin.conf /bitcoin/bitcoin.conf
|
2
docker/bitcoind/bitcoin.conf
Normal file
2
docker/bitcoind/bitcoin.conf
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
daemon=0
|
||||||
|
printtoconsole=1
|
86
docker/docker-compose.yml
Normal file
86
docker/docker-compose.yml
Normal file
@ -0,0 +1,86 @@
|
|||||||
|
version: "2.4"
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
bitcoin_data:
|
||||||
|
lightning_data:
|
||||||
|
lightning_shared:
|
||||||
|
|
||||||
|
services:
|
||||||
|
bitcoind:
|
||||||
|
container_name: ${COMPOSE_PROJECT_NAME}_bitcoind
|
||||||
|
image: bitcoind:0.17.1
|
||||||
|
build: ./bitcoind
|
||||||
|
command: [
|
||||||
|
"bitcoind",
|
||||||
|
"-datadir=/bitcoin",
|
||||||
|
"-port=${BITCOIN_PORT}",
|
||||||
|
"-upnp=0",
|
||||||
|
"-dnsseed=0",
|
||||||
|
"-txindex=1",
|
||||||
|
"-listen=0",
|
||||||
|
"-onlynet=ipv4",
|
||||||
|
"-regtest=1",
|
||||||
|
"-regtest.rpcport=${BITCOIN_RPC_PORT}",
|
||||||
|
"-regtest.port=${BITCOIN_PORT}",
|
||||||
|
"-rpcport=${BITCOIN_RPC_PORT}",
|
||||||
|
"-rpcuser=${BITCOIN_RPC_USER}",
|
||||||
|
"-rpcpassword=${BITCOIN_RPC_PASSWORD}",
|
||||||
|
"-rpcallowip=0.0.0.0/0",
|
||||||
|
"-zmqpubrawtx=tcp://0.0.0.0:${BITCOIN_ZMQ_TX_PORT}",
|
||||||
|
"-zmqpubrawblock=tcp://0.0.0.0:${BITCOIN_ZMQ_BLOCK_PORT}",
|
||||||
|
"-zmqpubhashblock=tcp://0.0.0.0:${BITCOIN_ZMQ_BLOCK_PORT}"
|
||||||
|
]
|
||||||
|
ports:
|
||||||
|
- "${BITCOIN_PORT}:${BITCOIN_PORT}"
|
||||||
|
volumes:
|
||||||
|
- bitcoin_data:/bitcoin
|
||||||
|
|
||||||
|
lnd:
|
||||||
|
container_name: ${COMPOSE_PROJECT_NAME}_lnd
|
||||||
|
image: lnd:0.5.2-beta
|
||||||
|
build: ./lnd
|
||||||
|
restart: unless-stopped
|
||||||
|
command: [
|
||||||
|
"lnd",
|
||||||
|
"--noseedbackup",
|
||||||
|
"--rpclisten=0.0.0.0:${LIGHTNING_RPC_PORT}",
|
||||||
|
"--restlisten=0.0.0.0:${LIGHTNING_REST_PORT}",
|
||||||
|
"--adminmacaroonpath=/shared/admin.macaroon",
|
||||||
|
"--tlsextradomain=${LIGHTNING_HOST}",
|
||||||
|
"--tlsextraip=0.0.0.0",
|
||||||
|
"--tlscertpath=/shared/tls.cert",
|
||||||
|
"--datadir=/lnd",
|
||||||
|
"--bitcoin.active",
|
||||||
|
"--bitcoin.regtest",
|
||||||
|
"--bitcoin.node=bitcoind",
|
||||||
|
"--bitcoind.rpchost=${BITCOIN_HOST}:${BITCOIN_RPC_PORT}",
|
||||||
|
"--bitcoind.rpcuser=${BITCOIN_RPC_USER}",
|
||||||
|
"--bitcoind.rpcpass=${BITCOIN_RPC_PASSWORD}",
|
||||||
|
"--bitcoind.zmqpubrawtx=tcp://${BITCOIN_HOST}:${BITCOIN_ZMQ_TX_PORT}",
|
||||||
|
"--bitcoind.zmqpubrawblock=tcp://${BITCOIN_HOST}:${BITCOIN_ZMQ_BLOCK_PORT}"
|
||||||
|
]
|
||||||
|
depends_on:
|
||||||
|
- bitcoind
|
||||||
|
ports:
|
||||||
|
- "${LIGHTNING_REST_PORT}:${LIGHTNING_REST_PORT}"
|
||||||
|
volumes:
|
||||||
|
- lightning_data:/lnd
|
||||||
|
- lightning_shared:/shared
|
||||||
|
|
||||||
|
rtl:
|
||||||
|
container_name: ${COMPOSE_PROJECT_NAME}_rtl
|
||||||
|
image: shahanafarooqui/rtl:0.2.16
|
||||||
|
restart: unless-stopped
|
||||||
|
depends_on:
|
||||||
|
- lnd
|
||||||
|
volumes:
|
||||||
|
- lightning_shared:/shared:ro
|
||||||
|
ports:
|
||||||
|
- "${RTL_PORT}:${RTL_PORT}"
|
||||||
|
environment:
|
||||||
|
PORT: ${RTL_PORT}
|
||||||
|
MACAROON_PATH: /shared
|
||||||
|
LND_SERVER_URL: https://${LIGHTNING_HOST}:${LIGHTNING_REST_PORT}/v1
|
||||||
|
LND_CONFIG_PATH: ''
|
||||||
|
NODE_AUTH_TYPE: ${RTL_NODE_AUTH_TYPE}
|
||||||
|
RTL_PASS: ${RTL_PASS}
|
29
docker/lnd/Dockerfile
Normal file
29
docker/lnd/Dockerfile
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
FROM golang:1.11-alpine as builder
|
||||||
|
|
||||||
|
WORKDIR /go/src/github.com/lightningnetwork/lnd
|
||||||
|
|
||||||
|
# Force Go to use the cgo based DNS resolver. This is required to ensure DNS
|
||||||
|
# queries required to connect to linked containers succeed.
|
||||||
|
ENV GODEBUG netdns=cgo
|
||||||
|
|
||||||
|
RUN apk add --no-cache --update alpine-sdk git make \
|
||||||
|
&& git clone -n https://github.com/lightningnetwork/lnd . \
|
||||||
|
&& git checkout d2186cc9da29853091175189268b073f49586cf0 \
|
||||||
|
&& make \
|
||||||
|
&& make install
|
||||||
|
|
||||||
|
# Start a new, final image to reduce size.
|
||||||
|
FROM alpine as final
|
||||||
|
|
||||||
|
# Expose lnd ports (server, rpc).
|
||||||
|
EXPOSE 9735 10009
|
||||||
|
|
||||||
|
# Copy the binaries and entrypoint from the builder image.
|
||||||
|
COPY --from=builder /go/bin/lncli /bin/
|
||||||
|
COPY --from=builder /go/bin/lnd /bin/
|
||||||
|
|
||||||
|
# Add bash.
|
||||||
|
RUN apk add --no-cache bash
|
||||||
|
|
||||||
|
# Import the config
|
||||||
|
ADD ./lnd.conf /root/.lnd/lnd.conf
|
2
docker/lnd/lnd.conf
Normal file
2
docker/lnd/lnd.conf
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
[Application Options]
|
||||||
|
debuglevel=info
|
Loading…
Reference in New Issue
Block a user