https://github.com/daimaou92/ruft
raft impl
https://github.com/daimaou92/ruft
learning-by-doing raft raft-consensus raft-consensus-algorithm raft-protocol rust rust-lang
Last synced: 3 months ago
JSON representation
raft impl
- Host: GitHub
- URL: https://github.com/daimaou92/ruft
- Owner: daimaou92
- License: mit
- Created: 2022-04-23T08:34:41.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-05-01T22:09:45.000Z (about 3 years ago)
- Last Synced: 2024-12-29T05:34:01.324Z (5 months ago)
- Topics: learning-by-doing, raft, raft-consensus, raft-consensus-algorithm, raft-protocol, rust, rust-lang
- Language: Rust
- Homepage:
- Size: 22.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# What?
Learning rust - by implementing the [raft protocol](https://raft.github.io/raft.pdf).
Goes without saying but - please don't use this anywhere.
# Run
```Shell
cargo build
./target/debug/ruft
```This will start a server with the following default cluster configuration:
1. `127.0.0.1:20000`
2. `127.0.0.1:20001`
3. `127.0.0.1:20002`This server itself will start on port `:20000`
Open up two new shells and run:
`./target/debug/ruft -p 20001` in one and
`./target/debug/ruft -p 20002` in the other
Watch the logs go and use `Ctrl+C` liberally.
## What works?
The leadership and election bit. There's a leader lease in case only one member is active.
## What doesn't work?
Anything else
# Dependencies:
1. [tokio](https://github.com/tokio-rs/tokio)
2. [tarpc](https://github.com/google/tarpc)
3. [clap](https://github.com/clap-rs/clap)
4. [serde](https://github.com/serde-rs/serde)
5. [anyhow](https://github.com/dtolnay/anyhow)