From c8aa4d77df21be4eebf81c04acf4f43611f19c9a Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Tue, 27 Feb 2024 16:20:06 -0800 Subject: [PATCH] Document `ord env` (#3180) --- docs/src/guides/testing.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/docs/src/guides/testing.md b/docs/src/guides/testing.md index 1750bd4e18..223fdfd33f 100644 --- a/docs/src/guides/testing.md +++ b/docs/src/guides/testing.md @@ -1,6 +1,36 @@ Testing ======= +Test Environment +---------------- + +`ord env ` creates a test environment in ``, spins up +`bitcoind` and `ord server` instances, prints example commands for interacting +with the test `bitcoind` and `ord server` instances, waits for `CTRL-C`, and +then shuts down `bitcoind` and `ord server`. + +`ord env` tries to use port 9000 for `bitcoind`'s RPC interface, and port +`9001` for `ord`'s RPC interface, but will fall back to random unused ports. + +Inside of the env directory, `ord env` will write `bitcoind`'s configuration to +`bitcoin.conf`, and the env configuration to `env.json`. + +`env.json` contains the commands needed to invoke `bitcoin-cli` and `ord +wallet`, as well as the ports `bitcoind` and `ord server` are listening on. + +These can be extracted into shell commands using `jq`: + +```shell +bitcoin=`jq -r '.bitcoin_cli_command | join(" ")' env/env.json` +$bitcoin listunspent + +ord=`jq -r '.ord_wallet_command | join(" ")' env/env.json` +$ord outputs +``` + +Test Networks +------------- + 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).