Replies: 4 comments 2 replies
-
|
@gballet @g11tech created this thread to discuss how we are going to go about this issue #146 |
Beta Was this translation helpful? Give feedback.
-
|
For package organization structure, I have some ideas, not for API packages, but for the entire zeam project. The current project's package, module organization looks more like a mix of Go and Rust styles without following Zig's way. For large Zig projects, from looking at the Zig standard library and the source code of Tigerbeetle and Bun, it was found that Zig prefers flat project organization forms, rarely nesting multi-layer directories, and at the same time, they cannot see files of such |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
|
Dropping the Lean API documenet for reference https://hackmd.io/@reamlabs/SJksQfkoeg |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
TL;DR
We need to implement 3 lean API endpoints for the visualization tool. The plan is to have:
pkgs/api/with swappable storage interfaceDecision Needed: Finalize technical details
Overview
Implementation plan for lean API endpoints to support the new visualization tool:
GET /lean/v0/blocks/{block_id}GET /lean/v0/headers/{block_id}GET /lean/v0/node/versionTeam ( Guillaume ) Requirements
Current Architecture Analysis
What We Have
metrics_server.zigusingstd.http.ServerProtoArraystores block headers and fork choice dataBeamChainmanages fork choice and state transitionsCurrent Gaps ( I can Confirm to this)
SignedBeamBlockdiscarded after processingLevelDBis empty placeholderhead,finalized,genesis)Proposed Architecture: Swappable Storage Design
1. Package Structure with Storage Abstraction
2. Storage Interface Design Team Requirement
Storage Trait Pattern
RAM Store Implementation (Phase 1)
Future Store Placeholders (Easy Swapping)
3. Block ID Resolution
4. Integration Points
Concrete Implementation Plan
Phase 1: Storage Foundation
Phase 2: HTTP Server & Routing
Phase 3: Endpoint Implementation
Phase 4: Node Integration
Team Decisions Made
** Storage Strategy**: Swappable Interface + RAM Store
** Architecture Pattern**: New Subsystem
Remaining Decisions Needed
** Technical Decisions**
chain.onBlock()or separate?Example API Responses
Block Header Response
{ "data": { "slot": "123", "proposer_index": "1", "parent_root": "0x...", "state_root": "0x...", "body_root": "0x..." } }Node Version Response
{ "data": { "version": "zeam/v0.1.0", "implementation": "zeam", "version_number": "0.1.0" } }Next Steps
Action Items
Success Metrics
This plan addresses Guillaume requirement for swappable storage while providing a concrete roadmap for the new subsystem implementation.
Beta Was this translation helpful? Give feedback.
All reactions