2021-12-30 00:08:41 +01:00
|
|
|
# 1) RTL Docker Dev Setup
|
2019-04-15 01:00:20 +02:00
|
|
|
|
|
|
|
### 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.
|
|
|
|
|
2021-12-30 00:08:41 +01:00
|
|
|
### 1.1) Notes
|
2019-04-15 01:00:20 +02:00
|
|
|
- `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.
|
|
|
|
|
2021-12-30 00:08:41 +01:00
|
|
|
## 1.2) How to run
|
|
|
|
It may take several minutes if containers need to be built.
|
|
|
|
|
|
|
|
1.2.1) From the terminal in this folder:
|
2019-04-15 01:00:20 +02:00
|
|
|
|
|
|
|
```
|
|
|
|
$ docker-compose up -d bitcoind
|
|
|
|
$ bin/b-cli generate 101
|
|
|
|
$ docker-compose up -d lnd rtl
|
|
|
|
```
|
|
|
|
|
2021-12-30 00:08:41 +01:00
|
|
|
1.2.2) Check containers are up and running with:
|
2019-04-15 01:00:20 +02:00
|
|
|
```
|
|
|
|
$ docker-compose ps
|
|
|
|
```
|
|
|
|
|
2021-12-30 00:08:41 +01:00
|
|
|
1.2.3) Use the cli tools to get responses from the containers:
|
2019-04-15 01:00:20 +02:00
|
|
|
```
|
|
|
|
$ bin/ln-cli getinfo
|
|
|
|
$ bin/b-cli getblockchaininfo
|
|
|
|
```
|
|
|
|
|
2021-12-30 00:08:41 +01:00
|
|
|
1.2.4) View daemon logs as follows:
|
2019-04-15 01:00:20 +02:00
|
|
|
```
|
|
|
|
$ docker-compose logs bitcoind lnd rtl
|
|
|
|
```
|
|
|
|
|
|
|
|
Once the containers are running you can access the RTL UI at http://localhost:3000
|
|
|
|
|
2021-04-24 21:08:44 +02:00
|
|
|
- Default password is `password`.
|
|
|
|
- Default host, port and password can be changed in `.env`.
|
2019-04-15 01:00:20 +02:00
|
|
|
|
|
|
|
When you are done you can destroy containers with:
|
|
|
|
```
|
|
|
|
$ docker-compose down -v
|
|
|
|
```
|
2021-12-30 00:08:41 +01:00
|
|
|
---
|
|
|
|
# 2) Stand alone RTL Setup
|
|
|
|
This is suitable when you already have a LND node running and configured.
|
|
|
|
|
|
|
|
## 2.1) From docker image pull
|
|
|
|
```
|
|
|
|
RTL_VERSION=0.12.0
|
|
|
|
docker run --name rtl -d -it \
|
|
|
|
-e RTL_CONFIG_PATH=/RTLConfig \
|
|
|
|
-v /path/to/RTLConfig/dir:/RTLConfig \
|
|
|
|
-v /path/to/macaroon/dir:/path/as/specified/in/RTLConfig \
|
|
|
|
-v /path/to/database/dir:/RTL/database \
|
|
|
|
-p 3000:3000/tcp \
|
|
|
|
shahanafarooqui/rtl:${RTL_VERSION}
|
|
|
|
```
|
|
|
|
|
|
|
|
## 2.2) From local docker build
|
|
|
|
### 2.2.1) Build the image locally
|
|
|
|
```
|
|
|
|
RTL_VERSION=0.12.0
|
|
|
|
docker build -t rtl:${RTL_VERSION} -f dockerfiles/Dockerfile .
|
|
|
|
```
|
|
|
|
### 2.2.2) Create .env file
|
|
|
|
Create an environment file with your required configurations. Sample .env:
|
|
|
|
```
|
|
|
|
RTL_CONFIG_PATH=/RTLConfig
|
2024-11-11 05:23:52 +01:00
|
|
|
LN_IMPLEMENTATION=LND
|
2021-12-30 00:08:41 +01:00
|
|
|
MACAROON_PATH=/LNDMacaroon
|
|
|
|
LN_SERVER_URL=https://host.docker.internal:8080
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
### 2.2.3) Run the newly built image with .env configurations
|
|
|
|
```
|
|
|
|
RTL_VERSION=0.12.0
|
|
|
|
docker run -d -it \
|
|
|
|
-v /path/to/RTLConfig/dir:/RTLConfig \
|
|
|
|
-v /path/to/macaroon/dir:/LNDMacaroon \
|
|
|
|
-v /path/to/database/dir:/RTL/database \
|
|
|
|
--env-file=.env -p 3000:3000 rtl:${RTL_VERSION}
|
|
|
|
```
|
|
|
|
|
|
|
|
Once the container is running you can access the RTL UI at http://localhost:3000
|
2019-04-15 01:00:20 +02:00
|
|
|
|
|
|
|
---
|
|
|
|
@hashamadeus on Twitter
|