Skip to content

ThejanRupasinghe/distributed-assignment

Repository files navigation

Distributed NodeJs

Starting servers

  1. Start the bootstrap server inside BootstrapServer/C/Linux

    • Compile gcc P2PRegistry.c
    • Run ./a.out <port_number> eg: ./a.out 5050
  2. Start Node servers (server.js)

    • Install Node.js
    • Run npm install.
    • Start node servers with command line arguments
      • bsIP - IP of the bootstrap server
      • bsPort - Port of the bootstrap server
      • name - name of the node in the format 'node_001'
      • port - server port
      • hopCount - max hop count in random search
      • wire - enables wire logs
      • debug - enable debug logs
    • eg: node server.js --bsIP=127.0.0.1 --bsPort=5050 --name=node_001 --port=4000
    • eg: wire log enabled node server.js --bsIP=127.0.0.1 --bsPort=5050 --name=node_001 --port=4000 --wire

CLI

  • at - prints the address table
  • name - prints the name
  • files - prints the file list in the node
  • exit - gracefully shuts down the node
  • search "harry" - searches for a string
  • download "Harry Potter" 192.168.1.6 4001 - to download the given file from the given IP and Port
  • con-graph - draws the connectivity graph

run.sh

  • Help to create servers.
  • Please make sure to edit the $DIR variable to your working dir.
  • If not execute use chmod +x run.sh && ./run.sh

About

A Distributed Content Searching implementation in Node.js as described in http://dilum.bandara.lk/wp-content/uploads/CourseNotes/CS4262DS/Group-Project-Content-Searching-in-a-Distributed-Overlay-Network.pdf

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •