How to set up an E-Chord network locally
This guide describes the process by which an E-Chord network can be set up in a local network.
Seed Server
The first thing you'll need to do before starting any E-Chord nodes is to run a seed server. Unless you have a custom seed server, you can use the original implementation provided with the main E-Chord implementation.
On the machine you want acting as a seed server, start by cloning the repository. At a location of your choice, open a terminal and use the command git clone https://github.com/notTypecast/E-Chord-Seed. You should see output similar to the below:
Cloning into 'E-Chord-Seed'...
remote: Enumerating objects: 48, done.
remote: Counting objects: 100% (48/48), done.
remote: Compressing objects: 100% (37/37), done.
Receiving objects: 100% (48/48), 10.67 KiB | 214.00 KiB/s, done.
remote: Total 48 (delta 24), reused 30 (delta 10), pack-reused 0 (from 0)
Resolving deltas: 100% (24/24), done.
If not, make sure git is installed on the system.
Another way to get the repository is through GitHub's web interface itself. Above the repository's directory structure on the main page, you will find a button with the text <> Code. Click it, and choose the Download ZIP option. You should now have a ZIP file with the repository in it. Simply extract it at your location of choice.
Once the repository has been cloned, open a terminal at its location. If you cloned the repository through the command line interface, using the command cd E-Chord-Seed directly after will suffice.
Optionally, you can change the seed server parameters before starting the server. Open the params.json file. Here, you can change the server's port, which is 8000 by default. For a full list of parameters, refer to the parameter reference guide.
Once finished, enter the command python3 server.py. If nothing goes wrong, you should see the below output:
MainThread-INFO: Loaded params
MainThread-INFO: Starting node on [your local IP]:[your PORT]
You have now successfully set up the Seed Server!
Nodes
The next part is setting up the actual E-Chord network. On a computer you'd like to add to the network as a node, get the E-Chord repository, similarly to how you previously downloaded the seed repository.
There is just one step that must be completed before entering the network. Open the config/params.json file. There, you'll find various parameters about the network that can be customized. For a full list of them, refer to the parameter reference guide.
Under "seed_server", you'll find the following parameters:
"seed_server": {
"ip": "192.168.1.15",
"port": 8000,
"attempt_limit": 4
}
Make sure to change the seed server IP to the IP of the computer running the seed server on the local network. This was available at the [your local IP] part of the output after you ran the seed server. Similarly, change the port number to the number you used to run the seed server.
Additionally, change the port number under host to a unique port number.
Optionally, change any other parameters as needed. However, make sure that any changes are applied to every node in the network, since most of these parameters must be the same across all nodes. Again, refer to the guide for more information on individual parameters.
Once the parameters are set up as required, you can launch the node on this system using the python3 start_node.py command. Do not provide the port as an argument! If you do this, the node will run on localhost and won't be visible to other computers in the network.
If everything has been done correctly, you should see output confirming that the node has joined the network. If this is the first computer you've added to the network, the output should look somewhat like this:
MainThread:11932-INFO: No other nodes in the network
MainThread:11932-INFO: Initialized predecessor and sucessor list to self
MainThread:11932-INFO: Starting node on [your local IP]:[your PORT]
You'll need to repeat this process for each new computer you add to the network. As you add more computers, the output of each should start to indicate the presence of others in the network.
Similarly, the output of the seed server should indicate awareness of each of the nodes joining the network.