Setup a python3 virtual environment:
python3 -m virtualenv env
source env/bin/activate
Install requirements
pip3 install -r requirements.txt
Edit the config.json file to match your cluster's IP addresses
Navigate to the proto directory and run both the proto files to generate python files for serializing messages and grpc communication
raft.proto
python3 -m grpc.tools.protoc -I. --python_out=. --grpc_python_out=. raft.proto
file_transfer.proto
python3 -m grpc.tools.protoc -I. --python_out=. --grpc_python_out=. file_transfer.proto
raft.py
cd raft
python3 raft.py
dc.py
cd dc
python3 dc.py
cd client
python3 client_upload.py
After running the above, a python daemon watches a directory called "uploads" in the client folder. Place the file that needs to be uploaded in that uploads directory.
cd client
python3 client_download.py
After running the above file, it will display a list of files available for download and gives the user an option, if he/she wants to download a file