Web UI for the CometBFT Analyzer. It visualizes CometBFT consensus activity, latencies, and network behavior using data served by the backend API.
Part of the CometBFT Analyzer suite:
- cometbft-log-etl: Parses CometBFT logs and writes per-simulation DBs
- cometbft-analyzer-backend: HTTP API + orchestration layer consumed by this UI
- cometbft-analyzer-frontend: This project (Next.js web UI)
- cometbft-analyzer-types: Shared Go types/statistics used by ETL/backend
Note: This project is under active development. APIs and schemas may evolve.
- Requirements:
- Node.js 18.18+ (or 20+ recommended) and npm
- Running backend API (default at
http://localhost:8080/v1
)
- Copy env template and configure the API base URL:
cp .env.example .env.local
Edit .env.local
as needed:
NEXT_PUBLIC_API_BASE_URL=http://localhost:8080/v1
NEXT_PUBLIC_DEFAULT_USER_ID=your-user-id-here
- Install dependencies and start the dev server:
npm install
npm run dev
Open http://localhost:3000 to view the UI.
NEXT_PUBLIC_API_BASE_URL
: Base URL of the backend API (e.g.,http://localhost:8080/v1
).NEXT_PUBLIC_DEFAULT_USER_ID
: Optional default user context for demo/testing..env.local
: Local overrides for your environment (gitignored).
Variables prefixed with NEXT_PUBLIC_
are exposed to the browser—avoid placing secrets there.
-
Scripts:
npm run dev
: Run Next.js in development mode.npm run build
: Build production assets.npm run start
: Start the production build locally.npm run lint
: Lint the project.
-
Code layout:
src/
application code and UI componentspublic/
static assets
Ensure the backend is reachable at NEXT_PUBLIC_API_BASE_URL
; most features require it.
This frontend consumes the cometbft-analyzer-backend API. For convenience, here is the backend’s overview and quickstart reference:
Backend service for the CometBFT Analyzer. It manages users, projects, and simulations, accepts CometBFT log uploads, invokes the ETL pipeline to normalize logs into MongoDB, and serves metrics and events to the frontend.
Part of the CometBFT Analyzer suite:
- cometbft-log-etl: Parses CometBFT logs and writes per-simulation DBs
- cometbft-analyzer-backend: This service (HTTP API + orchestration)
- cometbft-analyzer-frontend: Web UI that consumes this API
- cometbft-analyzer-types: Shared Go types and statistics used by ETL/backend
Note: This project is under active development. APIs and schemas may evolve.
- Requirements:
- Go 1.21+
- MongoDB (local or remote)
- cometbft-log-etl binary on PATH as
cometbft-log-parser
-
Run MongoDB (defaults to
mongodb://localhost:27017
). -
Build/install ETL:
git clone https://github.com/bft-labs/cometbft-log-etl
cd cometbft-log-etl
go build -o cometbft-log-parser .
mv cometbft-log-parser /usr/local/bin/
- Start backend:
go run .
# or
PORT=8080 MONGODB_URI=mongodb://localhost:27017 go run .
The backend listens on :8080
and exposes routes under /v1
.
- Base URL:
/v1
- Content types:
application/json
ormultipart/form-data
for uploads - Time window params:
from
/to
as RFC3339; default last 1 minute
Key routes (subset):
- Users:
POST /users
,GET /users
,GET /users/:userId
,DELETE /users/:userId
- Projects:
POST /users/:userId/projects
,GET /users/:userId/projects
,GET/PUT/DELETE /projects/:projectId
- Simulations: create/list/get/update/delete, upload logs, trigger processing
- Metrics/Events (per simulation): events listing and latency/network metrics endpoints
For the full backend documentation and additional endpoints, see the backend repository.
- Start the backend and ensure
NEXT_PUBLIC_API_BASE_URL
points to it. - In the UI, create a user and project, then a simulation.
- Upload logs via the UI or directly to the backend.
- Trigger processing and explore metrics, timelines, and charts in the frontend.
- Keep PRs scoped and align UI data contracts with the backend’s documented APIs.
- When backend metrics or schemas evolve, update the UI queries and this README as needed.
- Performance, usability, and observability improvements are welcome.
Licensed under the Apache License, Version 2.0. See the LICENSE
file for details.