photoncloud-monorepo/flaredb/specs/002-raft-features/quickstart.md
centra 8f94aee1fa Fix R8: Convert submodule gitlinks to regular directories
- Remove gitlinks (160000 mode) for chainfire, flaredb, iam
- Add workspace contents as regular tracked files
- Update flake.nix to use simple paths instead of builtins.fetchGit

This resolves the nix build failure where submodule directories
appeared empty in the nix store.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-09 16:51:20 +09:00

39 lines
1.4 KiB
Markdown

# Quickstart: Raft Core Replication
## Prerequisites
- Nix dev shell: `nix develop`
- Ports available: 50051, 50052, 50053 (Raft/gRPC)
- Clean data dirs for each node
## 1) Build & Unit Tests
```bash
nix develop -c cargo build
nix develop -c cargo test -p rdb-server -- service::tests::get_returns_value_and_version
nix develop -c cargo test -p rdb-server -- peer::tests::single_node_propose_persists_log
```
## 2) Start a 3-Node Cluster (manual)
```bash
# Terminal 1
nix develop -c cargo run --bin rdb-server -- --addr 127.0.0.1:50051 --data-dir /tmp/rdb-node1
# Terminal 2
nix develop -c cargo run --bin rdb-server -- --addr 127.0.0.1:50052 --data-dir /tmp/rdb-node2
# Terminal 3
nix develop -c cargo run --bin rdb-server -- --addr 127.0.0.1:50053 --data-dir /tmp/rdb-node3
```
## 3) Propose & Verify (temporary approach)
- Use the forthcoming integration harness (under `rdb-server/tests`) to:
- Elect a leader (campaign)
- Propose a command (e.g., `"hello"`)
- Assert at least two nodes have the entry at the same index/term and commit
- For now, run:
```bash
nix develop -c cargo test -p rdb-server -- --ignored
```
(ignored tests will host the multi-node harness once added)
## 4) Recovery Check
- Stop one follower process, keep leader + other follower running.
- Propose another entry.
- Restart the stopped follower with the same data dir; verify logs show catch-up and committed entries applied (via test harness assertions).