Skip to content

nmzabith/pastry-DHT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DHT-based Distributed System

This project implements a Distributed Hash Table (DHT) using Pastry, with a Bootstrap Server, multiple NodeApps, and a React frontend.

Prerequisites

  • Docker
  • Docker Compose (optional, for easier deployment)

Project Structure

  • BS/: Contains the Bootstrap Server implementation
  • pastry-dht/: Contains the Pastry DHT implementation
  • FrontEnd/: Contains the React frontend application
  • start.sh: Script to start the Bootstrap Server and NodeApps
  • Dockerfile: Defines the Docker image for the project

Setup and Running the Project

Using Docker

  1. Clone the repository:

    git clone https://github.com/nmzabith/pastry-DHT.git
    cd <project-directory>
    
  2. Setup Node count and desired port range

    • change NODE_COUNT in .env to your desdired range. (default is 25)
    • change the port range in docker-compose.yaml.
  3. Build the Docker image or use docker compose up and skip to step 5:

    docker build -t dht-system .
    
  4. 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-system
    

    This command will:

    • Start the Bootstrap Server
    • Launch multiple NodeApps
    • Serve the React frontend
  5. Access the frontend by opening a web browser and navigating to:

    http://localhost:8080
    

    Then 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)

Development

To make changes to the project:

  1. Modify the Java files in BS/ or pastry-dht/ as needed.
  2. Update the React frontend in the FrontEnd/ directory.
  3. Rebuild the Docker image to reflect your changes.

#UI Instructions

  • Go to http://localhost:8080/ image

  • After Update with Visualization image

  • Hover over a node shows all its routing image

  • Zoom into a Node can show the files it contains image

  • Each Node is interactable and how the options available image

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

  • search result pop up in the dialog box image

  • Donwload button will appera after search is success image

  • Click on Download button will prompt to save the file image

License

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors