This software is implementation of the chain replication in distributed system. For the demonstration purposes all nodes can be created locally
This software is Python program and requires Python interpreter to run the code. I'm assuming after cloning the repo to your local computer, you already created a virtual environment and activated it. The next step is installing GRPC libraries for Python since all the communication between nodes and processes are powered by GRPC
pip install -r requirements.txtTo control the whole flow we have master which has a static port, 8000. Please, make sure that, port 8000 is empty or the error will be thrown.
python main.py masterAfter the master is ready for receiving messages we can initialize the nodes. Each node has its own name. Nodes are resembling distributed systems.
Example: python main.py node node_1
python main.py node {node_name}We continue all the communication trough either of the nodes. Nodes provide a prompt for entering commands.
As a software architecture, separate classes are implemented for handling three types of purpose: master, nodes, processes.
List of tasks:
Local-store-ps {number_of_processes} ✅
Create-chain ✅
List-chain ✅
Write-operation <“Book”, Price>: ✅ (P.s write operation expects the exact same formatting)
List-books: ✅
Read-operation: ✅
Time-out: ✅ (P.s even though the command is still Time-out, 'delay' is more suitable name)
Remove-head: ✅
Restore-head: ✅