alastria / alastria-identity-example

An example of using alastria-identity-lib
MIT License
5 stars 8 forks source link

Run exampleCreateAlastriaID with all transactions reverted #145

Closed dev-andreavendrame closed 1 year ago

dev-andreavendrame commented 1 year ago

Hi! We have tried to run some demo scripts of the alastria-identity-example repo and we have encountered some errors. The authentication scripts works (exampleAuthentication/1.authentication.js), but every other script gives a transaction error, for example the one that you see in the screenshot below:

Example 1

Schermata 2022-12-09 alle 16 41 13

This is related to the creation of exampleCreateAlastriaID folder. As you can see the transaction is reverted and we cannot understand why. The same happens with the other scripts in this folder.

Can you help with this please?

Below the results from running the other provided examples.

Example 2

Schermata 2022-12-09 alle 16 42 28

Example 3

Schermata 2022-12-09 alle 16 43 00

Example 4

Schermata 2022-12-09 alle 16 43 39
rober12 commented 1 year ago

Good afternoon,

You have to run the examples in the FirstEntity(https://github.com/alastria/alastria-identity-example/tree/master/exampleFirstEntity) folder first in the order listed. Once you run the ones in that folder, the examples you are trying to test will work correctly.

However, to avoid future problems, I advise you to create your own keystores and include them in the keystores folder, so that only you can use them in your tests, as the keystores in the folder are public and are used by everybody, so it is possible that someone else runs them behind you and you may encounter problems when running examples.

Best regards.

dev-andreavendrame commented 1 year ago

Good morning,

thanks for the suggestion, I'll create my own keystore, but can it be possible to receive Alastria creadentials in order to have an account and try everything that we need? Btw, I've run the examples in the exampleFirstEntity from 1 to 8 and then I've run the examples in the exampleCreateAlastriaID folder. It is correct that some errors are raised while running the second folder examples?

Thanks in advance.

rober12 commented 1 year ago

Good afternoon,

The examples that you have to execute from the folder exampleFirstEntity are from 1 to 4 and if you want to check that everything is correct up to that point 7 and 8, but if you execute 5 and 6 what you are doing is eliminating that entity from the issuer role and the service provider role, so it is normal that examples from the folder exampleCreateAlastriaID fail because if the entity is not issuer it does not have the power to issue credentials.

Best regards

rober12 commented 1 year ago

Good morning @dev-andreavendrame,

Has this issue been solved?

Greetings and thanks in advance.

dev-andreavendrame commented 1 year ago

Good afternoon @rober12 . The library doesn't work again. The authentication works, but everything related to the blockchain (even if data are mockups) doesn't work.

This is the error that I got trying to execute the "1.createEntityAlastriaID.js " file, the first to run in order to get the right response.

`andrea@iMac-di-Andrea exampleFirstEntity % node 1.createEntityAlastriaID.js

------ Example of prepare Alastria ID, addKey and createAlastrisID necessary to have an Alastria ID ------

------ A promise all where prepareAlastriaID and createAlsatriaID transactions are signed and sent ------

Error: Invalid JSON RPC response: "\r\n502 Bad Gateway\r\n<body bgcolor=\"white\">\r\n

502 Bad Gateway

\r\n
nginx/1.10.3 (Ubuntu)
\r\n\r\n\r\n" at Object.InvalidResponse (/Users/andrea/Desktop/Alastria2/alastria-identity-example/node_modules/web3-core-helpers/lib/errors.js:43:16) at XMLHttpRequest.request.onreadystatechange (/Users/andrea/Desktop/Alastria2/alastria-identity-example/node_modules/web3-providers-http/lib/index.js:95:32) at XMLHttpRequestEventTarget.dispatchEvent (/Users/andrea/Desktop/Alastria2/alastria-identity-example/node_modules/xhr2-cookies/dist/xml-http-request-event-target.js:34:22) at XMLHttpRequest._setReadyState (/Users/andrea/Desktop/Alastria2/alastria-identity-example/node_modules/xhr2-cookies/dist/xml-http-request.js:208:14) at XMLHttpRequest._onHttpResponseEnd (/Users/andrea/Desktop/Alastria2/alastria-identity-example/node_modules/xhr2-cookies/dist/xml-http-request.js:318:14) at IncomingMessage. (/Users/andrea/Desktop/Alastria2/alastria-identity-example/node_modules/xhr2-cookies/dist/xml-http-request.js:289:61) at IncomingMessage.emit (node:events:539:35) at endReadableNT (node:internal/streams/readable:1345:12) at processTicksAndRejections (node:internal/process/task_queues:83:21) node:internal/process/promises:279 triggerUncaughtException(err, true / fromPromise /); ^

Error: Invalid JSON RPC response: "\r\n502 Bad Gateway\r\n<body bgcolor=\"white\">\r\n

502 Bad Gateway

\r\n
nginx/1.10.3 (Ubuntu)
\r\n\r\n\r\n" at Object.InvalidResponse (/Users/andrea/Desktop/Alastria2/alastria-identity-example/node_modules/web3-core-helpers/lib/errors.js:43:16) at XMLHttpRequest.request.onreadystatechange (/Users/andrea/Desktop/Alastria2/alastria-identity-example/node_modules/web3-providers-http/lib/index.js:95:32) at XMLHttpRequestEventTarget.dispatchEvent (/Users/andrea/Desktop/Alastria2/alastria-identity-example/node_modules/xhr2-cookies/dist/xml-http-request-event-target.js:34:22) at XMLHttpRequest._setReadyState (/Users/andrea/Desktop/Alastria2/alastria-identity-example/node_modules/xhr2-cookies/dist/xml-http-request.js:208:14) at XMLHttpRequest._onHttpResponseEnd (/Users/andrea/Desktop/Alastria2/alastria-identity-example/node_modules/xhr2-cookies/dist/xml-http-request.js:318:14) at IncomingMessage. (/Users/andrea/Desktop/Alastria2/alastria-identity-example/node_modules/xhr2-cookies/dist/xml-http-request.js:289:61) at IncomingMessage.emit (node:events:539:35) at endReadableNT (node:internal/streams/readable:1345:12) at processTicksAndRejections (node:internal/process/task_queues:83:21) andrea@iMac-di-Andrea exampleFirstEntity % `

Is there any problem with your server? Thanks in advance,

Andrea.

P.S. Last time for a while the calls worked, but now the same problem again.

rober12 commented 1 year ago

Good afternoon @dev-andreavendrame ,

The error you are getting is due to a problem with the node, i mean, all the errors related to "Invalid JSON RPC response" are node or blockchain network errors. In this case, the node it seems to be down.

I deduce that you are using the identity node (the one inside the configuration.json) to execute the examples. If so, I would like to inform you that we are having a series of problems with the node in terms of the size of the machine, but we are already moving internally to solve this issue.

Best regards and sorry for the inconvenience.

dev-andreavendrame commented 1 year ago

Thank you for your response @rober12 . I've supposed that there was a server problem, so I'll wait for the problem to be solved.

Best regards,

Andrea.

rober12 commented 1 year ago

Good morning @dev-andreavendrame

We are already working to solve the node issue. Between this week and next week we believe that the identity node will be operational again.

If you think we close this issue, and if you still have problems when the node will be operational again, you can open another one with the problem you have.

Best regards.

dev-andreavendrame commented 1 year ago

Ok @rober12. Thanks for your reply. Best regards,

Andrea.