Skip to content
Snippets Groups Projects
Commit 10ea987d authored by Ramaguru Radhakrishnan's avatar Ramaguru Radhakrishnan :speech_balloon:
Browse files

Removed Commented Code

parent e3ff06f2
No related branches found
No related tags found
No related merge requests found
......@@ -28,10 +28,6 @@ public class DIDFunctions {
String vipFile = readFile("vip.json");
JSONArray vipArray = new JSONArray(vipFile);
// InetAddress myIP = InetAddress.getLocalHost();
// String ip = myIP.getHostAddress();
// System.out.println("IP Check" + ip);
String ip = ipClass.getIP();
System.out.println("/checkIpStatus IP Address: " + ip);
......@@ -46,28 +42,6 @@ public class DIDFunctions {
}
return false;
}
// public static boolean syncVip(String role) throws IOException, JSONException {
// PropertyConfigurator.configure(LOGGER_PATH + "log4jWallet.properties");
// Functions.pathSet();
// boolean syncFlag = false;
// StringBuilder result = new StringBuilder();
// URL url = new URL(SYNC_IP + "/getvip");
// HttpURLConnection conn = (HttpURLConnection) url.openConnection();
// conn.setRequestMethod("GET");
// BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
// String line;
//
// while ((line = rd.readLine()) != null) {
// result.append(line);
// syncFlag = true;
// }
// rd.close();
// if(role.equals("Verifier"))
// writeToFile(DATA_PATH + "vip.json", result.toString(), false);
// else
// writeToFile("vip.json", result.toString(), false);
// return syncFlag;
// }
public static void changePath() throws JSONException {
Functions.pathSet();
......@@ -142,63 +116,8 @@ public class DIDFunctions {
else
return "Failure";
}
else return "Failure";
// //Get all members from vip.json
// String vipFile = readFile(DATA_PATH + "vip.json");
// JSONArray vipArray = new JSONArray(vipFile);
//
// JSONArray contactMembers = new JSONArray();
// for(int i = 0; i < vipArray.length(); i++){
// JSONObject object = vipArray.getJSONObject(i);
// if(object.getString("role").equals("Verifier") && !object.getString("ip").equals(ip)){
// contactMembers.put(object.getString("peerid"));
// }
// }
//
// JSONObject dataToQuorum = new JSONObject();
//
// //Create data to send the other verifiers
// String didFile = readFile(DATA_PATH + "DID.json");
// JSONArray didArray = new JSONArray(didFile);
// JSONObject didObject = didArray.getJSONObject(0);
// didObject.put("ip", ip);
// dataToQuorum.put("data", didObject);
//
// //Contact all other verifiers
// int count = 0;
// String[] verifierCount = ContactNodes.contact(contactMembers, dataToQuorum);
//
// //TODO: resp - true r false
// //check the number of signatures verified
// if (verifierCount.length == contactMembers.length()) {
// for(int i=0; i< verifierCount.length; i++) {
// JSONObject object = new JSONObject(verifierCount[i]);
// if(object.get("count").equals(contactMembers.length()))
// count++;
// }
// }
//
// //if all verifiers count = 7, then change in the DataTable and Vip.json
// if (count == contactMembers.length()) {
// String dataTableFile = readFile(DATA_PATH + "DataTable.json");
// JSONArray dataTableArray = new JSONArray(dataTableFile);
// JSONObject dataTableObject = dataTableArray.getJSONObject(0);
// dataTableObject.put("signHash", fileHash);
// writeToFile(DATA_PATH + "DataTable.json", new JSONArray().put(dataTableObject).toString(), false);
// JSONArray newVipArray = new JSONArray();
// for(int k = 0; k < vipArray.length(); k++){
// JSONObject vipObject = vipArray.getJSONObject(k);
// vipObject.put("status", true);
// newVipArray.put(vipObject);
// }
// writeToFile(DATA_PATH + "vip.json", newVipArray.toString(), false);
// return "Verifiers Agreed";
// }
// //count doesnot match - exit
// else {
// return "Invalid Signatures";
// }
else
return "Failure";
}
public static String userDID(String ip) throws JSONException, IOException {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment