From 3bba245409fe9a6e4e73de7472c147abf3096362 Mon Sep 17 00:00:00 2001 From: rober12 Date: Wed, 19 Aug 2020 11:06:55 +0200 Subject: [PATCH 1/4] added a README.md and reordered the examples os presentations --- ...entation.js => 4.updateEntity2Presentation.js} | 0 ...tatus.js => 5.getEntity2PresentationStatus.js} | 0 ...ntation.js => 6.updateSubject1Presentation.js} | 0 examplePresentations/README.md | 15 +++++++++++++++ 4 files changed, 15 insertions(+) rename examplePresentations/{5.updateEntity2Presentation.js => 4.updateEntity2Presentation.js} (100%) rename examplePresentations/{6.getEntity2PresentationStatus.js => 5.getEntity2PresentationStatus.js} (100%) rename examplePresentations/{4.updateSubject1Presentation.js => 6.updateSubject1Presentation.js} (100%) create mode 100644 examplePresentations/README.md diff --git a/examplePresentations/5.updateEntity2Presentation.js b/examplePresentations/4.updateEntity2Presentation.js similarity index 100% rename from examplePresentations/5.updateEntity2Presentation.js rename to examplePresentations/4.updateEntity2Presentation.js diff --git a/examplePresentations/6.getEntity2PresentationStatus.js b/examplePresentations/5.getEntity2PresentationStatus.js similarity index 100% rename from examplePresentations/6.getEntity2PresentationStatus.js rename to examplePresentations/5.getEntity2PresentationStatus.js diff --git a/examplePresentations/4.updateSubject1Presentation.js b/examplePresentations/6.updateSubject1Presentation.js similarity index 100% rename from examplePresentations/4.updateSubject1Presentation.js rename to examplePresentations/6.updateSubject1Presentation.js diff --git a/examplePresentations/README.md b/examplePresentations/README.md new file mode 100644 index 0000000..285409e --- /dev/null +++ b/examplePresentations/README.md @@ -0,0 +1,15 @@ +# Important + +First of all, when you run examples _**2.getSubjectPresentationStatus.js**_, _**5.getEntity2PresentationStatus.js**_ and _**7.getPresentationStatus.js**_ and the result is `{exist:false, status: '0'}` the examples have not gone well. Probably because the DID of the subject or entity has been crushed and therefore it is necessary to re-run the examples located in the folder exampleCreateAlastriaID. + +On the other hand, when example _**1.createPresentations.js**_ is executed, the PSMHash of the entity is also created, but there is no traceability in the blockchain, for that you have to execute example _**4.updateEntity2Presentation.js.**_ + +The last thing that is important to know is the order of execution of the examples, for this, each one of the examples has been ordered in the correct order of execution, which is the following. + +1. ([`1.createPresentations.js`](./examplePresentation/1.createPresentations.js)). This example creates the presentation with the help of the token library, the PSMHashes of both the subject and the entity are created and finally the addSubjectPresentation transaction is created and then sent to the blockchain by the subject. This example if everything went well should have the following result `{exist: true, status: '0'}` +2. ([`2.getSubjectPresentationStatus.js`](./examplePresentation/2.getSubjectPresentationStatus.js)). In this example, what it does is ask the blockchain what the status of a certain presentation is for the subject in this case. To do this it is necessary to pass the PSMHash of the presentation for the subject and the did of the subject. +3. ([`3.getPresentationList.js`](./examplePresentation/3.getPresentationList.js)).This example returns all the presentations issued by a certain subject. To do this, in the getSubjectPresentationList call, it is necessary to pass the DID of the subject you want to know about. +4. ([`4.updateEntity2Presentation.js`](./examplePresentation/4.updateEntity2Presentation.js)). In this case, this example is executed when the receiver, receives the presentation sent to it by the subject. When this happens, the entity updates the status of this presentation to 1,which means received. This example if everything went well should have the following result `{exist: true, status: '1'}` +5. ([`5.getEntity2PresentationStatus.js`](./examplePresentation/6.getEntity2PresentationStatus.js)). In this example, what it does is ask the blockchain what the status of a certain presentation is for the entity in this case. To do this it is necessary to pass the PSMHash of the presentation for the entity and the did of the entity. +6. ([`6.updateSubject1Presentation.js`](./examplePresentation/4.updateSubject1Presentation.js)). This example is executed by the subject when they want the data contained in the presentation to no longer be used by that entity. To do this, the entity updates the status that is saved in the blockchain to 2, that means AskDeletion, so that later the entity updates the status to 3, DeletionConfirmation with the objective of not using those credentials that are inside the presentation. +7. ([`7.getPresentationStatus.js`](./examplePresentation/7.getPresentationStatus.js)). This example returns the most advanced status, i.e. if the subject has been issued teh presentation, it will be in status 0, while if the entity receiving the presentation has received it, it will update its status to 1. If at that moment the function getPresentationStatus is asked, it will return 1 since it's the most advanced status. \ No newline at end of file From 0c6d6734607a0572b094d98c5dab824d205f1191 Mon Sep 17 00:00:00 2001 From: rober12 Date: Wed, 19 Aug 2020 11:09:13 +0200 Subject: [PATCH 2/4] fixed urls --- examplePresentations/README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/examplePresentations/README.md b/examplePresentations/README.md index 285409e..b5b616f 100644 --- a/examplePresentations/README.md +++ b/examplePresentations/README.md @@ -6,10 +6,10 @@ On the other hand, when example _**1.createPresentations.js**_ is executed, the The last thing that is important to know is the order of execution of the examples, for this, each one of the examples has been ordered in the correct order of execution, which is the following. -1. ([`1.createPresentations.js`](./examplePresentation/1.createPresentations.js)). This example creates the presentation with the help of the token library, the PSMHashes of both the subject and the entity are created and finally the addSubjectPresentation transaction is created and then sent to the blockchain by the subject. This example if everything went well should have the following result `{exist: true, status: '0'}` -2. ([`2.getSubjectPresentationStatus.js`](./examplePresentation/2.getSubjectPresentationStatus.js)). In this example, what it does is ask the blockchain what the status of a certain presentation is for the subject in this case. To do this it is necessary to pass the PSMHash of the presentation for the subject and the did of the subject. -3. ([`3.getPresentationList.js`](./examplePresentation/3.getPresentationList.js)).This example returns all the presentations issued by a certain subject. To do this, in the getSubjectPresentationList call, it is necessary to pass the DID of the subject you want to know about. -4. ([`4.updateEntity2Presentation.js`](./examplePresentation/4.updateEntity2Presentation.js)). In this case, this example is executed when the receiver, receives the presentation sent to it by the subject. When this happens, the entity updates the status of this presentation to 1,which means received. This example if everything went well should have the following result `{exist: true, status: '1'}` -5. ([`5.getEntity2PresentationStatus.js`](./examplePresentation/6.getEntity2PresentationStatus.js)). In this example, what it does is ask the blockchain what the status of a certain presentation is for the entity in this case. To do this it is necessary to pass the PSMHash of the presentation for the entity and the did of the entity. -6. ([`6.updateSubject1Presentation.js`](./examplePresentation/4.updateSubject1Presentation.js)). This example is executed by the subject when they want the data contained in the presentation to no longer be used by that entity. To do this, the entity updates the status that is saved in the blockchain to 2, that means AskDeletion, so that later the entity updates the status to 3, DeletionConfirmation with the objective of not using those credentials that are inside the presentation. -7. ([`7.getPresentationStatus.js`](./examplePresentation/7.getPresentationStatus.js)). This example returns the most advanced status, i.e. if the subject has been issued teh presentation, it will be in status 0, while if the entity receiving the presentation has received it, it will update its status to 1. If at that moment the function getPresentationStatus is asked, it will return 1 since it's the most advanced status. \ No newline at end of file +1. ([`1.createPresentations.js`](./1.createPresentations.js)). This example creates the presentation with the help of the token library, the PSMHashes of both the subject and the entity are created and finally the addSubjectPresentation transaction is created and then sent to the blockchain by the subject. This example if everything went well should have the following result `{exist: true, status: '0'}` +2. ([`2.getSubjectPresentationStatus.js`](./2.getSubjectPresentationStatus.js)). In this example, what it does is ask the blockchain what the status of a certain presentation is for the subject in this case. To do this it is necessary to pass the PSMHash of the presentation for the subject and the did of the subject. +3. ([`3.getPresentationList.js`](./3.getPresentationList.js)).This example returns all the presentations issued by a certain subject. To do this, in the getSubjectPresentationList call, it is necessary to pass the DID of the subject you want to know about. +4. ([`4.updateEntity2Presentation.js`](./4.updateEntity2Presentation.js)). In this case, this example is executed when the receiver, receives the presentation sent to it by the subject. When this happens, the entity updates the status of this presentation to 1,which means received. This example if everything went well should have the following result `{exist: true, status: '1'}` +5. ([`5.getEntity2PresentationStatus.js`](./6.getEntity2PresentationStatus.js)). In this example, what it does is ask the blockchain what the status of a certain presentation is for the entity in this case. To do this it is necessary to pass the PSMHash of the presentation for the entity and the did of the entity. +6. ([`6.updateSubject1Presentation.js`](./4.updateSubject1Presentation.js)). This example is executed by the subject when they want the data contained in the presentation to no longer be used by that entity. To do this, the entity updates the status that is saved in the blockchain to 2, that means AskDeletion, so that later the entity updates the status to 3, DeletionConfirmation with the objective of not using those credentials that are inside the presentation. +7. ([`7.getPresentationStatus.js`](./7.getPresentationStatus.js)). This example returns the most advanced status, i.e. if the subject has been issued teh presentation, it will be in status 0, while if the entity receiving the presentation has received it, it will update its status to 1. If at that moment the function getPresentationStatus is asked, it will return 1 since it's the most advanced status. \ No newline at end of file From 97ec15034ce1ac58366f79fb62103059ce934362 Mon Sep 17 00:00:00 2001 From: rober12 Date: Wed, 19 Aug 2020 11:11:37 +0200 Subject: [PATCH 3/4] works --- examplePresentations/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examplePresentations/README.md b/examplePresentations/README.md index b5b616f..e3fe9fd 100644 --- a/examplePresentations/README.md +++ b/examplePresentations/README.md @@ -10,6 +10,6 @@ The last thing that is important to know is the order of execution of the exampl 2. ([`2.getSubjectPresentationStatus.js`](./2.getSubjectPresentationStatus.js)). In this example, what it does is ask the blockchain what the status of a certain presentation is for the subject in this case. To do this it is necessary to pass the PSMHash of the presentation for the subject and the did of the subject. 3. ([`3.getPresentationList.js`](./3.getPresentationList.js)).This example returns all the presentations issued by a certain subject. To do this, in the getSubjectPresentationList call, it is necessary to pass the DID of the subject you want to know about. 4. ([`4.updateEntity2Presentation.js`](./4.updateEntity2Presentation.js)). In this case, this example is executed when the receiver, receives the presentation sent to it by the subject. When this happens, the entity updates the status of this presentation to 1,which means received. This example if everything went well should have the following result `{exist: true, status: '1'}` -5. ([`5.getEntity2PresentationStatus.js`](./6.getEntity2PresentationStatus.js)). In this example, what it does is ask the blockchain what the status of a certain presentation is for the entity in this case. To do this it is necessary to pass the PSMHash of the presentation for the entity and the did of the entity. -6. ([`6.updateSubject1Presentation.js`](./4.updateSubject1Presentation.js)). This example is executed by the subject when they want the data contained in the presentation to no longer be used by that entity. To do this, the entity updates the status that is saved in the blockchain to 2, that means AskDeletion, so that later the entity updates the status to 3, DeletionConfirmation with the objective of not using those credentials that are inside the presentation. +5. ([`5.getEntity2PresentationStatus.js`](./5.getEntity2PresentationStatus.js)). In this example, what it does is ask the blockchain what the status of a certain presentation is for the entity in this case. To do this it is necessary to pass the PSMHash of the presentation for the entity and the did of the entity. +6. ([`6.updateSubject1Presentation.js`](./6.updateSubject1Presentation.js)). This example is executed by the subject when they want the data contained in the presentation to no longer be used by that entity. To do this, the entity updates the status that is saved in the blockchain to 2, that means AskDeletion, so that later the entity updates the status to 3, DeletionConfirmation with the objective of not using those credentials that are inside the presentation. 7. ([`7.getPresentationStatus.js`](./7.getPresentationStatus.js)). This example returns the most advanced status, i.e. if the subject has been issued teh presentation, it will be in status 0, while if the entity receiving the presentation has received it, it will update its status to 1. If at that moment the function getPresentationStatus is asked, it will return 1 since it's the most advanced status. \ No newline at end of file From 8295f21a8c95f8fc266507e53ac8c21f0bdf560f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Nieves=20S=C3=A1nchez?= Date: Wed, 19 Aug 2020 12:14:45 +0200 Subject: [PATCH 4/4] fixed some expressions and typos --- examplePresentations/README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/examplePresentations/README.md b/examplePresentations/README.md index e3fe9fd..80886a5 100644 --- a/examplePresentations/README.md +++ b/examplePresentations/README.md @@ -1,15 +1,15 @@ # Important -First of all, when you run examples _**2.getSubjectPresentationStatus.js**_, _**5.getEntity2PresentationStatus.js**_ and _**7.getPresentationStatus.js**_ and the result is `{exist:false, status: '0'}` the examples have not gone well. Probably because the DID of the subject or entity has been crushed and therefore it is necessary to re-run the examples located in the folder exampleCreateAlastriaID. +First of all, when you run examples _**2.getSubjectPresentationStatus.js**_, _**5.getEntity2PresentationStatus.js**_ and _**7.getPresentationStatus.js**_ and the result is `{exist:false, status: '0'}` means that the example did not work properly. Probably because the DID of the subject or entity has been overwritten and therefore it is necessary to run the examples located in the folder _exampleCreateAlastriaID_ again. -On the other hand, when example _**1.createPresentations.js**_ is executed, the PSMHash of the entity is also created, but there is no traceability in the blockchain, for that you have to execute example _**4.updateEntity2Presentation.js.**_ +On the other hand, when the example _**1.createPresentations.js**_ is executed, the PSMHash of the entity is also created, but there is no traceability in the blockchain, for that you have to execute example _**4.updateEntity2Presentation.js**_. -The last thing that is important to know is the order of execution of the examples, for this, each one of the examples has been ordered in the correct order of execution, which is the following. +The last thing that is important to know is the order of execution of the examples, for this, each one of the examples has been ordered in the "proper" order of execution, which is the following. -1. ([`1.createPresentations.js`](./1.createPresentations.js)). This example creates the presentation with the help of the token library, the PSMHashes of both the subject and the entity are created and finally the addSubjectPresentation transaction is created and then sent to the blockchain by the subject. This example if everything went well should have the following result `{exist: true, status: '0'}` -2. ([`2.getSubjectPresentationStatus.js`](./2.getSubjectPresentationStatus.js)). In this example, what it does is ask the blockchain what the status of a certain presentation is for the subject in this case. To do this it is necessary to pass the PSMHash of the presentation for the subject and the did of the subject. -3. ([`3.getPresentationList.js`](./3.getPresentationList.js)).This example returns all the presentations issued by a certain subject. To do this, in the getSubjectPresentationList call, it is necessary to pass the DID of the subject you want to know about. -4. ([`4.updateEntity2Presentation.js`](./4.updateEntity2Presentation.js)). In this case, this example is executed when the receiver, receives the presentation sent to it by the subject. When this happens, the entity updates the status of this presentation to 1,which means received. This example if everything went well should have the following result `{exist: true, status: '1'}` -5. ([`5.getEntity2PresentationStatus.js`](./5.getEntity2PresentationStatus.js)). In this example, what it does is ask the blockchain what the status of a certain presentation is for the entity in this case. To do this it is necessary to pass the PSMHash of the presentation for the entity and the did of the entity. -6. ([`6.updateSubject1Presentation.js`](./6.updateSubject1Presentation.js)). This example is executed by the subject when they want the data contained in the presentation to no longer be used by that entity. To do this, the entity updates the status that is saved in the blockchain to 2, that means AskDeletion, so that later the entity updates the status to 3, DeletionConfirmation with the objective of not using those credentials that are inside the presentation. -7. ([`7.getPresentationStatus.js`](./7.getPresentationStatus.js)). This example returns the most advanced status, i.e. if the subject has been issued teh presentation, it will be in status 0, while if the entity receiving the presentation has received it, it will update its status to 1. If at that moment the function getPresentationStatus is asked, it will return 1 since it's the most advanced status. \ No newline at end of file +1. ([`1.createPresentations.js`](./1.createPresentations.js)). This example creates the presentation with the help of the token library, the PSMHashes of both the subject and the entity are created and finally the addSubjectPresentation transaction is created and then sent to the blockchain by the subject. +2. ([`2.getSubjectPresentationStatus.js`](./2.getSubjectPresentationStatus.js)). What this example does is ask the blockchain what the status of a certain presentation is for the subject in this case. It will check the presentation created in the previous example. If everything went well should have the following result `{exist: true, status: '0'}`. +3. ([`3.getPresentationList.js`](./3.getPresentationList.js)).This example returns all the presentations issued by a certain subject. +4. ([`4.updateEntity2Presentation.js`](./4.updateEntity2Presentation.js)). In this case, this example is executed when the receiver receives the presentation. The entity updates the status of this presentation to _1_, which means the presentation was received. If everything went well should have the following result `{exist: true, status: '1'}`. +5. ([`5.getEntity2PresentationStatus.js`](./5.getEntity2PresentationStatus.js)). What this example does is ask the blockchain what the status of a certain presentation is for the entity in this case. +6. ([`6.updateSubject1Presentation.js`](./6.updateSubject1Presentation.js)). This example is executed by the subject when they want the data contained in the presentation to no longer be used by that entity. To do this, the subject updates the status that is saved in the blockchain to 2, that means _AskDeletion_, so then, the entity should update the status of the presentation to 3, _DeletionConfirmation_. It can be done with the example number 4 ([`4.updateEntity2Presentation.js`](./4.updateEntity2Presentation.js)), but changing the status to _3_ instead of _1_. +7. ([`7.getPresentationStatus.js`](./7.getPresentationStatus.js)). This example returns the general status of the presentation, i.e. if the subject has issued the presentation (status _0_), while the entity has marked the presentation as received (status _1_), then, this example will return the most advanced state, in this case, the value _1_, _Received_. \ No newline at end of file