This project develops a distributed banking system utilizing gRPC for communication between customer and branch processes. The system manages money transactions such as deposits and withdrawals across multiple bank branches, ensuring consistency across replicas of account balances. Each customer interacts with a specific branch, identified by a unique ID, to perform transactions on a shared bank account, without concurrent updates. This setup uses Python and gRPC technology to facilitate RPC communication for transaction requests and propagation of updates across branch replicas.
Installation Steps:
- Install Python 3.11.X
$ sudo add-apt-repository ppa:deadsnakes/ppa$ sudo apt update$ sudo apt install python3.11To verify the installation
$ python3.11 --version
> Python 3.11.5- Install Python Package manager
$ sudo apt install python3-pip- Install Python virtual environment and activate it
$ sudo apt install python3-virtualenv
$ virtualenv venv
$ source venv/bin/activate
> (venv) user@user: ~path
$ python -m pip install --upgrade pip-
Install requirements
- Inside your virtual environment run the following commands
> pip3 install -r requirements.txt -
Run server using
run_branch.py> python3 run_branch.pyThis starts the server and all the Branch objects are instantiated with the data provided in
input.json -
In another terminal, run client using
run_client.py> python3 run_customer.pyThis reads
input.jsonand instantiates the Customer processes, callingexecuteEvents()to process the list of events provided -
Results are stored in
output.json -
Customer processes debug logs are stored in
customerDebug.txt -
Branch processes debug logs are stored in
branchDebug.txt