Create an isolated persistent Octez mockup fixture
A stateful mockup lets a contract developer repeat local operations against one ledger without starting a Tezos network. Reusing the same base directory is essential.
Initialize a disposable state directory
Run the example with Octez installed. The first call initializes a local mockup. The balance query uses the identical directory and resolves the bootstrap account in that fixture.
DIR=$(mktemp -d)
octez-client --mode mockup --base-dir "$DIR" create mockup
octez-client --mode mockup --base-dir "$DIR" get balance for bootstrap1
Record the initial balance and use separate fresh directories for independent test scenarios. If a later command omits the base directory or mockup mode, it can read a different context and invalidate the comparison.
Know which behavior needs a network
The fixture is suitable for local protocol and contract behavior under its configured constants. It does not reproduce peer propagation, competing bakers or the live network’s mempool policy. Record the selected protocol for reproducible tests. octez.tezos.com Octez protocol documentation