SPEC.md writes lineage/v0 down as an ordinals metaprotocol: the envelope fields, chain order, authority by verified parents, every rule, ownership by sat. bin/lineage-index.mjs reads lineage events from a real ord server and folds them with the same reducer the lab uses. tools/regtest rehearses the sample on Bitcoin Core regtest with standardness on: the lab's own action code signs on a chain funded only by coins imported from regtest (LocalChain.importCoin), each beat's transactions are broadcast byte for byte and mined, ord indexes them, and --compare checks the same events in the same beats, the same metadata and parents, every inscription in the same output and the same trees. tests/indexer.test.js replays a recorded run. The first rehearsal found that reveals committed to tapscript's re-encoded tapleaf, which real Bitcoin rejects. They now commit to the exact script bytes, and the local chain checks script paths per BIP-341/342, still loading reveals made before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01H4upF5LVwmPDDqrhdUfnXh
47 lines
2.2 KiB
Markdown
47 lines
2.2 KiB
Markdown
# Regtest rehearsal
|
|
|
|
Lineage is an ordinals metaprotocol (`SPEC.md`). This folder checks that on real Bitcoin Core and real `ord`: the lab's
|
|
own action code makes the yolopreneur sample, Bitcoin Core (regtest, standardness on) accepts its transactions byte
|
|
for byte, `ord` indexes the inscriptions, and the same reducer folds ord's view back into the same trees.
|
|
|
|
Regtest is local and private: nothing is downloaded, blocks are mined on demand, and the data folders stay a few MB.
|
|
Test coins only.
|
|
|
|
## Start
|
|
|
|
```
|
|
brew install bitcoin ord
|
|
mkdir -p ~/lineage-regtest/bitcoin ~/lineage-regtest/ord
|
|
cp tools/regtest/bitcoin.conf ~/lineage-regtest/bitcoin/
|
|
bitcoind -datadir=$HOME/lineage-regtest/bitcoin -daemon
|
|
bitcoin-cli -datadir=$HOME/lineage-regtest/bitcoin createwallet funder
|
|
ord --regtest --bitcoin-data-dir $HOME/lineage-regtest/bitcoin --data-dir $HOME/lineage-regtest/ord \
|
|
server --address 127.0.0.1 --http-port 8088 --polling-interval 1s &
|
|
```
|
|
|
|
`bitcoin.conf` keeps mainnet's standardness rules (`acceptnonstdtxn=0`) and lowers the minimum relay fee to 0.1 sat/vB,
|
|
since the lab pays a fixed 500 sats per transaction.
|
|
|
|
## Rehearse, index, compare
|
|
|
|
```
|
|
node tools/regtest/rehearse.mjs # nine beats; saves the lab to tools/regtest/out/lab.json
|
|
node bin/lineage-index.mjs --from 100 --compare tools/regtest/out/lab.json
|
|
node tools/regtest/record.mjs # refresh tests/fixtures/regtest-rehearsal.json (public data only)
|
|
```
|
|
|
|
The rehearsal funds the lab wallet with real regtest coins (`LocalChain.importCoin`) and pays every local beat to an
|
|
unspendable key, so nothing it signs spends a coin regtest doesn't have. After each beat it broadcasts that beat's
|
|
transactions and mines one regtest block. `--compare` checks that every event landed in the same beat with the same
|
|
metadata and parent, that every inscription sits in the same output, and that both fold into the same trees. Within a
|
|
block the miner may order independent events differently from the lab; that changes nothing (`SPEC.md`, section 2).
|
|
|
|
`out/` holds the lab backup, test keys included, and is not committed.
|
|
|
|
## Stop
|
|
|
|
```
|
|
bitcoin-cli -datadir=$HOME/lineage-regtest/bitcoin stop
|
|
pkill -f "ord --regtest"
|
|
```
|