Skip to content

joaoalvesss/feup-sdle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SDLE Second Assignment

Grade

Project Grade: 17.3/20

VIDEO LINK

https://drive.google.com/file/d/1n5MJqA3dpAfS7yrp3xe0ELwEcOu71Mhx/view?usp=sharing

SDLE Second Assignment of group T<0><7>G<1><2>.

Group members:

  1. <Catarina> <Felgueiras> (<up202403074@edu.fe.up.pt>)
  2. <Eduardo> <Sousa> (<up202103342@edu.fe.up.pt>)
  3. <Ema> <Martins> (<up202402794@edu.fe.up.pt>)
  4. <João> <Alves> (<up202108670@edu.fe.up.pt>)

Prerequisites

Ensure the following dependencies are installed:

  • Python 3.8 or later

To check your Python version:

python3 --version

Installation

  1. Clone the repository:
git clone <repository-url>
cd <repository-directory>
  1. Ensure all Python files (proxy.py, server.py, client.py) are in the project directory.

Usage

Starting the Proxies

Run the following commands to start two proxy instances:

python3 proxy.py PROXY1 5561 5564
python3 proxy.py PROXY2 5564 5561

Starting the Servers

Run the following commands to start four server instances, each with a unique port and a predefined value:

python3 server.py 5557 100
python3 server.py 5558 300
python3 server.py 5559 550
python3 server.py 5560 900

Starting the Client

Finally, run the client to begin interacting with the system:

python3 client.py

How to use?

As a client, here is a tutorial on how to use our application:

Username: Kiki

------------WELCOME----------- Available commands 1 | Create a list: create list_name 2 | Join a list: join http://localhost/3000/list_name 3 | Add an item: put list_name item_name item_value 4 | Remove an item: remove list_name item_name 5 | Increment the value of an item: increment list_name item_name quantity_to_increment 6 | Decrement the value of an item: decrement list_name item_name quantity_to_decrement 7 | Get the updated list: get list_name What do you want to do?

Follows a concrete example:

Enter a Command: create groceries - Creates a new list with the name groceries Enter a Command: put groceries banana 5 - Adds the item banana to the list with an initial value of 5 Enter a Command: increment groceries banana 1 - Increments the item banana by 1 Enter a Command: put groceries orange 5 - Adds the item orange to the list with an initial value of 5 Enter a Command: decrement groceries orange 1 - Decrements the item orange by 1 Enter a Command: get groceries - This allows the user to view the current state of the list

Now you have the output: {banana:6, orange:4}

Username: Ema

------------WELCOME----------- Available commands 1 | Create a list: create list_name 2 | Join a list: join http://localhost/3000/list_name 3 | Add an item: put list_name item_name item_value 4 | Remove an item: remove list_name item_name 5 | Increment the value of an item: increment list_name item_name quantity_to_increment 6 | Decrement the value of an item: decrement list_name item_name quantity_to_decrement 7 | Get the updated list: get list_name What do you want to do?

Follows a concrete example:

Enter a Command: join http://localhost/3000/groceries - Joins to a existent list Enter a Command: get groceries

Now you have the output: {banana:6, orange:4}


Notes

  • PROXY1 and PROXY2: Represent the two proxy instances.
  • Ports: Ensure all the ports specified (5561, 5564, 5557, 5558, 5559, 5560) are free and not in use by other processes.
  • Server Values: Each server is initialized with a starting value (e.g., 100, 300, etc.). Adjust these as needed when running server.py.

About

Large-Scale Distributed Systems

Topics

Resources

Stars

Watchers

Forks

Languages