Skip to content

feat(api): add gRPC API layer with proto definitions and KV service#100

Merged
slow2342 merged 1 commit into
mainfrom
feat/proto-definitions
Jun 9, 2026
Merged

feat(api): add gRPC API layer with proto definitions and KV service#100
slow2342 merged 1 commit into
mainfrom
feat/proto-definitions

Conversation

@slow2342

@slow2342 slow2342 commented Jun 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • Define protobuf types for KV operations in proto/common.proto and proto/kv.proto
  • Wire up tonic-prost-build for proto code generation
  • Implement AetherKv gRPC service (Put/Get/Delete/Range) backed by RocksDB
  • Add range_scan method to StorageEngine trait for range queries
  • Start gRPC server in main.rs
  • Txn returns unimplemented for now

Changes

  • proto/common.proto — Shared types: ResponseHeader, KeyValue, SortOrder, SortTarget, WatchEvent, LeaseInfo
  • proto/kv.proto — AetherKV service with 5 RPCs and transaction types
  • build.rs — Proto compilation via tonic-prost-build
  • src/proto/mod.rs — Includes generated proto code
  • src/api/mod.rs — API module entry
  • src/api/kv.rs — KvService implementing AetherKv trait
  • src/storage/mod.rs — Added range_scan to StorageEngine trait
  • src/storage/rocksdb.rs — Implemented range_scan using RocksDB iterator
  • src/lib.rs — Added api and proto modules
  • src/main.rs — gRPC server startup with tonic
  • Cargo.toml — Added tonic-prost, tonic-prost-build dependencies

Testing

  • cargo build passes
  • cargo test passes (10 tests)
  • cargo clippy -- -D warnings passes
  • cargo fmt -- --check passes

How to verify

cargo build
cargo test
cargo clippy -- -D warnings
cargo fmt -- --check

Related issues

Refs #76

Define protobuf types for KV operations in proto/common.proto and
proto/kv.proto, wire up tonic-prost-build for code generation, and
implement the AetherKv gRPC service (Put/Get/Delete/Range) backed
by the RocksDB storage engine. Txn returns unimplemented for now.
@slow2342
slow2342 merged commit a1529ff into main Jun 9, 2026
5 of 9 checks passed
@slow2342
slow2342 deleted the feat/proto-definitions branch June 9, 2026 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant