How silverarrow77/raft works
This is a small replicated key-value store: a client sends text commands to a node, which handles reads locally and routes writes through Raft; committed entries update the store and are persisted in a write-ahead log (WAL). Configuration supplies the node and peer addresses. The graph separates request handling, consensus, storage, and configuration, while retaining the message parser as a distinct module. The README is empty, so capabilities and links are limited to the source excerpts; unsampled client and message behavior is not inferred.
Main entry points: Server.cpp TCP server · RaftNode.cpp Raft node · KVStore.cpp Key-value state · main.cpp Program entry
Components 10
Entry and networking
- Program entry
src/main.cpp - TCP server
src/network/Server.cpp - Message parser
src/message/message.cpp
Raft consensus
- Raft node
src/raft/RaftNode.cpp
Key-value storage
- Command parsing
src/storage/KVStore.cpp - Key-value state
src/storage/KVStore.cpp - WAL persistence
src/storage/wal.cpp
Node configuration
- Config reader
src/config/config.cpp
Other components
- Client
- Raft peers
Connections 15
- Client → TCP server: sends commands
src/network/Server.cpp - Program entry → Config reader: reads config
src/main.cpp - Program entry → Raft node: constructs node
src/main.cpp - Program entry → TCP server: starts server
src/main.cpp - TCP server → Raft node: starts node
src/network/Server.cpp - TCP server → Command parsing: parses input
src/network/Server.cpp - TCP server → Raft node: routes RPCs
src/network/Server.cpp - TCP server → Raft node: routes writes
src/network/Server.cpp - TCP server → Key-value state: validates requests
src/network/Server.cpp - Raft node → Raft peers: sends Raft RPCs
src/raft/RaftNode.cpp - Raft peers → TCP server: sends RPCs
src/network/Server.cpp - Raft node → Key-value state: applies commits
src/raft/RaftNode.cpp - Command parsing → Key-value state: updates state
src/storage/KVStore.cpp - Key-value state → WAL persistence: appends records
src/storage/KVStore.cpp - TCP server → WAL persistence: restores log
src/network/Server.cpp