diff --git a/docker/doichain/Dockerfile b/docker/doichain/Dockerfile index d677a5a..375c1a6 100644 --- a/docker/doichain/Dockerfile +++ b/docker/doichain/Dockerfile @@ -113,7 +113,7 @@ RUN mkdir data && \ #Run entrypoint WORKDIR /home/doichain -ENTRYPOINT ["scripts/entrypoint.sh"] +#ENTRYPOINT ["scripts/entrypoint.sh"] #Start doichain and meteor CMD ["scripts/start.sh"] diff --git a/docker/doichain/docker-compose-regtest.yml b/docker/doichain/docker-compose-regtest.yml index 7e69994..d7ace47 100644 --- a/docker/doichain/docker-compose-regtest.yml +++ b/docker/doichain/docker-compose-regtest.yml @@ -3,20 +3,16 @@ services: image: "doichain/core:dc0.20.1.13" container_name: regtest ports: - - "18338:18338" - - "18339:18339" + - "18332:18332" + - "18443:18443" + - "18445:18445" stdin_open: true volumes: - ./.doichain/:/home/doichain/.doichain/ - - ./entrypoint.sh:/home/doichain/scripts/entrypoint.sh + - ./doichain-regtest.conf:/home/doichain/data/doichain/doichain.conf - ./doichain-start.sh:/home/doichain/scripts/doichain-start.sh - environment: - - RPC_ALLOW_IP=0.0.0.0/0 - - RPC_PASSWORD=adminpw - - REGTEST=true tty: true privileged: true - entrypoint: "./scripts/entrypoint.sh" command: "./scripts/start.sh" networks: - doichain_regtest-network @@ -24,7 +20,7 @@ services: electrumx-doi: container_name: electrumx-doi hostname: electrumx-doi - image: "le-space/electrumx:dc1.2.1" + image: "doichain/electrumx:dc1.2.1" depends_on: - regtest volumes: diff --git a/docker/doichain/doichain-regtest.conf b/docker/doichain/doichain-regtest.conf new file mode 100644 index 0000000..c124bb1 --- /dev/null +++ b/docker/doichain/doichain-regtest.conf @@ -0,0 +1,28 @@ +regtest=1 +testnet=0 +daemon=1 +server=1 +wallet=1 +rpcuser=admin +rpcpassword=adminpw +rpcallowip=0.0.0.0/0 +txindex=1 +fallbackfee=0.0002 +namehistory=1 +rpcworkqueue=100 +blocknotify=curl -X GET http://localhost:3000/api/v1/blocknotify?block=%s +walletnotify=curl -X GET http://localhost:3000/api/v1/walletnotify?tx=%s + +[test] +rpcport=18332 +rpcbind=0.0.0.0 +rpcallowip=0.0.0.0/0 +wallet=1 +port=18445 + +[regtest] +rpcport=18332 +rpcbind=0.0.0.0 +rpcallowip=0.0.0.0/0 +wallet=1 +port=18445 \ No newline at end of file diff --git a/docker/doichain/electrumx/Dockerfile b/docker/doichain/electrumx/Dockerfile index 810fb69..6559777 100644 --- a/docker/doichain/electrumx/Dockerfile +++ b/docker/doichain/electrumx/Dockerfile @@ -29,4 +29,5 @@ WORKDIR /electrumx # Start ElectrumX server. ENTRYPOINT ["./electrumx_server"] -RUN rm -rf /var/lib/apt/lists/* \ No newline at end of file +# Safely remove the apt lists if they exist +RUN [ -d /var/lib/apt/lists ] && rm -rf /var/lib/apt/lists/* || true \ No newline at end of file diff --git a/docker/doichain/entrypoint.sh b/docker/doichain/entrypoint.sh deleted file mode 100755 index e0def4a..0000000 --- a/docker/doichain/entrypoint.sh +++ /dev/null @@ -1,106 +0,0 @@ -#!/bin/bash -set -euo pipefail - -_RPC_PORT=${RPC_PORT} -_NODE_PORT=${NODE_PORT} -_DAPP_URL=${DAPP_URL} -_REGTEST=0 -_TESTNET=0 -DOICHAIN_CONF_FILE=/home/doichain/data/doichain/doichain.conf -DOICHAIN_BASE_DIR="/home/doichain/data/doichain" -TESTNET_DIR="${DOICHAIN_BASE_DIR}/testnet" -REGTEST_DIR="${DOICHAIN_BASE_DIR}/regtest" - -if [ $REGTEST = true ]; then - _REGTEST=1 - _RPC_PORT=$RPC_PORT_REGTEST - _NODE_PORT=$NODE_PORT_REGTEST - - if [ ! -d "$REGTEST_DIR" ]; then - echo "Creating directory: ${REGTEST_DIR}/" - mkdir -p "${REGTEST_DIR}/" - fi - DOICHAIN_CONF_FILE="${REGTEST_DIR}/doichain.conf" -fi - -if [ $TESTNET = true ]; then - _TESTNET=1 - _RPC_PORT=$RPC_PORT_TESTNET - _NODE_PORT=$NODE_PORT_TESTNET - - if [ ! -d "$TESTNET_DIR" ]; then - echo "Creating directory: ${TESTNET_DIR}/" - mkdir -p "${TESTNET_DIR}/" - fi - - DOICHAIN_CONF_FILE="${TESTNET_DIR}/doichain.conf" -fi - -if [ -z ${RPC_USER} ]; then - RPC_USER='admin' - echo "RPC_USER was not set, using "$RPC_USER -fi - -if [ -z ${RPC_PASSWORD} ]; then - #echo "generating password" - RPC_PASSWORD=$(xxd -l 30 -p /dev/urandom) - echo "RPC_PASSWORD was not set, generated: "$RPC_PASSWORD -fi - -if [ -z ${DAPP_URL} ]; then - _DAPP_URL=$DAPP_URL -fi - -if [ ! -f "$DOICHAIN_CONF_FILE" ]; then -echo "DOICHAIN_CONF_FILE not found - generating new!" -echo " -regtest=$_REGTEST -testnet=$_TESTNET -daemon=1 -server=1 -wallet=1 -rpcuser=${RPC_USER} -rpcpassword=${RPC_PASSWORD} -rpcallowip=${RPC_ALLOW_IP} -txindex=1 -fallbackfee=0.0002 -namehistory=1 -rpcworkqueue=100 -blocknotify=curl -X GET ${DAPP_URL}/api/v1/blocknotify?block=%s -walletnotify=curl -X GET ${DAPP_URL}/api/v1/walletnotify?tx=%s - -[test] -rpcport=${_RPC_PORT} -rpcbind=0.0.0.0 -rpcallowip=0.0.0.0/0 -wallet=1 -port=${_NODE_PORT} - -[regtest] -rpcport=${_RPC_PORT} -rpcbind=0.0.0.0 -rpcallowip=0.0.0.0/0 -wallet=1 -port=${_NODE_PORT}" > $DOICHAIN_CONF_FILE -fi -echo "DOICHAIN_CONF_FILE: $DOICHAIN_CONF_FILE" -if [ -f "$DOICHAIN_CONF_FILE" ]; then - echo "Config file exists and is a regular file" - ls -la "$DOICHAIN_CONF_FILE" -else - echo "WARNING: Config file does not exist at $DOICHAIN_CONF_FILE" -fi -# Only create symlink for testnet and regtest -if [ $REGTEST = true ]; then - RELATIVE_PATH="regtest/doichain.conf" - echo "Creating link to conf file with relative path: ${RELATIVE_PATH}" - rm -f "${DOICHAIN_BASE_DIR}/doichain.conf" - ln -s "${RELATIVE_PATH}" "${DOICHAIN_BASE_DIR}/doichain.conf" -elif [ $TESTNET = true ]; then - RELATIVE_PATH="testnet/doichain.conf" - echo "Creating link to conf file with relative path: ${RELATIVE_PATH}" - rm -f "${DOICHAIN_BASE_DIR}/doichain.conf" - ln -s "${RELATIVE_PATH}" "${DOICHAIN_BASE_DIR}/doichain.conf" -fi - -exec "$@"