From 3a4259ea71966f89bea582eb73acea815de56593 Mon Sep 17 00:00:00 2001 From: "nicolas.dorier" Date: Fri, 12 Jan 2018 17:12:57 +0900 Subject: [PATCH] Simplify deployment by using only one nbxplorer for several crypto currencies, remove some settings --- Production/README.md | 8 +---- Production/docker-compose.btc-ltc.yml | 50 ++++++++++----------------- Production/docker-compose.btc.yml | 19 +++++----- Production/docker-compose.yml | 18 +++++----- Regtest/docker-compose.yml | 5 ++- 5 files changed, 38 insertions(+), 62 deletions(-) diff --git a/Production/README.md b/Production/README.md index 1821c21..8199758 100644 --- a/Production/README.md +++ b/Production/README.md @@ -4,7 +4,7 @@ The `docker-compose` can be used for production purpose. It is composed of: -1. A full node (Bitcoin Core) +1. One full node per supported cryptocurrency (bitcoind/litecoind) 2. A lightweight block explorer ([NBxplorer](https://github.com/dgarage/NBXplorer)) 3. A [BTCPay Server](https://github.com/btcpayserver/btcpayserver) 4. A database (Postgres) @@ -20,12 +20,6 @@ The relevant environment variables are: * `NBITCOIN_NETWORK`: the blockchain identifier used by NBitcoin (eg., `regtest`, `testnet`, `mainnet`) * `BTCPAY_HOST`: the external url used to access the NGINX server from internet. This domain name must point to this machine for Let's Encrypt to create your certificate. (typically with a CNAME or A record) * `LETSENCRYPT_EMAIL`: The email Let's Encrypt will use to notify you about certificate expiration. -* `BITCOIND_COOKIEFILE`: The relative path to RPC cookie file from bitcoin's data directory. (`.cookie` for mainnet, `regtest/.cookie` for regtest, `testnet3/.cookie` for testnet) -* `BITCOIND_NETWORKPARAMETER`: The blockchain identifier parameter used by bitcoind (`regtest=1` for regtest, `testnet=1` for testnet, `#mainnet=1` for mainnet) * `ACME_CA_URI`: Let's encrypt API endpoint (`https://acme-staging.api.letsencrypt.org/directory` for a staging certificate, `https://acme-v01.api.letsencrypt.org/directory` for a production one) -If using litecoin: - -* `LITECOIND_COOKIEFILE`: The relative path to RPC cookie file from litecoin's data directory. (`.cookie` for mainnet, `regtest/.cookie` for regtest, `testnet4/.cookie` for testnet) - Any unset or empty environment variable will be set for a `regtest` deployment. diff --git a/Production/docker-compose.btc-ltc.yml b/Production/docker-compose.btc-ltc.yml index 43b74e2..05dbb23 100644 --- a/Production/docker-compose.btc-ltc.yml +++ b/Production/docker-compose.btc-ltc.yml @@ -52,15 +52,16 @@ services: btcpayserver: restart: always - image: nicolasdorier/btcpayserver:1.0.0.64 + image: nicolasdorier/btcpayserver:1.0.0.69 expose: - "49392" environment: # BTCPay settings BTCPAY_POSTGRES: User ID=postgres;Host=postgres;Port=5432;Database=btcpayserver${NBITCOIN_NETWORK:-regtest} BTCPAY_NETWORK: ${NBITCOIN_NETWORK:-regtest} - BTCPAY_BTCEXPLORERURL: http://nbxplorer-btc:32838/ - BTCPAY_LTCEXPLORERURL: http://nbxplorer-ltc:32838/ + BTCPAY_CHAINS: "btc,ltc" + BTCPAY_BTCEXPLORERURL: http://nbxplorer:32838/ + BTCPAY_LTCEXPLORERURL: http://nbxplorer:32838/ BTCPAY_BIND: 0.0.0.0:49392 BTCPAY_EXTERNALURL: https://${BTCPAY_HOST}/ @@ -74,29 +75,32 @@ services: LETSENCRYPT_EMAIL: ${LETSENCRYPT_EMAIL:-yourname@example.com} links: - - nbxplorer-btc - - nbxplorer-ltc + - nbxplorer - postgres volumes: - "btcpay_datadir:/datadir" + - "nbxplorer_btc_datadir:/root/.nbxplorer" - nbxplorer-btc: + nbxplorer: restart: always - image: nicolasdorier/nbxplorer:1.0.0.45 + image: nicolasdorier/nbxplorer:1.0.0.54 expose: - "32838" environment: NBXPLORER_NETWORK: ${NBITCOIN_NETWORK:-regtest} - NBXPLORER_RPCURL: http://bitcoind:43782/ - NBXPLORER_RPCCOOKIEFILE: /btc/${BITCOIND_COOKIEFILE:-regtest/.cookie} - NBXPLORER_NODEENDPOINT: bitcoind:39388 + NBXPLORER_CHAINS: "btc,ltc" + NBXPLORER_BTCRPCURL: http://bitcoind:43782/ + NBXPLORER_BTCNODEENDPOINT: bitcoind:39388 + NBXPLORER_LTCRPCURL: http://litecoind:43782/ + NBXPLORER_LTCNODEENDPOINT: litecoind:39388 NBXPLORER_BIND: 0.0.0.0:32838 - NBXPLORER_NOAUTH: 1 links: - bitcoind + - litecoind volumes: - "nbxplorer_btc_datadir:/datadir" - - "bitcoin_btc_datadir:/btc" + - "bitcoin_btc_datadir:/root/.bitcoin" + - "bitcoin_ltc_datadir:/root/.litecoin" bitcoind: restart: always @@ -105,7 +109,7 @@ services: environment: BITCOIN_EXTRA_ARGS: | rpcport=43782 - ${BITCOIND_NETWORKPARAMETER:-regtest=1} + ${NBITCOIN_NETWORK:-regtest}=1 port=39388 whitelist=0.0.0.0/0 expose: @@ -119,24 +123,6 @@ services: volumes: - "postgres_datadir:/var/lib/postgresql/data" - nbxplorer-ltc: - restart: always - image: nicolasdorier/nbxplorer:1.0.0.45 - expose: - - "32838" - environment: - NBXPLORER_NETWORK: litecoin-${NBITCOIN_NETWORK:-regtest} - NBXPLORER_RPCURL: http://litecoind:43782/ - NBXPLORER_RPCCOOKIEFILE: /ltc/${LITECOIND_COOKIEFILE:-regtest/.cookie} - NBXPLORER_NODEENDPOINT: litecoind:39388 - NBXPLORER_BIND: 0.0.0.0:32838 - NBXPLORER_NOAUTH: 1 - links: - - litecoind - volumes: - - "nbxplorer_ltc_datadir:/datadir" - - "bitcoin_ltc_datadir:/ltc" - litecoind: restart: always container_name: btcpayserver_litecoind @@ -144,7 +130,7 @@ services: environment: BITCOIN_EXTRA_ARGS: | rpcport=43782 - ${BITCOIND_NETWORKPARAMETER:-regtest=1} + ${NBITCOIN_NETWORK:-regtest}=1 port=39388 whitelist=0.0.0.0/0 expose: diff --git a/Production/docker-compose.btc.yml b/Production/docker-compose.btc.yml index 73bb5c5..2f111aa 100644 --- a/Production/docker-compose.btc.yml +++ b/Production/docker-compose.btc.yml @@ -1,6 +1,7 @@ version: "3" # This run BTCPay behind NGINX reverse proxy configured with Let's Encrypt +# Same as docker-compose.btc.yml keeping for not breaking legacy docker-azure users services: nginx: @@ -52,16 +53,15 @@ services: btcpayserver: restart: always - image: nicolasdorier/btcpayserver:1.0.0.64 + image: nicolasdorier/btcpayserver:1.0.0.69 expose: - "49392" environment: # BTCPay settings BTCPAY_POSTGRES: User ID=postgres;Host=postgres;Port=5432;Database=btcpayserver${NBITCOIN_NETWORK:-regtest} BTCPAY_NETWORK: ${NBITCOIN_NETWORK:-regtest} - BTCPAY_EXPLORERURL: http://nbxplorer:32838/ + BTCPAY_BTCEXPLORERURL: http://nbxplorer:32838/ BTCPAY_BIND: 0.0.0.0:49392 - BTCPAY_INTERNALURL: http://btcpayserver:49392/ BTCPAY_EXTERNALURL: https://${BTCPAY_HOST}/ # NGINX settings @@ -78,24 +78,23 @@ services: - postgres volumes: - "btcpay_datadir:/datadir" + - "nbxplorer_datadir:/root/.nbxplorer" nbxplorer: restart: always - image: nicolasdorier/nbxplorer:1.0.0.45 + image: nicolasdorier/nbxplorer:1.0.0.54 expose: - "32838" environment: NBXPLORER_NETWORK: ${NBITCOIN_NETWORK:-regtest} - NBXPLORER_RPCURL: http://bitcoind:43782/ - NBXPLORER_RPCCOOKIEFILE: /btc/${BITCOIND_COOKIEFILE:-regtest/.cookie} - NBXPLORER_NODEENDPOINT: bitcoind:39388 + NBXPLORER_BTCRPCURL: http://bitcoind:43782/ + NBXPLORER_BTCNODEENDPOINT: bitcoind:39388 NBXPLORER_BIND: 0.0.0.0:32838 - NBXPLORER_NOAUTH: 1 links: - bitcoind volumes: - "nbxplorer_datadir:/datadir" - - "bitcoin_datadir:/btc" + - "bitcoin_datadir:/root/.bitcoin" bitcoind: restart: always @@ -104,7 +103,7 @@ services: environment: BITCOIN_EXTRA_ARGS: | rpcport=43782 - ${BITCOIND_NETWORKPARAMETER:-regtest=1} + ${NBITCOIN_NETWORK:-regtest}=1 port=39388 whitelist=0.0.0.0/0 expose: diff --git a/Production/docker-compose.yml b/Production/docker-compose.yml index ff32de3..2f111aa 100644 --- a/Production/docker-compose.yml +++ b/Production/docker-compose.yml @@ -53,16 +53,15 @@ services: btcpayserver: restart: always - image: nicolasdorier/btcpayserver:1.0.0.64 + image: nicolasdorier/btcpayserver:1.0.0.69 expose: - "49392" environment: # BTCPay settings BTCPAY_POSTGRES: User ID=postgres;Host=postgres;Port=5432;Database=btcpayserver${NBITCOIN_NETWORK:-regtest} BTCPAY_NETWORK: ${NBITCOIN_NETWORK:-regtest} - BTCPAY_EXPLORERURL: http://nbxplorer:32838/ + BTCPAY_BTCEXPLORERURL: http://nbxplorer:32838/ BTCPAY_BIND: 0.0.0.0:49392 - BTCPAY_INTERNALURL: http://btcpayserver:49392/ BTCPAY_EXTERNALURL: https://${BTCPAY_HOST}/ # NGINX settings @@ -79,24 +78,23 @@ services: - postgres volumes: - "btcpay_datadir:/datadir" + - "nbxplorer_datadir:/root/.nbxplorer" nbxplorer: restart: always - image: nicolasdorier/nbxplorer:1.0.0.45 + image: nicolasdorier/nbxplorer:1.0.0.54 expose: - "32838" environment: NBXPLORER_NETWORK: ${NBITCOIN_NETWORK:-regtest} - NBXPLORER_RPCURL: http://bitcoind:43782/ - NBXPLORER_RPCCOOKIEFILE: /btc/${BITCOIND_COOKIEFILE:-regtest/.cookie} - NBXPLORER_NODEENDPOINT: bitcoind:39388 + NBXPLORER_BTCRPCURL: http://bitcoind:43782/ + NBXPLORER_BTCNODEENDPOINT: bitcoind:39388 NBXPLORER_BIND: 0.0.0.0:32838 - NBXPLORER_NOAUTH: 1 links: - bitcoind volumes: - "nbxplorer_datadir:/datadir" - - "bitcoin_datadir:/btc" + - "bitcoin_datadir:/root/.bitcoin" bitcoind: restart: always @@ -105,7 +103,7 @@ services: environment: BITCOIN_EXTRA_ARGS: | rpcport=43782 - ${BITCOIND_NETWORKPARAMETER:-regtest=1} + ${NBITCOIN_NETWORK:-regtest}=1 port=39388 whitelist=0.0.0.0/0 expose: diff --git a/Regtest/docker-compose.yml b/Regtest/docker-compose.yml index 761ddc4..e5ca3e5 100644 --- a/Regtest/docker-compose.yml +++ b/Regtest/docker-compose.yml @@ -3,7 +3,7 @@ version: "3" services: btcpayserver: - image: nicolasdorier/btcpayserver:1.0.0.64 + image: nicolasdorier/btcpayserver:1.0.0.69 ports: - 8080:49392 expose: @@ -13,13 +13,12 @@ services: BTCPAY_NETWORK: regtest BTCPAY_EXPLORERURL: http://nbxplorer:32838/ BTCPAY_BIND: 0.0.0.0:49392 - BTCPAY_INTERNALURL: http://btcpayserver:49392/ links: - nbxplorer - postgres nbxplorer: - image: nicolasdorier/nbxplorer:1.0.0.45 + image: nicolasdorier/nbxplorer:1.0.0.54 expose: - "32838" environment: