Kaynağa Gözat

modifications so the orchestrator will run on RIPPLE as desired

tristangurtler 3 yıl önce
ebeveyn
işleme
716624ff6d

+ 4 - 4
prsona/src/networkOrchestrator.cpp

@@ -26,10 +26,10 @@ int start_remote_actor(
     std::stringstream buffer;
     std::string command;
 
-    // buffer << "ssh tmgurtle@" << target << " \"screen \'~/prsona/prsona/scripts/startup.sh "
-    //     << (server ? "server " : "client ") << id << " " << output << (maliciousServers ? " T\'\"" : " F\'\"");
-
-    buffer << "bin/" << (server ? "server " : "client ") << id << " " << output << (maliciousServers ? " T &" : " F &");
+    if (target != "tick0" && !target.empty())
+        buffer << "ssh -n " << target << " \"~/prsona/prsona/scripts/startup.sh " << (server ? "server " : "client ") << id << " " << output << (maliciousServers ? " T\" &" : " F\" &");
+    else
+        buffer << "bin/" << (server ? "server " : "client ") << id << " " << output << (maliciousServers ? " T &" : " F &");
     command = buffer.str();
 
     return system(command.c_str());

+ 7 - 3
prsona/src/orchestratorMain.cpp

@@ -53,6 +53,10 @@ int main(int argc, char* argv[])
     string dealerIP, dealerPortStr;
     int dealerPort = 0;
 
+    std::map<std::string,std::string> targeter;
+    targeter["129.97.119.208"] = "tick0";
+    targeter["129.97.119.209"] = "tick1";
+
     // Read in from config files the server locations
     load_multiple_instances_config(serverIPs, serverPorts, "cfg/serverIPs.cfg");
 
@@ -76,7 +80,7 @@ int main(int argc, char* argv[])
     cout << "[ORC] Starting BGN dealer server." << endl;
 
     vector<thread> serverStartup, clientStartup;
-    serverStartup.push_back(thread(start_remote_actor, dealerIP, true, "d", output, maliciousServers));
+    serverStartup.push_back(thread(start_remote_actor, targeter[dealerIP], true, "d", output, maliciousServers));
     this_thread::sleep_for(ONE_SECOND);
 
     cout << "[ORC] Starting other servers." << endl;
@@ -86,7 +90,7 @@ int main(int argc, char* argv[])
         if (serverIPs[i] == dealerIP && serverPorts[i] == dealerPort)
             continue;
 
-        serverStartup.push_back(thread(start_remote_actor, serverIPs[i], true, "s" + to_string(i), output, maliciousServers));
+        serverStartup.push_back(thread(start_remote_actor, targeter[serverIPs[i]], true, "s" + to_string(i), output, maliciousServers));
     }
 
     cout << "[ORC] Waiting for confirmation that servers are ready to continue." << endl;
@@ -100,7 +104,7 @@ int main(int argc, char* argv[])
 
     for (size_t i = 0; i < numClients; i++)
     {
-        clientStartup.push_back(thread(start_remote_actor, clientIPs[i], false, "c" + to_string(i), output, maliciousServers));
+        clientStartup.push_back(thread(start_remote_actor, targeter[clientIPs[i]], false, "c" + to_string(i), output, maliciousServers));
         this_thread::sleep_for(ONE_SECOND);
     }