Skip to content

Commit

Permalink
dcr harness: allow specifying binary paths
Browse files Browse the repository at this point in the history
  • Loading branch information
chappjc committed Dec 10, 2021
1 parent 7345d1c commit 3043d04
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
8 changes: 5 additions & 3 deletions dex/testing/dcr/create-wallet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ HTTPPROF_PORT=$6
WALLET_DIR="${NODES_ROOT}/${NAME}"
mkdir -p ${WALLET_DIR}

DCRWALLET=${DCRWALLET:-dcrwallet-1.6}

export SHELL=$(which bash)

# Connect to alpha or beta node
Expand Down Expand Up @@ -63,7 +65,7 @@ EOF
# wallet ctl script
cat > "${NODES_ROOT}/harness-ctl/${NAME}" <<EOF
#!/usr/bin/env bash
dcrctl -C "${WALLET_DIR}/${NAME}-ctl.conf" --wallet \$*
${DCRCTL} -C "${WALLET_DIR}/${NAME}-ctl.conf" --wallet \$*
EOF
chmod +x "${NODES_ROOT}/harness-ctl/${NAME}"

Expand All @@ -81,8 +83,8 @@ tmux send-keys -t $TMUX_WIN_ID "set +o history" C-m
tmux send-keys -t $TMUX_WIN_ID "cd ${WALLET_DIR}" C-m

echo "Creating simnet ${NAME} wallet"
tmux send-keys -t $TMUX_WIN_ID "dcrwallet -C ${NAME}.conf --create < wallet.answers; tmux wait-for -S ${NAME}" C-m
tmux send-keys -t $TMUX_WIN_ID "${DCRWALLET} -C ${NAME}.conf --create < wallet.answers; tmux wait-for -S ${NAME}" C-m
tmux wait-for ${NAME}

echo "Starting simnet ${NAME} wallet"
tmux send-keys -t $TMUX_WIN_ID "dcrwallet -C ${NAME}.conf" C-m
tmux send-keys -t $TMUX_WIN_ID "${DCRWALLET} -C ${NAME}.conf" C-m
16 changes: 10 additions & 6 deletions dex/testing/dcr/harness.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ TRADING_WALLET2_PORT="19582"
# wait for process termination.
WAIT="; tmux wait-for -S donedcr"

DCRD=${DCRD:-dcrd-1.6}
DCRCTL=${DCRCTL:-dcrctl-1.6}
export DCRCTL

NODES_ROOT=~/dextest/dcr
export NODES_ROOT

Expand Down Expand Up @@ -83,9 +87,9 @@ NUM=1
*) NUM=\$1 ;;
esac
for i in \$(seq \$NUM) ; do
dcrctl -C ${NODES_ROOT}/alpha/alpha-ctl.conf regentemplate
${DCRCTL} -C ${NODES_ROOT}/alpha/alpha-ctl.conf regentemplate
sleep 0.05
dcrctl -C ${NODES_ROOT}/alpha/alpha-ctl.conf generate 1
${DCRCTL} -C ${NODES_ROOT}/alpha/alpha-ctl.conf generate 1
if [ $i != $NUM ]; then
sleep ${MINE_SLEEP}
fi
Expand All @@ -102,9 +106,9 @@ NUM=1
*) NUM=\$1 ;;
esac
for i in \$(seq \$NUM) ; do
dcrctl -C ${NODES_ROOT}/beta/beta-ctl.conf regentemplate
${DCRCTL} -C ${NODES_ROOT}/beta/beta-ctl.conf regentemplate
sleep 0.05
dcrctl -C ${NODES_ROOT}/beta/beta-ctl.conf generate 1
${DCRCTL} -C ${NODES_ROOT}/beta/beta-ctl.conf generate 1
if [ $i != $NUM ]; then
sleep ${MINE_SLEEP}
fi
Expand Down Expand Up @@ -186,7 +190,7 @@ tmux send-keys -t $SESSION:1 "set +o history" C-m
tmux send-keys -t $SESSION:1 "cd ${NODES_ROOT}/alpha" C-m

echo "Starting simnet alpha node (txindex for server)"
tmux send-keys -t $SESSION:1 "dcrd --appdata=${NODES_ROOT}/alpha \
tmux send-keys -t $SESSION:1 "${DCRD} --appdata=${NODES_ROOT}/alpha \
--rpcuser=${RPC_USER} --rpcpass=${RPC_PASS} \
--miningaddr=${ALPHA_MINING_ADDR} --rpclisten=:${ALPHA_RPC_PORT} \
--txindex --listen=:${ALPHA_NODE_PORT} \
Expand All @@ -199,7 +203,7 @@ tmux send-keys -t $SESSION:2 "set +o history" C-m
tmux send-keys -t $SESSION:2 "cd ${NODES_ROOT}/beta" C-m

echo "Starting simnet beta node (no txindex for a typical client)"
tmux send-keys -t $SESSION:2 "dcrd --appdata=${NODES_ROOT}/beta \
tmux send-keys -t $SESSION:2 "${DCRD} --appdata=${NODES_ROOT}/beta \
--rpcuser=${RPC_USER} --rpcpass=${RPC_PASS} \
--listen=:${BETA_NODE_PORT} --rpclisten=:${BETA_RPC_PORT} \
--miningaddr=${BETA_MINING_ADDR} \
Expand Down

0 comments on commit 3043d04

Please sign in to comment.