Files
BlockchainEngineer 6af3f606a2 fix(devnet): correct p2p ports, env typo, and missing validator volumes
- Fix docker-compose.yml p2p port mappings (30304:30303, 30305:30303)
- Fix typo BESUS_GENESIS_FILE -> BESU_GENESIS_FILE
- Add missing volumes/environment to validator2 and validator3 services
- Remove outdated package-lock.json to let CI regenerate cleanly
- Validate genesis determinism and extraData alignment

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-07 05:03:07 +00:00

2.8 KiB

JCC Local Devnet

3-node Hyperledger Besu devnet with IBFT 2.0 consensus.

Prerequisites

  • Docker Engine ≥ 24.0
  • Docker Compose ≥ 2.20
  • jq (for scripts)
  • Node.js ≥ 18 (for key-generation scripts)

Start / Stop / Reset

# From repo root
./scripts/devnet-up.sh      # brings up 3 validators, waits for block ≥1
./scripts/devnet-down.sh    # stops containers
./scripts/devnet-reset.sh   # stops containers and wipes chain data + volumes

Validator Endpoints

Validator JSON-RPC (HTTP) WS Metrics
validator-1 http://localhost:8545 ws://localhost:8546 http://localhost:9545
validator-2 http://localhost:8547 ws://localhost:8548 http://localhost:9546
validator-3 http://localhost:8549 ws://localhost:8550 http://localhost:9547

Genesis & Keys

  • besu-config/genesis.json — reproducible genesis block (chainId 1337, blockPeriodSeconds 2).
  • besu-config/static-nodes.json — fixed enodes so validators discover each other immediately.
  • validator-keys/ — devnet-only private node keys, addresses, and public keys.

All of the above are generated deterministically from the seed jcc-devnet-v1 by running:

cd scripts
npm install
node generate-static-keys-run.js ../devnet

Block Production Verification

After devnet-up.sh, run:

curl -s -X POST http://localhost:8545 \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' | jq

You should see a hex block number ≥ 0x1 within ~30 seconds of startup.

CI / Image Build

The .github/workflows/ci.yml builds and tags the jcc/besu image without pushing:

docker build -f devnet/Dockerfile.besu -t jcc/besu:latest .

Troubleshooting

  • Port conflicts: edit port mappings in docker-compose.yml (root) and devnet/docker-compose.yml.
  • Permission denied: ensure scripts/*.sh are executable (chmod +x scripts/*.sh).
  • Peers not connecting: check docker network inspect jcc-devnet and validator logs; verify static-nodes.json enodes match container hostnames (validator1, validator2, validator3).

Files

  • docker-compose.yml (repo root) — canonical devnet + monitoring compose file
  • devnet/docker-compose.yml — standalone devnet compose (also includes Prometheus/Grafana)
  • besu-config/genesis.json — genesis block
  • validator-keys/ — node keys (key, key.pub, address)
  • scripts/ — operational helpers and key generation

Notes

  • Validator keys are intentionally static for reproducibility on devnet.
  • Prometheus targets are auto-configured in monitoring/prometheus/prometheus.yml.
  • Grafana dashboard JSON is in monitoring/grafana/dashboards/besu-overview.json.

For CI image build instructions, see .github/workflows/README.md.