jam/docker/regtest/docker-compose.yml
Thebora Kompanioni 5d886d7a3f
Enable coinjoin on regtest env (#6)
* fix: prevent 'config value not set' on cj in regtest env

'max_cj_fee' config values must be present when invoking a
coinjoin via the api. the default config for the regtest env
did not include these values before, hence they could not
be overridden in docker-compose setup file.

* dev: switch irc server from miniirc to ergochat

* dev: start second joinmarket container

In order to successfully perform a CoinJoin, there must be at least one
maker. This commit adds a second JoinMarket container with
jmwalletd accessible on port 29183.

* dev: add helper script to mine a block

* dev: add container switch to regtest-control script

* dev: invoke mine-block in regtest-control script

* dev: add flag '--unmatured' to regtest-control script

Sometimes it is desired that block rewards do not reach maturity
immediately. This is convenient if you want to supply several wallets
with coins, but do not want to generate many blocks all the time.

* dev: add helper script to start maker service

This script helps in providing both JoinMarket containers a wallet with
spendable coins and starting the Maker Service in the secondary
container. Its main goal is to make CoinJoin transactions possible in the
regtest environment.

* dev: move common functions to script common.sh

* fix: use correct irc host in docker setup

* dev: use ergochat image from ghcr.io

* dev: dont lock secondary wallet in setup script

normally the wallet should be locked, but it seems this leads to the
maker service responding very slowly which causes failing coinjoins.
as the secondary instance is never interacted with directly, we can
refrain from unlocking the wallet for now.

* docs: add debug log command to docker readme

* cleanup: rename script 'regtest-control' to 'fund-wallet'

* dev: upgrade joinmarket from v0.9.3 to use current master branch

* review: add more descriptive comments and cleanup files
2022-01-22 17:09:14 +01:00

214 lines
6 KiB
YAML

version: "3"
services:
bitcoind:
container_name: jm_regtest_bitcoind
restart: unless-stopped
image: btcpayserver/bitcoin:22.0-1
environment:
HIDDENSERVICE_NAME: BTC-P2P,BTC-RPC
BTC-P2P_HIDDENSERVICE_VIRTUAL_PORT: 8333
BTC-P2P_HIDDENSERVICE_PORT: 39388
BTC-RPC_HIDDENSERVICE_VIRTUAL_PORT: 8332
BTC-RPC_HIDDENSERVICE_PORT: 43782
BITCOIN_NETWORK: ${NBITCOIN_NETWORK:-regtest}
BITCOIN_WALLETDIR: "/walletdata"
BITCOIN_EXTRA_ARGS: |
rpcport=43782
rpcbind=0.0.0.0
rpcallowip=0.0.0.0/0
port=39388
whitelist=0.0.0.0/0
maxmempool=500
debug=rpc
logips=0
networkactive=1
dnsseed=0
uacomment=jmdevbitcoindregtest
printpriority=1
logtimemicros=1
zmqpubrawblock=tcp://0.0.0.0:28332
zmqpubrawtx=tcp://0.0.0.0:28333
zmqpubhashblock=tcp://0.0.0.0:28334
# tor
dns=1
onion=tor:9050
torcontrol=tor:9051
# do not automatically create tor hidden service
listenonion=0
# rpcauth (user=regtest; password=regtest)
rpcauth=regtest:20b58677979ad9d3cf4b78b1d6e85e44$$2ec3e1e1c00c7c58d7aff1d4bf96e4a984ea1af5d676d862fd0faa857a1d4d7c
# rpcauth (user=joinmarket; password=joinmarket)
rpcauth=joinmarket:260b4c5b1fbd09d75a4aabf90226282f$$76e170af088d43a588992cdd5e7bae2242b03c33aa672cccfd1fb75f9281299e
# rpcauth (user=joinmarket2; password=joinmarket2)
rpcauth=joinmarket2:521bf9f4468529d49c0a41f9c9f8fdbf$$63ae94a73d2aa45e7ee756945d9b1e469f9873ce026b815d676a748f777e0b8d
# rpcauth (user=nbxplorer; password=nbxplorer)
rpcauth=nbxplorer:8953867752ed07ca27bc0b1d7a10fa99$$e46553870d4a2c59753bfe453797be070ab4dbd5fdfc2fecdb7862ea0ae6b127
expose:
- "43782" # RPC
- "39388" # P2P
- "28332" # ZMQ
- "28333" # ZMQ
- "28334" # ZMQ
volumes:
- "bitcoin_datadir:/data"
- "bitcoin_wallet_datadir:/walletdata"
- "tor_datadir:/home/tor/.tor"
depends_on:
- tor
nbxplorer:
container_name: jm_regtest_nbxplorer
restart: unless-stopped
image: nicolasdorier/nbxplorer:2.2.18
environment:
NBXPLORER_NOAUTH: 1
NBXPLORER_CHAINS: "btc"
NBXPLORER_BTCRPCURL: http://bitcoind:43782/
NBXPLORER_BTCRPCUSER: nbxplorer
NBXPLORER_BTCRPCPASSWORD: nbxplorer
NBXPLORER_BTCNODEENDPOINT: bitcoind:39388
NBXPLORER_NETWORK: ${NBITCOIN_NETWORK:-regtest}
NBXPLORER_BIND: 0.0.0.0:32838
NBXPLORER_TRIMEVENTS: 10000
NBXPLORER_SIGNALFILESDIR: /datadir
expose:
- "32838"
volumes:
- "nbxplorer_datadir:/datadir"
- "bitcoin_datadir:/root/.bitcoin"
depends_on:
- bitcoind
- tor
irc:
container_name: jm_regtest_irc
restart: unless-stopped
image: ghcr.io/ergochat/ergo:stable
expose:
- 6667
volumes:
- "irc_datadir:/ircd"
joinmarket:
container_name: jm_regtest_joinmarket
build:
context: ./dockerfile-deps/joinmarket/latest
dockerfile: Dockerfile
restart: unless-stopped
environment:
READY_FILE: /root/.nbxplorer/btc_fully_synched
ENSURE_WALLET: 1
jm_gaplimit: 2000
jm_rpc_wallet_file: jm_primary
jm_max_cj_fee_abs: 42000000 # 0.42 btc
jm_max_cj_fee_rel: 0.1337 # 13.37%
jm_minimum_makers: 1
jm_taker_utxo_age: 1
jm_taker_utxo_retries: 10
jm_tx_broadcast: self
jm_blockchain_source: regtest
jm_network: testnet
jm_rpc_host: bitcoind
jm_rpc_port: 43782
jm_rpc_user: joinmarket
jm_rpc_password: joinmarket
jm_tor_control_host: tor
jm_tor_control_port: 9051
jm_onion_socks5_host: tor
jm_onion_socks5_port: 9050
jm_socks5_host: tor
jm_socks5_port: 9050
expose:
- 8080 # payjoin server
- 62601 # obwatch
- 27183 # joinmarketd
- 28183 # jmwalletd
ports:
- "62601:62601"
- "28183:28183"
volumes:
- "joinmarket_datadir:/root/.joinmarket"
- "nbxplorer_datadir:/root/.nbxplorer"
- "tor_datadir:/home/tor/.tor"
depends_on:
- bitcoind
- irc
- nbxplorer
- tor
joinmarket2:
container_name: jm_regtest_joinmarket2
build:
context: ./dockerfile-deps/joinmarket/latest
dockerfile: Dockerfile
restart: unless-stopped
environment:
READY_FILE: /root/.nbxplorer/btc_fully_synched
ENSURE_WALLET: 1
jm_gaplimit: 2000
jm_rpc_wallet_file: jm_secondary
jm_max_cj_fee_abs: 42000000 # 0.42 btc
jm_max_cj_fee_rel: 0.1337 # 13.37%
jm_minimum_makers: 1
jm_taker_utxo_age: 1
jm_taker_utxo_retries: 10
jm_tx_broadcast: self
jm_blockchain_source: regtest
jm_network: testnet
jm_rpc_host: bitcoind
jm_rpc_port: 43782
jm_rpc_user: joinmarket2
jm_rpc_password: joinmarket2
jm_tor_control_host: tor
jm_tor_control_port: 9051
jm_onion_socks5_host: tor
jm_onion_socks5_port: 9050
jm_socks5_host: tor
jm_socks5_port: 9050
expose:
- 8080 # payjoin server
- 62601 # obwatch
- 27183 # joinmarketd
- 28183 # jmwalletd
ports:
- "29183:28183"
volumes:
- "joinmarket2_datadir:/root/.joinmarket"
- "nbxplorer_datadir:/root/.nbxplorer"
- "tor_datadir:/home/tor/.tor"
depends_on:
- bitcoind
- irc
- nbxplorer
- tor
tor:
container_name: jm_regtest_tor
restart: unless-stopped
image: btcpayserver/tor:0.4.6.5
environment:
TOR_PASSWORD: changeme
TOR_ADDITIONAL_CONFIG: /usr/local/etc/tor/torrc-2
TOR_EXTRA_ARGS: |
CookieAuthentication 1
expose:
- "9050" # SOCKS
- "9051" # Tor Control
volumes:
- "tor_datadir:/home/tor/.tor"
- "tor_torrcdir:/usr/local/etc/tor"
- "tor_servicesdir:/var/lib/tor/hidden_services"
volumes:
bitcoin_datadir:
bitcoin_wallet_datadir:
nbxplorer_datadir:
joinmarket_datadir:
joinmarket2_datadir:
irc_datadir:
tor_datadir:
tor_torrcdir:
tor_servicesdir: