This code has been made to work on windows machines, as such running it on linux can encounter some error messages (i.e. cls has been used instead of clear to clear the terminal)
- Navigate to the file directory in cmd and run startServer.bat
- The batch file should open 3 servers, a frontend and another cmd ready to run the client
- Wait for the frontend to say "CLIENT CAN NOW CONNECT" (may take a while as pyro nameservers are slow)
- In the cmd that has nothing running type "python Client.py" to start the client
- Follow the instructions on screen to use the system(an example on testing the system functionality will follow)
- Open up 5 command prompt windows and navigate to the file directory
- In the first, run "pyro4-ns"
- In three others run "python Server.py"
- Once the servers all say "SERVER READY" run "python FrontEnd.py"
- Once the frontend says "CLIENT CAN NOW CONNECT" run "python Client.py" and follow onscreen instructions
The client has several different queries and updates it can make which are all outlined when you run the client.
- Enter a number for the userID, in my tests I used "1"
- Use "view" on a movie to see that users' rating for a movie in the system. I used "Toy Story"
- Use "rate" on that same movie to update it's rating for the user
- Use "view" again to see if the update went through
- Use "change" to change server 1's status to offline (the frontend uses servers in order unless they are offline or busy)
- Use "view" again to see if the other servers have recieved the update
- Use "change" on servers 2 and 3 to make all servers offline
- Attempt to use a function, expected output should be "all servers are currently busy"
- This should show off all the features, it can work across multiple clients too (i.e. another cmd with Client.py running)
- Make sure to use "change" on the servers to make them online again
Whilst this is all shown when the client runs, here is an overview of the capabilities of this system. (more details on how it works can be seen in comments throughout the code)
- Find out information about a movie
- Find the current user's rating of a movie
- Find the average rating for a movie
- Change/Add a rating to a movie
- Delete your rating for a movie
- Change a server status between online and offline
- Quit the system
- The system has a 20% chance of being "over-loaded" rather than online
- The system uses causal ordering for updates and recieves gossip messages when needed, handling the timestamping and updates when required
- The system takes a while to boot up due to nameserver functions being slow in python