This project implements a Distributed Hash Table (DHT) using Pastry, with a Bootstrap Server, multiple NodeApps, and a React frontend.
- Docker
- Docker Compose (optional, for easier deployment)
BS/: Contains the Bootstrap Server implementationpastry-dht/: Contains the Pastry DHT implementationFrontEnd/: Contains the React frontend applicationstart.sh: Script to start the Bootstrap Server and NodeAppsDockerfile: Defines the Docker image for the project
-
Clone the repository:
git clone https://github.com/nmzabith/pastry-DHT.git cd <project-directory> -
Setup Node count and desired port range
- change
NODE_COUNTin.envto your desdired range. (default is 25) - change the port range in
docker-compose.yaml.
- change
-
Build the Docker image or use
docker compose upand skip to step 5:docker build -t dht-system . -
Run the Docker container (Chnage the desired port range according to your
NODE_COUNT):docker run -p 55555:55555 -p 20000-20024:20000-20024 -p 8080:8080 dht-systemThis command will:
- Start the Bootstrap Server
- Launch multiple NodeApps
- Serve the React frontend
-
Access the frontend by opening a web browser and navigating to:
http://localhost:8080Then enter configured Node Count and click on Update Visualization
- The playground is fully interactable (Zoom in, Zoom out, draggable)
- Hover over each node to see its knowledge about other node in the system (Includes Routing Table, LeafSet table, Neighbour table (Promiximity measured using Port))
- Each node is clickable and Your have the option to INSERT a new filename or SEARCH for a file name (A delay of 1 sec added for search is to get the upto date search resuls)
To make changes to the project:
- Modify the Java files in
BS/orpastry-dht/as needed. - Update the React frontend in the
FrontEnd/directory. - Rebuild the Docker image to reflect your changes.
#UI Instructions
-
Go to http://localhost:8080/

-
Click on Search File and enter the file name, then submit to query a file

This project is licensed under the MIT License - see the LICENSE.md file for details.






