Skip to content
项目

eraft-io/eraft has 289 GitHub stars and 48 forks. GitHot measured 0 stars in 24 hours, 0 in 7 days, and -1 in 15 days. Last checked 2026-11-23 13:22 UTC. Last push 2026-10-25.

这些数字如何统计

可以做什么

  • Header-only public API — include/raft/*.h exposes all types and interfaces
  • In-memory peer transport — InMemPeer / InMemRaftPeer for fast single-process testing
  • gRPC support — grpc_server.cpp / grpc_client.cpp for real network deployment
  • BlockingQueue — lock-based notify channel for coordinating Raft applier with service-layer Execute()

实测星标增长

24小时
0
7天
0
15天
-1
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

关于

A generic raft library

数据

README.md

原文

License

eRaft: A Distributed Sharded KV Storage System

A C++17 library implementing the Raft consensus algorithm and a sharded key-value store on top of it.

Modules

Module Source Description
raft raft_cpp/src/raft.cpp Core Raft consensus: leader election, log replication, snapshotting, persistence
kvraft raft_cpp/src/kvraft_server.cpp Fault-tolerant KV store on Raft, with client deduplication and linearizable semantics
shardctrler raft_cpp/src/shardctrler.cpp Configuration cluster managing dynamic shard-to-group assignment
shardkv raft_cpp/src/shardkv.cpp Sharded KV store with cross-group data migration, garbage collection, and concurrent reconfiguration

Architecture

Key Features

  • Header-only public API — include/raft/*.h exposes all types and interfaces
  • In-memory peer transport — InMemPeer / InMemRaftPeer for fast single-process testing
  • gRPC support — grpc_server.cpp / grpc_client.cpp for real network deployment
  • BlockingQueue — lock-based notify channel for coordinating Raft applier with service-layer Execute()
  • Snapshot + persistence — Persister with readPersist() / persist() for crash recovery

Build & Test

cd raft_cpp
mkdir -p build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j$(sysctl -n hw.logicalcpu)

# Run all tests
./raft_test           # Raft: 12 tests
./kvraft_test         # KV Raft: 4 tests
./shardctrler_test    # ShardCtrler: 4 tests
./shardkv_test        # ShardKV: 6 tests

Dependencies

  • C++17 compiler (Clang / GCC)
  • CMake ≥ 3.16
  • gRPC + Protobuf
  • Google Test
  • RocksDB

macOS:

brew install cmake grpc protobuf googletest rocksdb

探索相关项目

加载中…