Open the terminal and go into the Chord directory, use 'make' command to complie all .java files in /bin directory.
Now you should have a /bin directory contains all .class files.
1. For running Chord, there are two types of command, one is to create a new chord ring and another is to join an existing chord ring.
- Create a new chord ring [java Chord (port number)]
java Chord 1234
The command will create a chord ring and a node based on the device's ip address and the port number you want the node to listen to.
-
Join an existing chord ring [java Chord (port number) (target ip address) (target port number)]
java Chord 2 172.31.173.206 1234
The command create a node based on the device's ip address and the port number 2 and joining the ring through 172.31.173.206:1234
2. After a node (a java program) connects to the ring, we can use 'table' command to check the finger table of the node and the 'quit' command to leave the ring.
3. For querying, first try to connect a node in the chord ring
java Query 172.31.173.206 1234
If we successfully connected to the node, we can start to type the search key and find out where the key should store in.
Use 'quit' command to quit the query