Skip to content

Commit

Permalink
harness: Make the harness more Windows friendly.
Browse files Browse the repository at this point in the history
Msys automatically transforms paths for executed commands, but it is
unable to do that for paths in the config files.  This updates all of
the paths in the config files to use relative paths instead so they work
with the various processes.

It also use the posix copliant shebang for locating bash and adds a new
variable to control whether or not the profiling ports are enabled.
  • Loading branch information
davecgh committed Sep 14, 2023
1 parent 7b1fff0 commit 81bd5a7
Showing 1 changed file with 22 additions and 18 deletions.
40 changes: 22 additions & 18 deletions harness.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
#
# Copyright (c) 2020 The Decred developers
# Use of this source code is governed by an ISC
Expand Down Expand Up @@ -30,8 +30,12 @@ PAYMENT_METHOD="pplns"
LAST_N_PERIOD=5m
GUI_DIR="${HARNESS_ROOT}/gui"

# Enabling profiling uses a lot more ports that might conflict with other Decred
# software. Set to 1 to enable. Leave blank to disable.
ENABLE_PROFILING=

# Using postgres requires the DB specified below to already exist.
USE_POSTGRES=1
USE_POSTGRES=0
POSTGRES_HOST=127.0.0.1
POSTGRES_PORT=5432
POSTGRES_USER=dcrpooluser
Expand Down Expand Up @@ -101,31 +105,31 @@ user=m$i
address=${CLIENT_ADDRS[$i]}
pool=127.0.0.1:5550
maxprocs=$MINER_MAX_PROCS
profile=$PROFILE_PORT
profile=${ENABLE_PROFILING-$PROFILE_PORT}
EOF
done

cat > "${HARNESS_ROOT}/master/dcrmctl.conf" <<EOF
rpcuser=${RPC_USER}
rpcpass=${RPC_PASS}
rpccert=${HARNESS_ROOT}/master/rpc.cert
rpccert=./rpc.cert
rpcserver=127.0.0.1:19556
EOF

cat > "${HARNESS_ROOT}/vnode/dcrvctl.conf" <<EOF
rpcuser=${RPC_USER}
rpcpass=${RPC_PASS}
rpccert=${HARNESS_ROOT}/vnode/rpc.cert
rpccert=./rpc.cert
rpcserver=127.0.0.1:19560
EOF

cat > "${HARNESS_ROOT}/pool/pool.conf" <<EOF
rpcuser=${RPC_USER}
rpcpass=${RPC_PASS}
dcrdrpchost=127.0.0.1:19556
dcrdrpccert=${HARNESS_ROOT}/master/rpc.cert
dcrdrpccert=../master/rpc.cert
walletgrpchost=127.0.0.1:19558
walletrpccert=${HARNESS_ROOT}/mwallet/rpc.cert
walletrpccert=../mwallet/rpc.cert
debuglevel=trace
maxgentime=${MAX_GEN_TIME}
solopool=${SOLO_POOL}
Expand All @@ -135,9 +139,9 @@ poolfeeaddrs=${PFEE_ADDR}
paymentmethod=${PAYMENT_METHOD}
lastnperiod=${LAST_N_PERIOD}
adminpass=${ADMIN_PASS}
guidir=${GUI_DIR}
guidir=../gui
designation=${TMUX_SESSION}
profile=6060
profile=${ENABLE_PROFILING-6060}
postgres=${USE_POSTGRES}
postgreshost=${POSTGRES_HOST}
postgresport=${POSTGRES_PORT}
Expand All @@ -149,24 +153,24 @@ EOF
cat > "${HARNESS_ROOT}/mwallet/dcrmwctl.conf" <<EOF
rpcuser=${RPC_USER}
rpcpass=${RPC_PASS}
rpccert=${HARNESS_ROOT}/mwallet/rpc.cert
rpccert=./rpc.cert
rpcserver=127.0.0.1:19557
EOF

cat > "${HARNESS_ROOT}/vwallet/dcrvwctl.conf" <<EOF
rpcuser=${RPC_USER}
rpcpass=${RPC_PASS}
rpccert=${HARNESS_ROOT}/vwallet/rpc.cert
rpccert=./rpc.cert
rpcserver=127.0.0.1:19562
EOF

cat > "${HARNESS_ROOT}/mwallet/mwallet.conf" <<EOF
username=${RPC_USER}
password=${RPC_PASS}
cafile=${HARNESS_ROOT}/master/rpc.cert
clientcafile=${HARNESS_ROOT}/pool/wallet.cert
logdir=${HARNESS_ROOT}/mwallet/log
appdata=${HARNESS_ROOT}/mwallet
cafile=../master/rpc.cert
clientcafile=../pool/wallet.cert
logdir=./logs
appdata=../mwallet
simnet=1
pass=${WALLET_PASS}
accountgaplimit=25
Expand All @@ -175,9 +179,9 @@ EOF
cat > "${HARNESS_ROOT}/vwallet/vwallet.conf" <<EOF
username=${RPC_USER}
password=${RPC_PASS}
cafile=${HARNESS_ROOT}/vnode/rpc.cert
logdir=${HARNESS_ROOT}/vwallet/log
appdata=${HARNESS_ROOT}/vwallet
cafile=../vnode/rpc.cert
logdir=./logs
appdata=../vwallet
simnet=1
enablevoting=1
enableticketbuyer=1
Expand Down

0 comments on commit 81bd5a7

Please sign in to comment.