Skip to content
Snippets Groups Projects
Commit c8a49763 authored by arshiam2's avatar arshiam2
Browse files

wip

parent 4d367db4
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,7 @@ const chalk = require("chalk");
const handleErrors = require("../utils/handleErrors");
module.exports.command = "init";
module.exports.describe = "Sets up five nodes (VMs 2 through 6) in a group, with VM 1 as the introducer.";
module.exports.describe = "Sets up five nodes (VMs 2 and 3) in a group, with VM 1 as the introducer.";
module.exports.builder = (yargs: any) => yargs;
......
......@@ -98,14 +98,17 @@ function getPairings(machines) {
surroundingNodes.push(machines[i - 2]);
}
console.log(
"Node :" +
machines[i] +
" is connect to " +
Array.from(new Set(surroundingNodes))
);
console.log("")
initialize(machines[i][0], Array.from(new Set(surroundingNodes)));
}
}
socket.on("message", function(message, rinfo) {
......@@ -134,10 +137,13 @@ socket.on("message", function(message, rinfo) {
}
if (text[0] === "dead") {
console.log("")
console.log("Killed " + text[1].toString()[0])
console.log("")
const ondLength = machines.length
machines = machines.filter(m => m.toString()[0] !== text[1].toString()[0]);
console.log(machines)
console.log("Current Machines Up " + machines)
console.log("")
getPairings(machines);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment