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
Next Next commit
docs(install): start the forging devnet from an empty database
The devnet Postgres data is a named volume that survives docker compose
down (PERSISTENT=0 still mounts it), and a node that already holds block 0
reads shardSize from that block, so the lowered shardSize copy has no
effect. Say to run down -v with the same options first, as
test-tx-status-e2e.sh does, and cite the sources.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
  • Loading branch information
randomblocker and claude committed Nov 8, 2026
commit bf9dd21c8f823db7016b3176ffad69671cc97135
4 changes: 2 additions & 2 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ Genesis rejects a `shardSize` below 3, so the smallest committee that can forge

That edited genesis only applies when `testing/devnet/docker-compose.fixture.yml` is used 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/`. With no snapshot the node takes the balances path, and `ensureValidatorSeed` seeds the genesis validators at boot, while the chain is still at block 0. A snapshot whose `validators.jsonl` has rows owns the validator set, so the genesis list applies only when the snapshot has no validator rows. Without the overlay, the image's baked genesis and the 35-validator snapshot are used, and the snapshot validators win. The devnet compose file runs the nodes with `NODE_ENV=development`, so the pin requirement above does not apply there.

`NODE_COUNT` cannot reach the floor of 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`, 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. `testing/devnet/scripts/test-tx-status-e2e.sh` does this with `jq '.properties.shardSize = (.validators | length)'`. Four validators with a `shardSize` of 4 have a floor of 3. For `NODE_COUNT=5`, add `--profile rehearsal` and mount the copy on `node-5` too.
`NODE_COUNT` cannot reach the floor of 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`, 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. `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` (`.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. Run `docker compose` with the same `--profile` and `-f` options and `down -v` first, as that script does. Four validators with a `shardSize` of 4 have a floor of 3. For `NODE_COUNT=5`, add `--profile rehearsal` and mount the copy on `node-5` too.
Comment thread
randomblocker marked this conversation as resolved.
Resolved

Sources for the paragraphs above:

Expand All @@ -276,7 +276,7 @@ Sources for the paragraphs above:
- `src/libs/consensus/v2/quorum.ts:10-12` and `src/libs/consensus/v2/routines/getShard.ts:32-34` (committee floor)
- `src/libs/consensus/v2/types/secretaryManager.ts:267-281` (the two `NotInShardError` cases)
- `testing/devnet/scripts/generate-genesis.sh:1-10,27`, `testing/devnet/scripts/setup.sh:24`, `testing/devnet/genesis.devnet.json` (`properties.shardSize`), `testing/devnet/docker-compose.fixture.yml:9-13,27-28`, `testing/devnet/docker-compose.yml:62` (`NODE_ENV=development`), `testing/devnet/quorum-drills/README.md:131` (the `floor` drill)
- `testing/devnet/scripts/generate-genesis.sh:30-39,45-54` (node index 6 is rejected), `testing/devnet/docker-compose.yml:221-222` (`node-5`, `rehearsal` profile; no `node-6`), `testing/devnet/scripts/test-tx-status-e2e.sh:44,75-89` (the `rehearsal` profile, the `shardSize` copy and the override file)
- `testing/devnet/scripts/generate-genesis.sh:30-39,45-54` (node index 6 is rejected), `testing/devnet/docker-compose.yml:221-222` (`node-5`, `rehearsal` profile; no `node-6`), `testing/devnet/scripts/test-tx-status-e2e.sh:44,75-89,95-97` (the `rehearsal` profile, the `shardSize` copy and the override file, `down -v` before `up`), `testing/devnet/.env.example:35` and `testing/devnet/docker-compose.yml:13` (`PERSISTENT=0` still mounts the `postgres-data` volume), `src/libs/consensus/genesisShardSize.ts:63-85` and `src/libs/blockchain/routines/findGenesisBlock.ts:167-202` (a node with block 0 reads `shardSize` from the stored block)

To participate in the actual Demos testnet/mainnet, you must do **three things** before the node's first start:

Expand Down
Loading