diff --git a/README.md b/README.md index ac93170..b900aa5 100644 --- a/README.md +++ b/README.md @@ -271,9 +271,24 @@ BTCPAY_SSHKEYFILE=/datadir/id_rsa 1. Add support for your crypto to [NBitcoin](https://github.com/MetacoSA/NBitcoin/tree/master/NBitcoin.Altcoins), [NBxplorer](https://github.com/dgarage/NBXplorer), and [BTCPayServer](https://github.com/btcpayserver/btcpayserver). (Use examples from other coins) 2. Create your own docker image ([Example for BTC](https://hub.docker.com/r/nicolasdorier/docker-bitcoin/)) 3. Create a docker-compose fragment ([Example for BTC](docker-compose-generator/docker-fragments/bitcoin.yml)) -4. Add your coin to CryptoDefinition ([Example for BTC](docker-compose-generator/src/CryptoDefinition.cs)) -5. Tell the setup script to build the docker compose generator image locally by specifying the environment variable `BTCPAYGEN_DOCKER_IMAGE` to `btcpayserver/docker-compose-generator:local` -6. Configure the BtcPay environment variables as usual and run [build.sh](build.sh) (or [build.ps1](build.ps1)) to generate the docker compose script under `Generated` +4. Add your `CryptoDefinition` ([Example for BTC](docker-compose-generator/src/CryptoDefinition.cs)) + +`build.sh` is using a pre-built image of the `docker-compose generator` on [docker hub](https://hub.docker.com/r/btcpayserver/docker-compose-generator/). +If you modify the code source of `docker-compose generator` (for example, the `CryptoDefinition` [Example for BTC](docker-compose-generator/src/CryptoDefinition.cs)), you need to configure `build.sh` to use your own image by setting the environment variable `BTCPAYGEN_DOCKER_IMAGE` to `btcpayserver/docker-compose-generator:local`. + +```bash +cd docker-compose-generator +BTCPAYGEN_DOCKER_IMAGE="btcpayserver/docker-compose-generator:local" +``` + +Or on powershell: +```powershell +cd docker-compose-generator +$BTCPAYGEN_DOCKER_IMAGE="btcpayserver/docker-compose-generator:local" +``` + +Then run `./build.sh` or `. .\build.ps1`. +This will generate your docker-compose in the `Generated` folder, which you can then run and test. Note that BTCPayServer developers will not spend excessive time testing your image, so make sure it works. diff --git a/build.ps1 b/build.ps1 index 2040100..4653cf1 100755 --- a/build.ps1 +++ b/build.ps1 @@ -2,7 +2,8 @@ if (-not ($BTCPAYGEN_DOCKER_IMAGE)) { $BTCPAYGEN_DOCKER_IMAGE = "btcpayserver/docker-compose-generator" } If (-not ($BTCPAYGEN_DOCKER_IMAGE)) { $BTCPAYGEN_DOCKER_IMAGE = "btcpayserver/docker-compose-generator" } -If($BTCPAYGEN_DOCKER_IMAGE -eq "btcpayserver/docker-compose-generator:local"){ + +If ($BTCPAYGEN_DOCKER_IMAGE -eq "btcpayserver/docker-compose-generator:local"){ docker build docker-compose-generator --tag $BTCPAYGEN_DOCKER_IMAGE } Else { docker pull $BTCPAYGEN_DOCKER_IMAGE diff --git a/build.sh b/build.sh index 7adaeed..09f9a4a 100755 --- a/build.sh +++ b/build.sh @@ -1,10 +1,11 @@ #!/bin/bash +: "${BTCPAYGEN_DOCKER_IMAGE:=btcpayserver/docker-compose-generator}" if [ "$BTCPAYGEN_DOCKER_IMAGE" == "btcpayserver/docker-compose-generator:local" ] then docker build docker-compose-generator --tag $BTCPAYGEN_DOCKER_IMAGE else - docker pull ${BTCPAYGEN_DOCKER_IMAGE:-"btcpayserver/docker-compose-generator"} + docker pull $BTCPAYGEN_DOCKER_IMAGE fi # This script will run docker-compose-generator in a container to generate the yml files @@ -23,7 +24,7 @@ docker run -v "$(pwd)/Generated:/app/Generated" \ -e "BTCPAYGEN_ADDITIONAL_FRAGMENTS=$BTCPAYGEN_ADDITIONAL_FRAGMENTS" \ -e "BTCPAYGEN_LIGHTNING=$BTCPAYGEN_LIGHTNING" \ -e "BTCPAYGEN_SUBNAME=$BTCPAYGEN_SUBNAME" \ - --rm ${BTCPAYGEN_DOCKER_IMAGE:-"btcpayserver/docker-compose-generator"} + --rm $BTCPAYGEN_DOCKER_IMAGE if [ "$BTCPAYGEN_REVERSEPROXY" == "nginx" ]; then cp Production/nginx.tmpl Generated/nginx.tmpl diff --git a/docker-compose-generator/docker-fragments/opt-lnd-autopilot.yml b/docker-compose-generator/docker-fragments/opt-lnd-autopilot.yml index aff861e..98f9e6b 100644 --- a/docker-compose-generator/docker-fragments/opt-lnd-autopilot.yml +++ b/docker-compose-generator/docker-fragments/opt-lnd-autopilot.yml @@ -7,3 +7,15 @@ services: autopilot.active=1 autopilot.maxchannels=5 autopilot.allocation=0.6 + lnd_litecoin: + environment: + LND_EXTRA_ARGS: | + autopilot.active=1 + autopilot.maxchannels=5 + autopilot.allocation=0.6 + lnd_bitcoingold: + environment: + LND_EXTRA_ARGS: | + autopilot.active=1 + autopilot.maxchannels=5 + autopilot.allocation=0.6 diff --git a/docker-compose-generator/docker-fragments/opt-save-storage-s.yml b/docker-compose-generator/docker-fragments/opt-save-storage-s.yml index 11177d2..e134222 100644 --- a/docker-compose-generator/docker-fragments/opt-save-storage-s.yml +++ b/docker-compose-generator/docker-fragments/opt-save-storage-s.yml @@ -1,8 +1,23 @@ version: "3" +# If you don't use Lightning Network, use opt-save-store-xxs instead +# This save about 6 months of block, your lightning node won't be able to see channel created 6 months since the time you start it. services: bitcoind: environment: - # If you don't use Lightning Network, use opt-save-store-xxs instead - # This save about 6 months of block, your lightning node won't be able to see channel created 6 months since the time you start it. + BITCOIN_EXTRA_ARGS: prune=50000 + bgoldd: + environment: + BITCOIN_EXTRA_ARGS: prune=50000 + feathercoind: + environment: + BITCOIN_EXTRA_ARGS: prune=50000 + groestlcoind: + environment: + BITCOIN_EXTRA_ARGS: prune=50000 + litecoind: + environment: + BITCOIN_EXTRA_ARGS: prune=50000 + viacoind: + environment: BITCOIN_EXTRA_ARGS: prune=50000 \ No newline at end of file diff --git a/docker-compose-generator/docker-fragments/opt-save-storage-xs.yml b/docker-compose-generator/docker-fragments/opt-save-storage-xs.yml index a089417..6f5e90a 100644 --- a/docker-compose-generator/docker-fragments/opt-save-storage-xs.yml +++ b/docker-compose-generator/docker-fragments/opt-save-storage-xs.yml @@ -1,8 +1,23 @@ version: "3" +# If you don't use Lightning Network, use opt-save-store-xxs instead +# This save about 3 months of block, your lightning node won't be able to see channel created 3 months since the time you start it. services: bitcoind: environment: - # If you don't use Lightning Network, use opt-save-store-xxs instead - # This save about 3 months of block, your lightning node won't be able to see channel created 3 months since the time you start it. + BITCOIN_EXTRA_ARGS: prune=25000 + bgoldd: + environment: + BITCOIN_EXTRA_ARGS: prune=25000 + feathercoind: + environment: + BITCOIN_EXTRA_ARGS: prune=25000 + groestlcoind: + environment: + BITCOIN_EXTRA_ARGS: prune=25000 + litecoind: + environment: + BITCOIN_EXTRA_ARGS: prune=25000 + viacoind: + environment: BITCOIN_EXTRA_ARGS: prune=25000 \ No newline at end of file diff --git a/docker-compose-generator/docker-fragments/opt-save-storage-xxs.yml b/docker-compose-generator/docker-fragments/opt-save-storage-xxs.yml index 22fd776..6ad1d81 100644 --- a/docker-compose-generator/docker-fragments/opt-save-storage-xxs.yml +++ b/docker-compose-generator/docker-fragments/opt-save-storage-xxs.yml @@ -1,8 +1,23 @@ version: "3" +# If you don't use Lightning Network, you want this +# This save about 2 weeks worth of block services: bitcoind: environment: - # If you don't use Lightning Network, you want this - # This save about 2 weeks worth of block + BITCOIN_EXTRA_ARGS: prune=5000 + bgoldd: + environment: + BITCOIN_EXTRA_ARGS: prune=5000 + feathercoind: + environment: + BITCOIN_EXTRA_ARGS: prune=5000 + groestlcoind: + environment: + BITCOIN_EXTRA_ARGS: prune=5000 + litecoind: + environment: + BITCOIN_EXTRA_ARGS: prune=5000 + viacoind: + environment: BITCOIN_EXTRA_ARGS: prune=5000 \ No newline at end of file diff --git a/docker-compose-generator/docker-fragments/opt-save-storage.yml b/docker-compose-generator/docker-fragments/opt-save-storage.yml index 103a3e6..9e440cd 100644 --- a/docker-compose-generator/docker-fragments/opt-save-storage.yml +++ b/docker-compose-generator/docker-fragments/opt-save-storage.yml @@ -1,8 +1,23 @@ version: "3" +# If you don't use Lightning Network, use opt-save-store-xxs instead +# This save about 1 years of block, your lightning node won't be able to see channel created 1 year since the time you start it. services: bitcoind: environment: - # If you don't use Lightning Network, use opt-save-store-xxs instead - # This save about 1 years of block, your lightning node won't be able to see channel created 1 year since the time you start it. + BITCOIN_EXTRA_ARGS: prune=100000 + bgoldd: + environment: + BITCOIN_EXTRA_ARGS: prune=100000 + feathercoind: + environment: + BITCOIN_EXTRA_ARGS: prune=100000 + groestlcoind: + environment: + BITCOIN_EXTRA_ARGS: prune=100000 + litecoind: + environment: + BITCOIN_EXTRA_ARGS: prune=100000 + viacoind: + environment: BITCOIN_EXTRA_ARGS: prune=100000 \ No newline at end of file