Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

walletpair: allow starting walletpair with just one wallet #2982

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 35 additions & 9 deletions dex/testing/walletpair/walletpair.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,33 @@ export SHELL=$(which bash)
SESSION="walletpair"


BW_ARGS=${@}
BW_ARGS=()
SIMNET=""
TESTNET=""
ONLY_ONE=""
ONLY_TWO=""
while [ "${1:-}" != "" ]; do
case "$1" in
--simnet)
SIMNET="1"
echo "Using simnet"
BW_ARGS+=("$1")
;;
--testnet)
TESTNET="1"
echo "Using testnet"
BW_ARGS+=("$1")
;;
-1)
ONLY_ONE="1"
echo "Only starting wallet # 1"
;;
-2)
ONLY_TWO="1"
echo "Only starting wallet # 1"
;;
*)
BW_ARGS+=("$1")
;;
esac
shift
Expand Down Expand Up @@ -130,17 +145,28 @@ chmod +x "${HARNESS_DIR}/bw2ctl"
tmux new-session -d -s $SESSION $SHELL
tmux rename-window -t $SESSION:0 'harness-ctl'

tmux new-window -t $SESSION:1 -n 'bisonw1' $SHELL
tmux send-keys -t $SESSION:1 "cd ${PAIR_ROOT}/dexc1" C-m
tmux send-keys -t $SESSION:1 "${BISONW} --appdata=${CLIENT_1_DIR} ${BW_ARGS}" C-m
if [ -z "${ONLY_TWO}" ]; then
tmux new-window -t $SESSION:1 -n 'bisonw1' $SHELL
tmux send-keys -t $SESSION:1 "cd ${PAIR_ROOT}/dexc1" C-m
tmux send-keys -t $SESSION:1 "${BISONW} --appdata=${CLIENT_1_DIR} ${BW_ARGS[@]}" C-m
fi

tmux new-window -t $SESSION:2 -n 'bisonw1' $SHELL
tmux send-keys -t $SESSION:2 "cd ${PAIR_ROOT}/dexc1" C-m
tmux send-keys -t $SESSION:2 "${BISONW} --appdata=${CLIENT_2_DIR} ${BW_ARGS}" C-m
if [ -z "${ONLY_ONE}" ]; then
tmux new-window -t $SESSION:2 -n 'bisonw2' $SHELL
tmux send-keys -t $SESSION:2 "cd ${PAIR_ROOT}/dexc1" C-m
tmux send-keys -t $SESSION:2 "${BISONW} --appdata=${CLIENT_2_DIR} ${BW_ARGS[@]}" C-m
fi

tmux select-window -t $SESSION:0
sleep 1
tmux send-keys -t $SESSION:0 "cd ${HARNESS_DIR}; tmux wait-for -S walletpair" C-m\; wait-for walletpair
tmux send-keys -t $SESSION:0 "./bisonw1; tmux wait-for -S walletpair" C-m\; wait-for walletpair
tmux send-keys -t $SESSION:0 "./bisonw2" C-m

if [ -z "${ONLY_TWO}" ]; then
tmux send-keys -t $SESSION:0 "./bisonw1; tmux wait-for -S walletpair" C-m\; wait-for walletpair
fi

if [ -z "${ONLY_ONE}" ]; then
tmux send-keys -t $SESSION:0 "./bisonw2" C-m
fi

tmux attach-session -t $SESSION
Loading