Skip to content
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
4 changes: 4 additions & 0 deletions compose/genesis/dummy.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Placeholder bind-mount target used when MIDEN_GENESIS_CONFIG_FILE is not set.
#
# This file is not passed to `miden-validator bootstrap`; omitting the
# --genesis-config-file flag preserves the validator's built-in default genesis config.
23 changes: 22 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
# Environment variables:
# - MIDEN_REMOTE_PROVER_URL: remote transaction prover URL. Defaults to the
# bundled miden-remote-prover service at http://tx-prover:50051.
# - MIDEN_GENESIS_CONFIG_FILE: path to the genesis configuration file.
# By default, the local network bootstraps from the validator's built-in
# genesis configuration. Use this environment variable to override the
# built-in configuration.

services:
bootstrap-validator:
image: miden-validator
pull_policy: if_not_present
volumes:
- node-data:/data
- type: bind
source: ${MIDEN_GENESIS_CONFIG_FILE:-./compose/genesis/dummy.toml}
target: /genesis.toml
read_only: true
environment:
MIDEN_NODE_VALIDATOR_USE_GENESIS_CONFIG: ${MIDEN_GENESIS_CONFIG_FILE:-}
entrypoint: ["/bin/sh", "-c"]
command:
- |
Expand All @@ -21,11 +31,22 @@ services:
rm -rf /data/genesis /data/validator /data/accounts
mkdir -p /data/genesis /data/validator /data/accounts

GENESIS_CONFIG_ARGS=""
if [ -n "$${MIDEN_NODE_VALIDATOR_USE_GENESIS_CONFIG:-}" ]; then
if [ ! -f /genesis.toml ]; then
echo "Genesis config requested but /genesis.toml is not mounted."
exit 1
fi

GENESIS_CONFIG_ARGS="--genesis-config-file /genesis.toml"
fi

echo "Bootstrapping validator..."
miden-validator bootstrap \
--data-directory /data/validator \
--genesis-block-directory /data/genesis \
--accounts-directory /data/accounts
--accounts-directory /data/accounts \
$$GENESIS_CONFIG_ARGS

touch /data/validator/.bootstrapped

Expand Down
19 changes: 19 additions & 0 deletions docs/external/src/local-network-development.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,25 @@ The network monitor at `http://localhost:3001` provides a compact health view fo
The default stack spins up an internal prover instance which means proving will happen locally. This can be overridden
to use an external prover by setting `MIDEN_REMOTE_PROVER_URL` when starting the stack.

## Genesis Config Override

By default, the local network bootstraps from the validator's built-in genesis configuration. To bootstrap from a custom
genesis configuration file, set `MIDEN_GENESIS_CONFIG_FILE` to the host path of the TOML file:

```bash
MIDEN_GENESIS_CONFIG_FILE=/absolute/path/to/genesis.toml make local-network-up
```

The override bind mounts the host file into the bootstrap validator container as `/genesis.toml` and passes that
in-container path to `miden-validator bootstrap --genesis-config-file`.

This only affects validator bootstrap. If the local network has already been bootstrapped, delete the existing local
chain data before starting with a different genesis configuration:

```bash
make local-network-delete
```

## Check the RPC API

The RPC server exposes gRPC reflection. With `grpcurl` installed, a basic status check looks like:
Expand Down
Loading