networkOrchestrator.hpp 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #ifndef __PRSONA_NETWORK_ORCHESTRATOR_HPP
  2. #define __PRSONA_NETWORK_ORCHESTRATOR_HPP
  3. #include <string>
  4. #include <vector>
  5. #include <chrono>
  6. #include "networking.hpp"
  7. const std::chrono::seconds ONE_SECOND(1);
  8. /* "PUBLIC" FUNCTIONS */
  9. // START UP AND SHUT DOWN INSTANCES
  10. int start_remote_actor(
  11. const std::string& target,
  12. bool server,
  13. const std::string& id,
  14. const std::string& output,
  15. bool maliciousServers);
  16. void shut_down_remote_actors(
  17. const std::vector<std::string>& relevantIPs,
  18. const std::vector<int>& relevantPorts);
  19. // SYNCHRONIZATION
  20. void wait_for_servers_ready(
  21. std::string dealer,
  22. int dealerPort);
  23. void wait_for_clients_ready(
  24. std::string dealer,
  25. int dealerPort,
  26. size_t numClients);
  27. // RUN EXPERIMENT
  28. void execute_experiment(
  29. std::string dealer,
  30. int dealerPort,
  31. const char *filename);
  32. /* "PRIVATE" FUNCTIONS */
  33. // TRIGGER EXPERIMENT EVENTS
  34. void trigger_epoch_change(
  35. std::string dealer,
  36. int dealerPort);
  37. void trigger_vote(
  38. std::string target,
  39. int targetPort);
  40. void trigger_reputation_proof(
  41. std::string target,
  42. int targetPort,
  43. std::string verifier,
  44. int verifierPort);
  45. #endif