mempool/docker/README.md

60 lines
2.3 KiB
Markdown
Raw Normal View History

# Docker
2022-01-10 21:10:58 -08:00
This directory contains the Dockerfiles used to build and release the official images and a `docker-compose.yml` file that is intended for end users to run a Mempool instance with minimal effort.
2022-01-10 21:10:58 -08:00
## Basic setup
To run an instance with the default settings, use the following command:
```bash
2022-01-10 21:10:58 -08:00
$ docker-compose up
```
2022-01-10 21:10:58 -08:00
The default configuration will allow you to run Mempool using `bitcoind` as the backend, so address lookups will be disabled.
2022-01-10 21:10:58 -08:00
You can check if the instance is running by visiting http://localhost - the graphs will be populated as new transactions are detected.
2022-01-10 21:10:58 -08:00
## Advanced setup
2022-01-10 21:10:58 -08:00
In order to run with electrum/electrs as the backend you will need to make the following changes to the `docker-compose.yml` file:
2022-01-10 21:10:58 -08:00
- Under the `api` service, change the value of `MEMPOOL_BACKEND` key from `none` to `electrum`:
```
api:
environment:
MEMPOOL_BACKEND: "none"
```
2022-01-10 21:10:58 -08:00
- Under the `api` service, set the `ELECTRUM_HOST` and `ELECTRUM_PORT` keys to your Docker host ip address and set `ELECTRUM_TLS_ENABLED` to `false`:
2022-01-10 21:10:58 -08:00
```
api:
environment:
2022-01-10 21:10:58 -08:00
ELECTRUM_HOST: "172.27.0.1"
ELECTRUM_PORT: "50002"
ELECTRUM_TLS: "false"
2022-01-10 21:10:58 -08:00
```
2022-01-10 21:10:58 -08:00
You can update any of the settings in the `mempool-config.json` file using the environment variables to override. Refer to the `start.sh` script for a list of variables and their default values.
## Troubleshooting
2022-01-10 21:10:58 -08:00
If you already have something running on port 80, change it to something else under the `web` service section.
2022-01-10 21:10:58 -08:00
If you get stuck on "loading blocks", this means the websocket can't connect.
2022-01-10 21:10:58 -08:00
If you can't connect to the `bitcoind` RPC server, check your firewall settings and your `bitcoin.conf` file, it should contain at least these settings:
2022-01-10 21:10:58 -08:00
```
rpcallowip=0.0.0.0/0
rpcuser=mempool
rpcpassword=mempool
bind=0.0.0.0:8333
rpcbind=0.0.0.0:8332
```
2022-01-10 21:10:58 -08:00
If you can't connect to electrum/electrs, check your firewall settings and the IP you entered.
2022-01-10 21:10:58 -08:00
If you see a permission denied error coming from the database container, check your filesystem. The cache files generated by the backend will be stored in the `./data` directory and the database will be stored in the `./mysql/data` directory relative to the location of the `docker-compose.yml` file. If you move it somewhere, the paths will have to be updated and/or recreated.