-
Notifications
You must be signed in to change notification settings - Fork 0
Implement Celestia node JSON-RPC compatibility layer #2
Copy link
Copy link
Closed
Description
Summary
Implement the JSON-RPC server and API modules that replicate the celestia-node RPC interface ev-node expects. This is the core API surface that makes apex a drop-in replacement for celestia-node.
Context
ev-node communicates with celestia-node over JSON-RPC (go-jsonrpc). Apex must expose the same interface so ev-node requires zero modifications. This covers Phase 2 of the implementation plan plus the stub modules from Phase 3.
Requirements
Blob module (pkg/api/blob.go)
Get(height, namespace, commitment)— query SQLite by height+ns+commitmentGetAll(height, namespaces[])— query SQLite, filter to tracked namespacesSubscribe(namespace)— real-time streaming via subscription managerGetProof(height, namespace, commitment)— retrieve stored NMT proofsIncluded(height, namespace, proof, commitment)— verify against stored dataGetCommitmentProof(...)— return "not supported" error (requires full EDS)Submit(...)— return "not supported" error (read-only service)
Header module (pkg/api/header.go)
GetByHeight(height)— local store with upstream fallbackSubscribe()— stream new headersLocalHead()— last synced heightNetworkHead()— query upstream
Stub modules
share— return "not supported" errorsfraud— return "not supported" errorsblobstream— return "not supported" errors
Server (pkg/api/server.go)
- JSON-RPC server using
go-jsonrpc(matching celestia-node's pattern) - Configurable listen address (
[rpc] address) - Register all modules above
Verification
- Point ev-node at apex instead of celestia-node — should work without changes
- Test subscription streaming under load
- Verify error responses match celestia-node format for unsupported methods
References
- celestia-node
api/rpc/server.go— server pattern - celestia-node
nodebuilder/blob/blob.go— module interface - celestia-node
api/client/read_client.go— required modules - Design doc:
test_plan.md— API Compatibility section
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels