Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
WAMPAC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ramaguru Radhakrishnan
WAMPAC
Commits
10ea987d
Commit
10ea987d
authored
Feb 12, 2022
by
Ramaguru Radhakrishnan
Browse files
Options
Downloads
Patches
Plain Diff
Removed Commented Code
parent
e3ff06f2
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/com/rubix/WAMPAC/DID/DIDFunctions.java
+3
-84
3 additions, 84 deletions
src/main/java/com/rubix/WAMPAC/DID/DIDFunctions.java
with
3 additions
and
84 deletions
src/main/java/com/rubix/WAMPAC/DID/DIDFunctions.java
+
3
−
84
View file @
10ea987d
...
...
@@ -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
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment