docker: Update templates for BCH.

This commit is contained in:
tecnovert 2024-11-12 22:43:32 +02:00
parent 283cfc7c59
commit ca5b9e5e00
10 changed files with 47 additions and 25 deletions

View file

@ -1972,8 +1972,8 @@ def main():
chainclients['bitcoin']['rpcuser'] = BTC_RPC_USER
chainclients['bitcoin']['rpcpassword'] = BTC_RPC_PWD
if BCH_RPC_USER != '':
chainclients['bitcoin']['rpcuser'] = BCH_RPC_USER
chainclients['bitcoin']['rpcpassword'] = BCH_RPC_PWD
chainclients['bitcoincash']['rpcuser'] = BCH_RPC_USER
chainclients['bitcoincash']['rpcpassword'] = BCH_RPC_PWD
if XMR_RPC_USER != '':
chainclients['monero']['rpcuser'] = XMR_RPC_USER
chainclients['monero']['rpcpassword'] = XMR_RPC_PWD

View file

@ -1502,7 +1502,7 @@ class BTCInterface(Secp256k1Interface):
'amount': txjs['vout'][n]['value']
}
def inspectSwipeTx(self, tx: dict) -> bytes | None:
def inspectSwipeTx(self, tx: dict):
mercy_keyshare = None
for vout in tx['vout']:
script_bytes = bytes.fromhex(vout['scriptPubKey']['hex'])

View file

@ -8,20 +8,20 @@ RUN basicswap-prepare --preparebinonly --bindir=/coin_bin --withcoin=bitcoincash
FROM debian:bullseye-slim
COPY --from=install_stage /coin_bin .
ENV BITCOIN_DATA /data
ENV BITCOINCASH_DATA /data
RUN groupadd -r bitcoin && useradd -r -m -g bitcoin bitcoin \
RUN groupadd -r bitcoincash && useradd -r -m -g bitcoincash bitcoincash \
&& apt-get update \
&& apt-get install -qq --no-install-recommends gosu \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir "$BITCOIN_DATA" \
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
&& mkdir "$BITCOINCASH_DATA" \
&& chown -R bitcoincash:bitcoincash "$BITCOINCASH_DATA" \
&& ln -sfn "$BITCOINCASH_DATA" /home/bitcoincash/.bitcoincash \
&& chown -h bitcoincash:bitcoincash /home/bitcoincash/.bitcoincash
VOLUME /data
COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
EXPOSE 8332 8333 18332 18333 18443 18444
CMD ["/bitcoin/bitcoind", "--datadir=/data"]
CMD ["/bitcoincash/bitcoind", "--datadir=/data"]

View file

@ -2,10 +2,10 @@
set -e
if [[ "$1" == "bitcoin-cli" || "$1" == "bitcoin-tx" || "$1" == "bitcoind" || "$1" == "test_bitcoin" ]]; then
mkdir -p "$BITCOIN_DATA"
mkdir -p "$BITCOINCASH_DATA"
chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
exec gosu bitcoin "$@"
chown -h bitcoincash:bitcoincash /home/bitcoincash/.bitcoincash
exec gosu bitcoincash "$@"
else
exec "$@"
fi

View file

@ -0,0 +1,16 @@
bitcoincash_core:
image: i_bitcoincash
build:
context: bitcoincash
dockerfile: Dockerfile
container_name: bitcoincash_core
volumes:
- ${DATA_PATH}/bitcoincash:/data
expose:
- ${BCH_RPC_PORT}
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
restart: unless-stopped

View file

@ -7,7 +7,7 @@
volumes:
- ${DATA_PATH}/wownero_daemon:/data
expose:
- ${BASE_WOW_RPC_PORT}
- ${WOW_RPC_PORT}
logging:
driver: "json-file"
options:

View file

@ -16,6 +16,7 @@
- ${DATA_PATH}/pivx:/data/pivx
- ${DATA_PATH}/dash:/data/dash
- ${DATA_PATH}/firo:/data/firo
- ${DATA_PATH}/bitcoincash:/data/bitcoincash
environment:
- TZ
- BSX_DOCKER_MODE
@ -50,8 +51,8 @@
- DEFAULT_XMR_RESTORE_HEIGHT
- WOW_DATA_DIR
- WOW_RPC_HOST
- BASE_WOW_RPC_PORT
- BASE_WOW_ZMQ_PORT
- WOW_RPC_PORT
- WOW_ZMQ_PORT
- WOW_WALLETS_DIR
- WOW_WALLET_RPC_HOST
- WOW_WALLET_RPC_PORT
@ -73,4 +74,9 @@
- FIRO_RPC_PORT
- FIRO_RPC_USER
- FIRO_RPC_PWD
- BCH_DATA_DIR
- BCH_RPC_HOST
- BCH_RPC_PORT
- BCH_RPC_USER
- BCH_RPC_PWD
restart: "no"

View file

@ -21,12 +21,6 @@ BTC_RPC_PORT=19796
BTC_RPC_USER=bitcoin_user
BTC_RPC_PWD=bitcoin_pwd
BCH_DATA_DIR=/data/bitcoincash
BCH_RPC_HOST=bitcoincash_core
BCH_RPC_PORT=19797
BCH_RPC_USER=bitcoincash_user
BCH_RPC_PWD=bitcoincash_pwd
LTC_DATA_DIR=/data/litecoin
LTC_RPC_HOST=litecoin_core
LTC_RPC_PORT=19795
@ -78,3 +72,9 @@ FIRO_RPC_HOST=firo_core
FIRO_RPC_PORT=8888
FIRO_RPC_USER=firo_user
FIRO_RPC_PWD=firo_pwd
BCH_DATA_DIR=/data/bitcoincash
BCH_RPC_HOST=bitcoincash_core
BCH_RPC_PORT=19797
BCH_RPC_USER=bitcoincash_user
BCH_RPC_PWD=bitcoincash_pwd

View file

@ -165,7 +165,7 @@ Prepare config files:
export ADD_COIN=monero
docker-compose -f docker-compose-prepare.yml run --rm swapprepare \
basicswap-prepare --nocores --usecontainers --addcoin=${ADD_COIN} --htmlhost="0.0.0.0" --particl_mnemonic=none
basicswap-prepare --nocores --usecontainers --addcoin=${ADD_COIN} --particl_mnemonic=none
Prepare wallet:
@ -177,7 +177,7 @@ Prepare wallet:
docker-compose -f docker-compose-prepare.yml run -e WALLET_ENCRYPTION_PWD=walletpass \
--rm swapprepare \
basicswap-prepare --initwalletsonly --withoutcoin=particl --withcoin=monero
basicswap-prepare --initwalletsonly --withoutcoin=particl --withcoin=${ADD_COIN}
docker-compose -f docker-compose-prepare.yml stop

View file

@ -6,7 +6,7 @@ ENV LANG=C.UTF-8 \
RUN apt-get update; \
apt-get install -y --no-install-recommends \
python3-pip libpython3-dev gnupg pkg-config gcc libc-dev gosu tzdata;
python3-pip libpython3-dev gnupg pkg-config gcc libc-dev gosu tzdata wget unzip;
ARG BASICSWAP_URL=https://github.com/basicswap/basicswap/archive/master.zip
ARG BASICSWAP_DIR=basicswap-master