Skip to content

AmoghMK/Chord_DHT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Author: Amogh Madanayakanahalli Kumar
Student id: 2005781
Email: [email protected]

Running the code:

  • python3 main.py <test input file>
    (Ex: python3 main.py testcase.txt)

Building Testcase file:

  • testcase file will contain a list of commands with a command in each line.
  • each command will have its commandName first, followed by its parameters.
  • An example testcase file is included with the project testcase.txt.
  • Commands implemented and their format with examples below:
    • Creating/Adding a new node:
      addNode <node_name> <node_id>
      • Ex: addNode n1 30
    • Joining a node to DHT:
      join <new_node_name> <existing_node_name>
      • Ex: join n1 n0
    • pretty print fingerTable of a node:
      ppf <node_name>
      • Ex: ppf n0
    • insert key into DHT from a given node:
      insert <node_name>
      • Ex: insert n0 3 3
    • pretty print key value pairs stored in a node:
      ppk <node_name>
      • Ex: ppk n0
    • look up all keys from a given node:
      lookupall <node_name>
      • Ex: lookupall n2
    • leave a node from DHT:
      leave <node_name>
      • Ex: leave n1
    • find value of a key from a given node
      find <node_name>
      • Ex: find n0 3
    • remove a key from DHT from a given node
      remove <node_name>
      • Ex: remove n1 3

Files:

  • main.py -> main file which needs to executed
  • utils.py -> interface for commands in testcase to functionality in node objects.
  • node.py -> contains class Node and its methods involved.
  • fingerTable.py -> contains class fingerTable and its methods.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages