1. What it tests
| # | Check | Verifies |
|---|---|---|
| 1–3 | Node startup | All 3 nodes start at height 0 |
| 4 | Address prefix | Regtest addresses use b3rt1 |
| 5 | Peer connectivity | Nodes discover and connect |
| 6 | Mining (2 016 blocks) | BLAKE3 PoW works via generatetoaddress |
| 7–8 | Block sync | Blocks propagate to all nodes |
| 9–10 | Tip consensus | All 3 nodes agree on the chain tip |
| 11 | Miner balance | Coinbase rewards (50 B3C/block) |
| 12 | Block subsidy | Block 1 coinbase pays exactly 50.00000000 B3C |
| 13–14 | Wallet send | Node 0 sends to nodes 1 and 2 |
| 15 | Cross-node send | Node 1 sends to node 2 (full P2P relay) |
| 16 | Chain work | Cumulative chain work identical across nodes |
| 17 | Genesis hash | Genesis matches expected |
| 18 | Mid-chain hash | Block 1008 hash identical across nodes |
| 19 | UTXO set | UTXO set hash identical across nodes |
2. Prerequisites
OS
Linux or WSL2
b3chaind
built; expected at
build/bin/b3chaindFree ports
29100–29105 on 127.0.0.1
3. Run it
git clone https://github.com/b3chain/b3chain.git cd b3chain mkdir build && cd build cmake .. cmake --build . -j$(nproc) cd .. bash contrib/testing/regtest-simulation.sh
4. Expected output
============================================================ B3Chain Regtest Simulation (2016 blocks, 3 nodes) ============================================================ [1/8] Setting up test environment... PASS: Node 0 started at height 0 PASS: Node 1 started at height 0 PASS: Node 2 started at height 0 [2/8] Creating wallets... Node 0 (miner): b3rt1q... Node 1 (wallet): b3rt1q... Node 2 (wallet): b3rt1q... PASS: Address uses b3rt prefix [3/8] Testing peer connectivity... PASS: Node 0 has 2 peer(s) [4/8] Mining 2016 blocks (full retarget period)... Mined 500 / 2016 blocks... Mined 1000 / 2016 blocks... Mined 1500 / 2016 blocks... Mined 2000 / 2016 blocks... Mined 2016 / 2016 blocks... Mining took 65s PASS: Node 0 at height 2016 PASS: Node 1 synced to 2016 PASS: Node 2 synced to 2016 PASS: All nodes agree on tip PASS: All nodes agree on tip (node2) [5/8] ... ============================================================ RESULTS: 19 passed, 0 failed ============================================================ All tests passed!
5. Common pitfalls
- Port conflict: if 29100–29105 are already in use, edit
the
NODE*_P2P/NODE*_RPCvariables at the top of the script. - WSL crash on stop:
cleanuptrap callspkill -f "b3chaind.*regtest_sim"; if you ran a node by hand against the same datadir it may also be killed. - Slow disk: mining 2 016 blocks writes ~10 MB. If your
/tmpis on a slow filesystem, setTESTDIR=/some/fast/pathat the top.