Skip to content
Open
Changes from 1 commit
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
Prev Previous commit
docs(install): set NODE_COUNT for the devnet setup on the command line
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
  • Loading branch information
randomblocker and claude committed Nov 12, 2026
commit da35ce1e271ef5fc36218d853bde867bd373adb9
2 changes: 1 addition & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ A node forges only while at least the quorum of the genesis `shardSize` (2/3 + 1

A fresh node does **not** run as an isolated single-validator chain, and the code has no solo or single-validator mode. With the shipped production defaults (`NODE_ENV=production`, no pin set) it refuses to start before it builds block 0; step 3 below covers the pins and `DEMOS_ALLOW_UNPINNED_GENESIS`. Once it does start from the bundled files, it stays at block 0: the 35 validators of the bundled snapshot take precedence over the 4 listed in the bundled `genesis.json` (`shardSize` 10), a freshly generated identity is in neither list, and a node forges only in a committee that includes its own identity (otherwise it logs `We are not in the shard`).

For a local chain that forges, use the repository's devnet ([testing/devnet/README.md](testing/devnet/README.md)). Its `scripts/setup.sh` runs `generate-genesis.sh`, which rewrites the validator list in `testing/devnet/genesis.devnet.json` to the newly generated node identities (4 by default, set by `NODE_COUNT`). That genesis applies only with `testing/devnet/docker-compose.fixture.yml` as an overlay: it mounts `genesis.devnet.json` over `/app/data/genesis.json` and `./empty-snapshot`, a directory with no `manifest.json`, over `/app/data/snapshot/`, so with no snapshot the genesis validators are seeded at block 0. The devnet nodes run with `NODE_ENV=development` and the devnet genesis has a test network's chain id (1337), so the pin requirement of step 3 does not apply there.
For a local chain that forges, use the repository's devnet ([testing/devnet/README.md](testing/devnet/README.md)). Its `scripts/setup.sh` runs `generate-genesis.sh`, which rewrites the validator list in `testing/devnet/genesis.devnet.json` to the newly generated node identities (4 by default; to change it, set `NODE_COUNT` on the command line, for example `NODE_COUNT=5 ./scripts/setup.sh` from `testing/devnet`, because `generate-identities.sh` reads it from the environment only; keep any `NODE_COUNT` in `testing/devnet/.env` at the same value, since `generate-genesis.sh` reads that file too). That genesis applies only with `testing/devnet/docker-compose.fixture.yml` as an overlay: it mounts `genesis.devnet.json` over `/app/data/genesis.json` and `./empty-snapshot`, a directory with no `manifest.json`, over `/app/data/snapshot/`, so with no snapshot the genesis validators are seeded at block 0. The devnet nodes run with `NODE_ENV=development` and the devnet genesis has a test network's chain id (1337), so the pin requirement of step 3 does not apply there.

The devnet genesis has a `shardSize` of 10 (quorum 7), so the default 4 validators never get past block 0, and `NODE_COUNT` cannot reach 7: `generate-genesis.sh` rejects node 6, and Compose defines at most five nodes (`node-5` is in the `rehearsal` profile). To get a devnet that forges, run `setup.sh` (it regenerates identities on every run and overwrites `testing/devnet/identities/node<N>.identity` and `node<N>.pubkey` for each node, so copy any you still need first), then lower `properties.shardSize` to the validator count in a copy of `genesis.devnet.json` and mount the copy over `/app/data/genesis.json` with one more compose file, listed after the fixture file; four validators at `shardSize` 4 have a quorum of 3. `testing/devnet/scripts/test-tx-status-e2e.sh` does this with `jq '.properties.shardSize = (.validators | length)'`. Start on an empty database: the Postgres data is a named volume that survives `docker compose down` (`testing/devnet/.env.example` sets `PERSISTENT=0`, and any non-empty value mounts it), and a node that already holds block 0 reads `shardSize` from that block, so the copy has no effect. `down -v` deletes the shared devnet Postgres volume, so every devnet node loses its chain data; back up any database you need first. Run `docker compose` with the same `--profile` and `-f` options and `down -v` first, as that script does. For `NODE_COUNT=5`, add `--profile rehearsal` and mount the copy on `node-5` too.
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved

Expand Down
Loading