decred.org/dcrdex@v1.0.5/dex/testing/btc/README.md (about) 1 # BTC Simnet Test Harness 2 The harness script will create three connected regnet nodes and wallets, and 3 then mine some blocks and send some BTC around. The result is a set of wallets 4 named **alpha**, **beta**, and **gamma**, each with slightly different 5 properties. 6 7 **Beta** is purely a mining node/wallet and has never sent a transaction. Beta 8 does have some mature coinbase transaction outputs to spend. 9 10 **Alpha** is also a mining node/wallet. Unlike beta, alpha has sent some BTC 11 so has some change outputs that are not coinbase and have varying number of 12 confirmations. 13 14 **Gamma** is another wallet on the alpha node. Gamma is encrypted, so requires 15 unlocking for sensitive operations. Gamma has no coinbase-spending outputs, 16 but has a number of UTXOs of varying size and confirmation count. 17 **The gamma wallet password is "abc"**. 18 19 ## Dependencies 20 21 You must have [bitcoind and bitcoin-cli](https://github.com/bitcoin/bitcoin/releases) 22 in `PATH` to use the harness. bitcoin v26.0.0+ is recommended. 23 24 It also requires tmux. 25 26 ## Harness control scripts 27 28 The `./harness.sh` script will drop you into a tmux window in a directory 29 called `harness-ctl`. Inside of this directory are a number of scripts to 30 allow you to perform RPC calls against each wallet. 31 32 `./alpha`, `./beta`, and `./gamma` are just `bitcoin-cli` configured for their 33 respective wallets. 34 Try `./gamma getbalance`, for example. 35 36 `./reorg` will step through a script that causes the alpha node to undergo a 37 1-deep reorganization. 38 39 `./quit` shuts down the nodes and closes the tmux session. 40 41 ## Dev Stuff 42 43 If things aren't looking right, you may need to look at the node windows to 44 see errors. In tmux, you can navigate between windows by typing `Ctrl+b` and 45 then the window number. The window numbers are listed at the bottom 46 of the tmux window. `Ctrl+b` followed by the number `0`, for example, will 47 change to the alpha node window. Examining the node output to look for errors 48 is usually a good first debugging step. 49 50 An unfortunate issue that will pop up if you're fiddling with the script is 51 zombie bitcoind processes preventing the harness nodes from binding to the 52 specified ports. You'll have to manually hunt down the zombie PIDs and `kill` 53 them if this happens. 54 55 Don't forget that there may be tests that rely on the existing script's 56 specifics to function correctly. Changes must be tested throughout dcrdex.