Skip to content
This repository was archived by the owner on Jun 11, 2026. It is now read-only.

JoaoRuss0/dad

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DAD

Implementation

The following packages are implemented:

  1. Complete the baseline. Implement debug modes required to show that the baseline is bogus. Complete the baseline, namely by doing a proper Paxos “phase 1".

  2. Multi-Paxos. The system implements Multi-Paxos, running “Schedule A”.

  3. Vertical Paxos I. The system implements “Schedule B”. And Vertical paxos was implemented to allow the changing set of Acceptors.

  4. Fast TOPIC. The system implements a custom algorithm for a faster and eventually consistent TOPIC operation.

Launching

We added a script to run the project with tmux(https://github.com/tmux/tmux/wiki), by default it opens 3 server instances in Schedule A and 1 client instance. It is executed by running the following command: ./start_tmux.sh

The following options are available:

  • -p,--port Set the port (default: 16000)
  • -c,--capacity Set the max capacity in meetings (default: 10)
  • -s,--schedule Set the schedule to be run (default: A)
  • -n,--client-count Set the number of clients to be run (default: 1)
  • -d Run a console

Requirements

The project requires the following packages:

  • Java 22
  • Maven 3.8.4
  • Protoc 3.12

Environment

The project includes a template setup_env.sh which students may use as basis to download all necessary packages for the project execution. The current script was designed for Linux/Ubuntu distributions on an Intel x86 environments. Students may extend this script for their target distribution/CPU architecture.

If so, it will keep all required packages in INSTALL_DIR, which can be activated by running source INSTALL_DIR/env.sh.

Compiling

To compile the project, students must run the command mvn clean install in the root directory

⚠️WARNING - Compilation Environment ⚠️

The project requires different pom.xml for the contract module depending on the CPU architecture/OS distribution. The project currently has two pre-pepared poms:

  • One for ARM/M4 Mac-OS based systems, named arm-pom.xml;
  • One for Intel/Linux based systems, named intel-pom.xml;

Before the first compilation, copy your required contract pom and rename it to pom.xml.

Deployment

Current implementation assumes that all modules run on the same physical machine and requires 5 active servers.

The project is composed of three main components:

  • Servers
  • App (Clients)
  • Console

Servers

The servers run the base implementation. They are executed running the following command in the server directory:

mvn exec:java -Dexec.args="{port} {id} {scheduler} {max}"

Where you must fill in the following arguments:

  • {port}: Base port of all servers. All servers should use the same port. The Server binded port will be * *{port} + {id}**.
  • {id}: Sequential id of the server. Current implementation requires servers to be ID'ed starting from 0 to N-1 servers.
  • {scheduler}: The scheduler used for reconfiguration (use 'A' to start)
  • {max}: The maximum number of participants in a meeting

Client

A client that executes transactions. It is executed by running the following command in the app directory:

mvn exec:java -Dexec.args="{id} {host} {port} {scheduler}"

Where you must fill in the following arguments:

  • {id}: Sequential id of the client. Current implementation requires clients to be ID'ed starting from 1.
  • {host}: The host for all servers. (just use "localhost")
  • {port}: Base port of all servers.
  • {scheduler}: The scheduler used (use 'A' to start)

The client module opens a terminal from where students may issue commands. The following commands are available:

  • help - Shows the full command list;
  • exit - Gracefully finishes the client.

Console

The console client servers as a front-end to issue configuration settings to servers. It is executed by running the following command in the consoleclient directory:

mvn exec:java -Dexec.args="{host} {port} {scheduler}"

here you must fill in the following arguments:

  • {host}: The host for all servers. (just use "localhost")
  • {port}: Base port of all servers.
  • {scheduler}: The scheduler used (use 'A' to start)

The console client opens a terminal from where students may issue configuration changes to servers. The following commands are available:

  • help - Shows the full command list;
  • ballot ballot_number server - Instructs a server to start ballot with number 'ballot_number';
  • debug mode replica_id - Activates debug on a given replica;
  • exit - Gracefully finishes the console.

Protobuffs and Utils

To support these modules, the project has additional directories:

  • contract, holding the required .proto files;
  • util, holding the general classes to collect RPC responses
  • core, holding the general classes that manage meetings
  • configs, holding the general classes that manage configurations

About

Design and Implementation of Distributed Applications

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors