Skip to content

Commit

Permalink
harness/btc: Enable deprecated dbd database.
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeGruffins committed Jan 1, 2024
1 parent f89ef06 commit 1db84c5
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
10 changes: 7 additions & 3 deletions dex/testing/btc/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# BTC Simnet Test Harness

You must have `bitcoind` and `bitcoin-cli` in `PATH` to use the harness.

The harness script will create three connected regnet nodes and wallets, and
then mine some blocks and send some BTC around. The result is a set of wallets
named **alpha**, **beta**, and **gamma**, each with slightly different
Expand All @@ -19,6 +16,13 @@ unlocking for sensitive operations. Gamma has no coinbase-spending outputs,
but has a number of UTXOs of varying size and confirmation count.
**The gamma wallet password is "abc"**.

## Dependencies

You must have [bitcoind and bitcoin-cli](https://github.com/bitcoin/bitcoin/releases)
in `PATH` to use the harness. bitcoin v26.0.0+ is recommended.

It also requires tmux.

## Harness control scripts

The `./harness.sh` script will drop you into a tmux window in a directory
Expand Down
14 changes: 12 additions & 2 deletions dex/testing/btc/base-harness.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@ WAIT="wait-for ${SYMBOL}"

SESSION="${SYMBOL}-harness"

deprecateddbd () {
if [ $1 = false ] && [ "$VERSION_26_TEMP_DEPRICATED_DBD" ]; then
descs="-deprecatedrpc=create_bdb"
else
descs=""
fi

echo "$descs"
}

export SHELL=$(which bash)

################################################################################
Expand Down Expand Up @@ -101,7 +111,7 @@ tmux send-keys -t $SESSION:0 "set +o history" C-m
tmux send-keys -t $SESSION:0 "cd ${ALPHA_DIR}" C-m
echo "Starting simnet alpha node"
tmux send-keys -t $SESSION:0 "${DAEMON} -rpcuser=user -rpcpassword=pass \
-rpcport=${ALPHA_RPC_PORT} -datadir=${ALPHA_DIR} \
-rpcport=${ALPHA_RPC_PORT} -datadir=${ALPHA_DIR} $(deprecateddbd $ALPHA_DESCRIPTOR_WALLET) \
-debug=rpc -debug=net -debug=mempool -debug=walletdb -debug=addrman -debug=mempoolrej \
-whitelist=127.0.0.0/8 -whitelist=::1 \
-txindex=1 -regtest=1 -port=${ALPHA_LISTEN_PORT} -fallbackfee=0.00001 \
Expand All @@ -117,7 +127,7 @@ tmux send-keys -t $SESSION:1 "set +o history" C-m
tmux send-keys -t $SESSION:1 "cd ${BETA_DIR}" C-m

echo "Starting simnet beta node"
tmux send-keys -t $SESSION:1 "${DAEMON} -rpcuser=user -rpcpassword=pass \
tmux send-keys -t $SESSION:1 "${DAEMON} -rpcuser=user -rpcpassword=pass $(deprecateddbd $BETA_DESCRIPTOR_WALLET)\
-rpcport=${BETA_RPC_PORT} -datadir=${BETA_DIR} -txindex=1 -regtest=1 \
-debug=rpc -debug=net -debug=mempool -debug=walletdb -debug=addrman -debug=mempoolrej \
-whitelist=127.0.0.0/8 -whitelist=::1 \
Expand Down
2 changes: 2 additions & 0 deletions dex/testing/btc/harness.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ export DELTA_WALLET_SEED="cURsyTZ8icuTHwWxSfTC2Geu2F6dMRtnzt1gvSaxHdc9Zf6eviJN"
export DELTA_ADDRESS="bcrt1q4clywna5re22qh9mexqty8u8mqvhjh8cwhp5ms"
export EXTRA_ARGS="--blockfilterindex --peerblockfilters --rpcbind=0.0.0.0 --rpcallowip=0.0.0.0/0"
export CREATE_DEFAULT_WALLET="1"
export VERSION_26_TEMP_DEPRICATED_DBD="1"


# The new-wallet script creates a new wallet with keys (not blank), and no
# passphrase. $1 is the node to create the wallet on, $2 is the wallet
Expand Down

0 comments on commit 1db84c5

Please sign in to comment.