BlockEmulator-X Web Console is a local web console for running experiments with
block-emulator-x. It provides a browser-based configuration panel, experiment
start/stop controls, runtime status, logs, CSV result previews, and lightweight
charts.
The project is intentionally simple: the web app does not modify the
BlockEmulator-X source code, and generated experiment files are written under
this project's backend/workdir/ directory.
- Edit common BlockEmulator-X experiment parameters in a web form.
- Generate a dedicated runtime
config.yamlandip_table.json. - Start and stop BlockEmulator-X consensus nodes and supervisor processes.
- View runtime status, process count, backend logs, and result file count.
- Read BlockEmulator-X CSV results and display them as tables.
- Show quick frontend SVG charts for TPS, CTX ratio, and TCL.
- Download the generated brief CSV result file.
- Optionally run a Python/Flask chart server for matplotlib PNG charts.
BlockEmulator-web/
├── backend/ # Go HTTP API server
│ ├── internal/emulator/ # BlockEmulator-X config, process, and result logic
│ └── workdir/ # Generated runtime files and experiment outputs
├── frontend/ # React + Vite single-page app
├── python-backend/ # Optional Flask + matplotlib chart server
├── docs/ # Notes and guide drafts
├── start.sh # macOS/Linux startup helper
└── start.bat # Windows startup helper
- Go 1.22 or newer
- Node.js and npm
- Python 3.10 or newer, only if using
python-backend - A local BlockEmulator-X checkout next to this project by default:
BlockEmulator/
├── BlockEmulator-web/
└── block-emulator-x/
If BlockEmulator-X is somewhere else, set BLOCK_EMULATOR_X_ROOT.
From the project root:
./start.shThis starts:
- Go backend:
http://localhost:8080 - React frontend:
http://localhost:5173 - Python chart server:
http://localhost:5001
Start only one service:
./start.sh backend
./start.sh frontend
./start.sh chartsOn Windows:
start.bat
start.bat backend
start.bat frontend
start.bat chartscd backend
go run .The backend automatically searches for ../block-emulator-x or
../../block-emulator-x, depending on where it is started from.
Use a custom BlockEmulator-X path:
BLOCK_EMULATOR_X_ROOT=/absolute/path/to/block-emulator-x go run .Use a custom backend address:
BLOCK_EMULATOR_WEB_ADDR=:8090 go run .cd frontend
npm install
npm run devOpen:
http://localhost:5173
cd python-backend
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python app.pyOpen:
http://localhost:5001
The Python chart server reads CSV files from backend/workdir/exp/results/ by
default. Override that location with:
BLOCKEMULATOR_WORKDIR=/absolute/path/to/backend/workdir python app.pyThis project avoids overwriting the original BlockEmulator-X configuration.
The Go backend reads the original config as a template:
../block-emulator-x/config.yaml
It writes generated runtime files here:
backend/workdir/generated_config.yaml
backend/workdir/generated_ip_table.json
backend/workdir/last_config.json
backend/workdir/status.json
backend/workdir/experiment.log
backend/workdir/exp/
When launching BlockEmulator-X, the backend passes these generated files with:
-config backend/workdir/generated_config.yaml
-ip_table backend/workdir/generated_ip_table.jsonExperiment results are read from:
backend/workdir/exp/results/
The web form currently covers these fields:
system.shard_numsystem.node_numsystem.limitsystem.consensus_type
Supported consensus types:
static_relaystatic_brokerclpa_relayclpa_broker
consensus_node.block_interval
supervisor.tx_numbersupervisor.tx_injection_speedsupervisor.epoch_durationsupervisor.tx_source.tx_source_typesupervisor.tx_source.tx_source_filesupervisor.tx_source.exclude_contract_txs
exclude_contract_txs controls whether CSV transaction sources should filter
smart-contract-related transactions.
network.bandwidthnetwork.latency
The backend forces network.communication_mode to direct for the first local
version of the console.
All backend responses use:
{
"ok": true,
"data": {},
"error": ""
}Implemented endpoints:
GET /api/configPOST /api/config/validatePOST /api/configPOST /api/ip-tablePOST /api/experiments/startPOST /api/experiments/stopGET /api/experiments/statusGET /api/experiments/logsGET /api/resultsGET /api/results/download/{file}.csv
The optional chart server exposes:
GET /api/healthGET /api/charts/tps?type=line|barGET /api/charts/ctx_ratio?type=line|barGET /api/charts/tcl?type=line|barGET /api/charts/combinedGET /
The React frontend currently uses its own lightweight SVG charts. The Python chart server is available as a standalone preview and for richer PNG charts.
- Start the Go backend and React frontend.
- Open
http://localhost:5173. - Adjust experiment parameters in the left panel.
- Click
Save Configto write generated config and IP table files. - Click
Startto launch BlockEmulator-X processes. - Watch status cards and runtime logs.
- After the experiment finishes, inspect charts and result tables.
- Download the brief CSV if needed.
Backend:
cd backend
go test ./...Frontend:
cd frontend
npm run buildPython chart server:
cd python-backend
python app.pySet:
BLOCK_EMULATOR_X_ROOT=/absolute/path/to/block-emulator-xMake sure the Go backend is running on http://localhost:8080. If using a
different API base URL, start Vite with:
VITE_API_BASE=http://localhost:8090 npm run devDefault ports:
- Go backend:
8080 - React frontend:
5173 - Python charts:
5001
Stop the conflicting process or use the environment variables above where supported.
Run an experiment first, then check:
backend/workdir/exp/results/
The result reader expects a brief CSV such as:
relay_stats_brief_info.csvbroker_stats_brief_info.csv
If npm install fails with a local issuer certificate error in a local lab
environment, retry once with:
npm install --strict-ssl=falseUse this only when you understand the network environment.