- both docker and distro package steps Signed-off-by: Lakshya Singh <lakshay.singh1108@gmail.com>
87 lines
2.9 KiB
Markdown
87 lines
2.9 KiB
Markdown
# VLS Containers
|
|
|
|
## Installing Docker
|
|
|
|
### Docker Documentation
|
|
|
|
Docker Engine is available on a variety of Linux distros, macOS, and Windows 10 through Docker Desktop, and as a static binary installation. Refer to the official [docker documentation](https://docs.docker.com/engine/install/)
|
|
|
|
- [Ubuntu](https://docs.docker.com/engine/install/ubuntu/)
|
|
- [Fedora](https://docs.docker.com/engine/install/fedora/)
|
|
|
|
### Distro Packages
|
|
|
|
Debian/Ubuntu:
|
|
```
|
|
sudo apt install docker.io docker-doc docker-compose containerd runc
|
|
sudo systemctl enable --now docker
|
|
```
|
|
|
|
Fedora/RHEL:
|
|
```
|
|
sudo dnf install docker docker-compose containerd runc
|
|
sudo systemctl enable --now docker
|
|
```
|
|
|
|
### Docker Compose Compatibility
|
|
|
|
- Currently available `docker-compose` package in different linux distributions (debian, ubuntu, fedora, etc) are not up to date, they are still at version `1` which has been deprecated by `docker` with release of version `2`.
|
|
- `docker-compose` version `2` is available through official docker repositories not the distribution ones.
|
|
- Docker Images in this repository work with version 2 and are also __backward compatible__ with version 1.
|
|
- If you are using the distribution installation the `docker compose` command used below has to be changed to `docker-compose` instead.
|
|
|
|
## Volume Creation
|
|
|
|
```
|
|
docker volume create bitcoin_data
|
|
docker volume create lightning_data
|
|
docker volume create txood_data
|
|
```
|
|
|
|
## Docker Compose Run
|
|
|
|
```
|
|
docker compose up --build
|
|
```
|
|
|
|
## Using Bitcoin Chains
|
|
|
|
We have three possible overrides over the default `testnet` configuration in `docker-compose.yml`:
|
|
- `docker-compose.testnet.yml`
|
|
- `docker-compose.regtest.yml`
|
|
- `docker-compose.mainnet.yml`
|
|
|
|
To use override we have to pass it down both the config using `-f` flag:
|
|
```
|
|
export COMPOSE_PROJECT_NAME=<bitcoin_chain>
|
|
docker compose -f docker-compose.yml -f <override_file> up --build
|
|
```
|
|
|
|
__Note__: Even while using `testnet` running using the override is recommended as that will expose the `P2P` port for `bitcoind` and `P2P` port for `lightningd` on the host.
|
|
|
|
## Additional Regtest Commands
|
|
|
|
We have to run these commands after bitcoind is up and running.
|
|
|
|
Create Wallet:
|
|
```
|
|
docker container exec bitcoind-regtest bitcoin-cli createwallet default
|
|
```
|
|
|
|
Generate Address for node:
|
|
```
|
|
docker container exec bitcoind-regtest bitcoin-cli getnewaddress
|
|
```
|
|
|
|
Generate Blocks
|
|
```
|
|
docker container exec bitcoind-regtest bitcoin-cli generatetoaddress 50 $NODE_ADDRESS
|
|
```
|
|
|
|
### References
|
|
|
|
- [bitcoind](https://github.com/ruimarinho/docker-bitcoin-core/blob/master/23/alpine/Dockerfile) by @ruimarinho
|
|
- [lightningd with clboss](https://github.com/tsjk/docker-core-lightning/blob/main/Dockerfile) by @tsjk
|
|
- [elements lightning](https://github.com/ElementsProject/lightning/blob/master/contrib/docker/Dockerfile.alpine) by @ElementsProject
|
|
- [docker compose](https://github.com/LukasBahrenberg/lightning-dockercompose/blob/master/docker-compose.yaml) by @LukasBahrenberg
|