Robert Conan - 09469320
Originally designed as a gem, this is no longer the case. All files are contained inside the lib directory
Main.rb is the "Test" file and is used to instanciate the project.
To set up the first node in the network on localhost:8767
$ ruby main.rb --boot Command --bootstrap 127.0.0.1:8767
Subsequent nodes can then be defined using
$ ruby main.rb --index Joining2 --bootid Command --port 127.0.0.1:8778 --bootstrap 127.0.0.1:8767
And for a node to request the indexing and searching of indexes on the network
$ ruby main.rb --index Joining --bootid Command --port 127.0.0.1:8777 --bootstrap 127.0.0.1:8767 --send --search WORD
The commands to run from the command line are as follows
- The ID of the Bootstrap node (when it is starting)
--boot []
- The IP & Port combination for this individual node (Not needed if Bootstrap node)
--port []
- The Bootstrap node IP
--bootstrap []
- The Nodes Identifier/Index (Not needed if Bootstrap node)
--index []
- The ID of the Bootstrap node (that this node will use to connect too)
--bootid []
- A flag to say the Index message should be sent by this node
--send
- The search term to search for on the network
--search []
The additional command line parameters are used to provide easier debugging then instanciating the project in a single terminal window
The IP:PORT combination is passed through regex to ensure the format of 0-255.0-255.0-255.0-255:0-9999