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

Testing guide #2357

Merged
merged 4 commits into from
Aug 27, 2023
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions docs/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- [Sat Hunting](guides/sat-hunting.md)
- [Collecting](guides/collecting.md)
- [Sparrow Wallet](guides/collecting/sparrow-wallet.md)
- [Testing](guides/testing.md)
- [Moderation](guides/moderation.md)
- [Bounties](bounties.md)
- [Bounty 0: 100,000 sats Claimed!](bounty/0.md)
Expand Down
73 changes: 73 additions & 0 deletions docs/src/guides/testing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
Testing
=======

Ord can be tested using the following flags to specify the test network. For more
information on running Bitcoin Core for testing, see [Bitcoin's developer documentation](https://developer.bitcoin.org/examples/testing.html).

Most `ord` commands in [inscriptions](inscriptions.md) and [explorer](explorer.md)
can be run with the following network flags:

| Network | Flag |
|---------|------|
| Testnet | `--testnet` or `-t` |
| Signet | `--signet` or `-s` |
| Regtest | `--regtest` or `-r` |

Regtest doesn't require downloading the blockchain or indexing ord.

Example
-------

Run bitcoind in regtest with:
```
bitcoind -regtest -txindex
```
Create a wallet in regtest with:
```
ord -r wallet create
```
Get a regtest receive address with:
```
ord -r wallet receive
```
Mine 101 blocks (to unlock the coinbase) with:
```
bitcoin-cli generatetoaddress 101 <receive address>
```
Inscribe in regtest with:
```
ord -r wallet inscribe --fee-rate 1 <file>
```
Mine the inscription with:
```
bitcoin-cli generatetoaddress 1 <receive address>
```
View the inscription in the regtest explorer:
```
ord -r server
```

Testing Recursion
-----------------

When testing out [recursion](../inscriptions/recursion.md), inscribe the
dependencies first (example with [p5.js](https://p5js.org):
```
ord -r wallet inscribe --fee-rate 1 p5.js
```
This should return a `inscription_id` which you can then reference in your
recursive inscription.

ATTENTION: These ids will be different when inscribing on
mainnet or signet, so be sure to change those in your recursive inscription for
each chain.

Then you can inscribe your recursive inscription with:
```
ord -r wallet inscribe --fee-rate 1 recursive-inscription.html
```
Finally you will have to mine some blocks and start the server:
```
bitcoin-cli generatetoaddress 6 <receive address>
ord -r server
```