feat: Add SSZ support, monorepo with React UI, and v0 API endpoints#4
Merged
Conversation
Update lean_api.zig to parse SSZ-encoded state data from /lean/states/finalized endpoint. The slot is extracted from the first 8 bytes (little-endian u64) of the SSZ-encoded BeaconState structure. Since /lean/states/justified returns 404, use finalized slot for both justified and finalized until correct endpoint is found.
Changes: - Add ssz.zig library dependency from blockblaz/ssz.zig - Update lean_api.zig to parse SSZ-encoded BeamState from /lean/states/finalized - Extract slot directly from bytes 8-15 (second field in BeamState after genesis_time) - Remove fallback to JSON parsing (endpoint returns pure SSZ binary) - Add upstreams-zeam-only.json for testing with zeam client only Note: Currently only zeam client implements /lean/states/finalized endpoint correctly. Other clients (ream, qlean, lantern, etc.) return metrics or error messages instead.
Replace BeamState with LeanState and BeamBlockHeader with LeanBlockHeader to align with Lean Ethereum naming conventions.
Changes: - Update /health to /v0/health - Update /lean/states/finalized to /lean/v0/states/finalized - Update /lean/states/justified to /lean/v0/states/justified These endpoints will work once remote lean node images are updated.
Adds a complete web interface inspired by checkpointz for monitoring leanpoint checkpoint sync status and upstream lean nodes. Backend changes: - Add /api/upstreams endpoint to expose detailed upstream status - Add static file serving for web-dist/ frontend assets - Add UpstreamsData structures for API serialization - Add mutex to UpstreamManager for thread-safe access - Update AppState to reference UpstreamManager Frontend additions: - React + TypeScript + Vite setup in web/ directory - StatusCard component for overall checkpoint status - UpstreamsTable component for per-upstream monitoring - CSS theming matching checkpointz aesthetic - API client for backend communication Build system: - Add Makefile with unified build targets - Support for development workflow (make dev) - Clean separation of backend/frontend builds Documentation: - Add MONOREPO_GUIDE.md with comprehensive usage guide - Add web/README.md for frontend development - Update .gitignore for frontend artifacts
Updates Dockerfile to build and ship the React web UI alongside the Zig backend. The Docker image now includes a complete monorepo deployment. Changes: - Add Node.js to build stage for frontend compilation - Build web UI during Docker image creation - Copy web-dist/ to /usr/share/leanpoint/web/ in runtime image - Update default CMD to serve web UI automatically - Update MONOREPO_GUIDE.md with corrected Docker instructions The Docker image now provides a complete web interface out of the box. Access the UI at http://localhost:5555 when running the container.
Merges all monorepo documentation into the main README for a single source of truth. The README now covers both backend and frontend with updated quick start, development workflow, and deployment instructions.
Runs zig fmt on all source files to fix formatting issues. Adds .eslintrc.cjs for frontend linting with TypeScript and React rules.
Removes upstreams-*.json files from git tracking, keeping only upstreams.example.json as a template. User-specific configs should be generated locally and are now properly ignored. Updates .gitignore to exclude all upstreams-*.json except the example.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR transforms leanpoint into a production-ready checkpoint sync provider with:
/lean/v0/*and/v0/healthendpointsKey Features
Backend Enhancements:
/lean/v0/states/finalizedand/lean/v0/checkpoints/justifiedendpoints/api/upstreamsendpoint exposing detailed upstream health and consensus dataFrontend (New):
Build System:
make dev)Refactoring:
Beam*types toLean*for consistencyCI/CD:
Test Plan
zig buildmake build-web/api/upstreamsendpoint returns correct dataBreaking Changes
/healthto/v0/health/lean/states/finalizedto/lean/v0/states/finalizedRelated Issues
Implements checkpoint sync monitoring for Lean Ethereum ecosystem.