tpc(make sure you don't commit this). To test the application, you must start some number of 2PC followers and one 2PC leader. You can start a follower with the following command:
localhost:50001. To connect multiple followers to a leader, you can set the
--followerflag multiple times.
tpcbinary, run the command
python3 tpc.py <num-followers>to automatically start a cluster with the specified number of followers and a leader. Use Control-C to shut down the cluster when you are done. This cluster automatically exposes the leader at
python3 client.py <leader-url>. It automatically connects to the leader and starts a simple shell where you can execute GET and PUT commands.
client.pyto see how we use a fake follower and a fake leader in order to control the actions of each. We use this in order to run some tests, but if you want to use it you will need to write a python script that takes advantage of the mocks.
test.py, we provide a framework very similar to out autograding framework. We also provide 3 test cases identical to the the cases used on the autograder, for you to use as an example to write your own tests. These examples also use the mock leader and mock followers, which is very useful for only testing either the follower or the leader in isolation.