Skip to content

Decentralized chat service written in Java, Erlang, ZeroMQ and ReactiveX featuring causal consistency, CRDTs, gossip and a DHT

License

Notifications You must be signed in to change notification settings

ruilopesm/doge-chat

 
 

Repository files navigation

20/20 ⭐

🏃 Running

☕️ Java

First, make sure you have the required dependencies installed.

mvn clean install

Running a client:

mvn -pl client exec:java

You 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"

💡 Tips

  • Run mvn compile whenever a new Protobuf file is added or modified. This will generate the necessary Java classes for the Protobuf messages.
  • Run mvn install whenever a new dependency has been added or modified. This will update the local Maven repository with the new dependencies.

🔴 Erlang

Running a DHT node (from inside the search-node directory):

sh scripts/launch_node.sh n1

Currently, we support nodes numbered from 1 to 5.

Running a simulated client:

python scripts/client_simulation.py

This 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.

About

Decentralized chat service written in Java, Erlang, ZeroMQ and ReactiveX featuring causal consistency, CRDTs, gossip and a DHT

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 67.5%
  • Erlang 19.2%
  • Typst 11.4%
  • Python 1.7%
  • Shell 0.2%