networkOrchestrator.hpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. size_t lambda,
  16. bool maliciousServers);
  17. void shut_down_remote_actors(
  18. const std::vector<std::string>& relevantIPs,
  19. const std::vector<int>& relevantPorts);
  20. // SYNCHRONIZATION
  21. void wait_for_servers_ready(
  22. std::string dealer,
  23. int dealerPort);
  24. void wait_for_clients_ready(
  25. std::string dealer,
  26. int dealerPort,
  27. size_t numClients);
  28. // RUN EXPERIMENT
  29. void execute_experiment(
  30. std::string dealer,
  31. int dealerPort,
  32. const char *filename);
  33. /* "PRIVATE" FUNCTIONS */
  34. // TRIGGER EXPERIMENT EVENTS
  35. void trigger_epoch_change(
  36. std::string dealer,
  37. int dealerPort);
  38. void trigger_vote(
  39. std::string target,
  40. int targetPort);
  41. void trigger_reputation_proof(
  42. std::string target,
  43. int targetPort,
  44. std::string verifier,
  45. int verifierPort);
  46. #endif