Skip to content
This repository has been archived by the owner on Feb 2, 2021. It is now read-only.

Elderry/DHT-Demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 

Repository files navigation

#DHT-Demo

A demo program for Distributed Hash Table, implemented Chord protocol in Python.

##Environment

You'll need twisted installed as a development dependency. See twisted website for help.

##Running

At first, an initial node must be started by using -i or -initial argument. Then you can add other nodes.

###instruction:

python chord.py -i <nickname> [-s scale] [-IP ip] [-p port]
python chord.py <nickname> [-IP ip] [-p port]

###notice:

  1. Nicknames must be unique.
  2. The initial node's address must be 'localhost', 8470.

##GUI

There's a GUI for a more convenient way to send and demonstrate query. You can run draw.py to start the GUI before node's start and it will listen to port 9000.

If you want to send a query through a node, just click the node and then input your query string. When finished, target node and a path the query went through these nodes will be displayed.

If there're too many lines on screen, you can enter space to redraw.

##Test Example

Using 3 console windows, run in each one:

python Draw.py
python Chord.py -i nodeA -s 10 --IP 127.0.0.1 -p 8470
python Chord.py nodeB --IP 127.0.0.1 -p 8471

##Feedback

Any questions, feel free to contact us.

  • email: elderry@outlook.com zy3861@163.com

About

A demo program for Distributed Hash Table

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages