20/20 ⭐
First, make sure you have the required dependencies installed.
mvn clean installRunning a client:
mvn -pl client exec:javaYou can pass arguments to the client using the -Dexec.args option. For example, to make the client connect to a specific chat server, you can run:
mvn -pl client exec:java -Dexec.args="--name rui --topic uminho -as 6667"You can list the available options for the client by running:
mvn -pl client exec:java -Dexec.args="--help"Caution
Currently, we are assuming that both the client and servers are running on the same host (localhost). In the future, we shall add support for pseudo-remote servers.
Running a chat server:
mvn -pl chat-server exec:java -Dexec.args="-p 5555"As with the client, you can also run the following command:
mvn -pl chat-server exec:java -Dexec.args="--help"Note
Make sure you understand the role of the -p flag, since it is crucial for the server workflow. For example, if -p is set to 5555, the server will bind a PULL socket to it. Subsequent port numbers will be used for other types of sockets.
Running an aggregation server:
mvn -pl aggregation-server exec:java -Dexec.args="-p 6666 -cs 5555"You can pass the -i flag to serve as an introductory node:
mvn -pl aggregation-server exec:java -Dexec.args="-p 7666 -cs 6555 -i 6666"You can understand each option by running:
mvn -pl aggregation-server exec:java -Dexec.args="--help"- Run 
mvn compilewhenever a new Protobuf file is added or modified. This will generate the necessary Java classes for the Protobuf messages. - Run 
mvn installwhenever a new dependency has been added or modified. This will update the local Maven repository with the new dependencies. 
Running a DHT node (from inside the search-node directory):
sh scripts/launch_node.sh n1Currently, we support nodes numbered from 1 to 5.
Running a simulated client:
python scripts/client_simulation.pyThis will run a simulated client that will connect to the DHT node and send messages to it. The client will also receive messages from the DHT node and print them to the console.
