This project implements a modified version of the Raft consensus algorithm with Leader Lease using gRPC in Python.
- Python 3.6 or higher
Clone the repository
git clone https://github.com/sahilgoswami0901/Raft-Consensus-Algorithm.gitchmod +x setup.sh./setup.shchmod +x clean_logs.shTo clean up any previous logs
./clean_logs.shTo start a Raft node:
python3 RaftNode.pyRun the above command in 5 different terminals, and enter the following server id in each terminal:
- 50051
- 50052
- 50053
- 50054
- 50055
To start a Raft client:
python3 RaftClient.pyThe client can send the following commands to the Raft cluster:
SET key valueto set a key-value pairGET keyto get the value of a key