Local simulation

E-Chord can be simulated locally, on one machine, using the provided simulation scripts. Various parameters of the simulation can be customized, as described in the parameter reference guide.

These scripts should be used after a seed server is already running locally. All scripts should be run from the scripts directory.

Adding nodes

To add nodes to the network, use the mass_node_join script.

Sample usage:

python3 mass_node_join.py

Inserting and looking up data

To insert or look up data, use the mass_data script.

Sample usage:

python3 mass_data.py [filedir] [i/l] (limit) (delay)

Required arguments include:

  • filedir: Relative or absolute path of JSON file containing data.
  • i/l: i for insertion, or l for lookup.

Note that the data file must have a specific format. It should contain a single JSON object with multiple keys, each of which will be inserted into the network with whichever value it contains, as a pair.

Optional arguments include:

  • limit: Upper limit for number of keys to insert to the network.
  • delay: Seconds to wait before starting data insertion.

Causing node failure

To cause a mass concurrent node failure, use the mass_node_leave script.

Sample usage:

python3 mass_node_leave.py

A percentage of existing nodes, based on a parameter, will be removed from the network. Note that those nodes will attempt to move their data to other nodes before leaving.

Visualizing the network

To visualize the network, its current stability level and the keys contained within, use the visualizer script.

Sample usage:

python3 visualizer.py