Skip to content

First Entity examples

Daniel Luque Quintana edited this page May 23, 2020 · 3 revisions

1.entitiesList

Output

------ 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 ------

HASH:  0x682e4cb0e9b068cc45976d3081c40f59527ac28982d8f182c82d0c4ae4a7023b
RECEIPT:  { blockHash:
   '0x29bec7eaf74ee5e7f7dcb5d71b8d52139eabfd9cd53fdb7e4925863aa28b005b',
  blockNumber: 40134000,
  contractAddress: null,
  cumulativeGasUsed: 45099,
  from: '0x6e3976aeaa3a59e4af51783cc46ee0ffabc5dc11',
  gasUsed: 45099,
  logs:
   [ { address: '0xBd4a2C84EDB97bE5BEfF7CD341bd63567e73f8C9',
       topics: [Array],
       data: '0x',
       blockNumber: 40134000,
       transactionHash:
        '0x682e4cb0e9b068cc45976d3081c40f59527ac28982d8f182c82d0c4ae4a7023b',
       transactionIndex: 0,
       blockHash:
        '0x29bec7eaf74ee5e7f7dcb5d71b8d52139eabfd9cd53fdb7e4925863aa28b005b',
       logIndex: 0,
       removed: false,
       id: 'log_f3eca1aa' } ],
  logsBloom:
   '0x00000000000000000000000000000000000000000000040000000000000000000000000000000000000002000000000010000000000000000000000000000000000000000000200000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000010000000000400000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000',
  status: true,
  to: '0xbd4a2c84edb97be5beff7cd341bd63567e73f8c9',
  transactionHash:
   '0x682e4cb0e9b068cc45976d3081c40f59527ac28982d8f182c82d0c4ae4a7023b',
  transactionIndex: 0 }
HASH:  0xcd2873f231840788ca4f97a1ec80e5087302a5e218056ef09bdacc0e9cf9ebd1
RECEIPT:  { blockHash:
   '0xfde34ccac9e98f0609a9b8c5644bc354b75f3aa01f7a560120b4f3bbd3ac1849',
  blockNumber: 40134003,
  contractAddress: null,
  cumulativeGasUsed: 454654,
  from: '0xa9728125c573924b2b1ad6a8a8cd9bf6858ced49',
  gasUsed: 454654,
  logs:
   [ { address: '0xd2CB24B06139c91Ef6b324a49Ef844bbe6Ccec97',
       topics: [Array],
       data:
        '0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c450382c1a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000080333536653366636534333564383732393036326535326432363363306337303562336335653230316139613936303863646230373037363465366238646633306165383432336234333961376166326263633335323937373833343161623036633165343434313133353266323137623638636534346136373361316466363300000000000000000000000000000000000000000000000000000000',
       blockNumber: 40134003,
       transactionHash:
        '0xcd2873f231840788ca4f97a1ec80e5087302a5e218056ef09bdacc0e9cf9ebd1',
       transactionIndex: 0,
       blockHash:
        '0xfde34ccac9e98f0609a9b8c5644bc354b75f3aa01f7a560120b4f3bbd3ac1849',
       logIndex: 0,
       removed: false,
       id: 'log_f4474607' } ],
  logsBloom:
   '0x00000000040000000000000000000000000000000000000010000000000000000000000000000000000000000000000100000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000001000000000000008000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
  status: true,
  to: '0xbd4a2c84edb97be5beff7cd341bd63567e73f8c9',
  transactionHash:
   '0xcd2873f231840788ca4f97a1ec80e5087302a5e218056ef09bdacc0e9cf9ebd1',
  transactionIndex: 0 }
alastriaProxyAddress: 0xd2cb24b06139c91ef6b324a49ef844bbe6ccec97
the alastria DID is: did:ala:quor:redT:d2cb24b06139c91ef6b324a49ef844bbe6ccec97

2.addEntity

Output

------ Example of adding the entity1 like a Entity ------

The transaction bytes data is:  0xf9028882052180830927c094bd4a2c84edb97be5beff7cd341bd63567e73f8c980b90224c4c02333000000000000000000000000d2cb24b06139c91ef6b324a49ef844bbe6ccec9700000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000001e000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000008456e746964616431000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a412d32383936343738320000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000157777772e656e7469646164312e636f6d2f6c6f676f000000000000000000000000000000000000000000000000000000000000000000000000000000000000147777772e656e7469646164312e636f6d2f41494400000000000000000000000000000000000000000000000000000000000000000000000000000000000000147777772e656e7469646164312e636f6d2f414f410000000000000000000000001ba0e276296697f49da503911f5c9943e0321b095a18aa298a0af43b96b852363adda00eac8f4d7d7b613eb01e2604475e1429e0d76df7433d8cda4a2971b80aee34ca
HASH:  0xe7081d2864fc84e621074f01f9214c7de307a97c7e76c51ba01da7b9b77cdc20
Account unlocked: true
RECEIPT:  { blockHash:
   '0x072b7c9eb3c7d8a49e2d83fedbca482033677ac39c311f382c54f0d547d7260d',
  blockNumber: 40134019,
  contractAddress: null,
  cumulativeGasUsed: 182579,
  from: '0x6e3976aeaa3a59e4af51783cc46ee0ffabc5dc11',
  gasUsed: 182579,
  logs: [],
  logsBloom:
   '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
  status: true,
  to: '0xbd4a2c84edb97be5beff7cd341bd63567e73f8c9',
  transactionHash:
   '0xe7081d2864fc84e621074f01f9214c7de307a97c7e76c51ba01da7b9b77cdc20',
  transactionIndex: 0 }

3.addIdentityIssuer

Output

------ Example of adding the entity1 like a Issuer ------

The transaction bytes data is:  0xf8a782052280830927c094bd4a2c84edb97be5beff7cd341bd63567e73f8c980b844889776a8000000000000000000000000d2cb24b06139c91ef6b324a49ef844bbe6ccec9700000000000000000000000000000000000000000000000000000000000000021ba05a392ee9db17ff24ef70560082be8b7ce182b298b28842aad7c914d0b246f2f6a06cfd3620845210e10d471deb914ff5244b6d7244d4217f3de9728478f0b873c9
HASH:  0x69af32f606c75ae819f157bd9c834a5f89bc13ea881d48992b49b9e1b101d5ce
Account unlocked: true
RECEIPT:  { blockHash:
   '0x5c2472899491ca81a21c374b28ada414cb1d34787906e2a0ae841ec8214ed1cc',
  blockNumber: 40134030,
  contractAddress: null,
  cumulativeGasUsed: 52073,
  from: '0x6e3976aeaa3a59e4af51783cc46ee0ffabc5dc11',
  gasUsed: 52073,
  logs: [],
  logsBloom:
   '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
  status: true,
  to: '0xbd4a2c84edb97be5beff7cd341bd63567e73f8c9',
  transactionHash:
   '0x69af32f606c75ae819f157bd9c834a5f89bc13ea881d48992b49b9e1b101d5ce',
  transactionIndex: 0 }

4.addIdentityServiceProvider

Output

------ Example of adding the entity1 like a Service Provider ------

The transaction bytes data is:  0xf88682052380830927c094bd4a2c84edb97be5beff7cd341bd63567e73f8c980a40ebbbffc000000000000000000000000d2cb24b06139c91ef6b324a49ef844bbe6ccec971ba0db079db9237a5a3206c786a81f9124fa9058b294f6579ae7410ad0bbc8377c20a0518c8063cc46c0f3be7db0499f904add744456977f1111cf55f5390c8e21d432
HASH:  0x97feb3c270b5d041f437b9a06d853776d6411ac34ba90ca212d0d42079aa3813
Account unlocked: true
RECEIPT:  { blockHash:
   '0x5a565c8cb6a6965de2c72256b55e94b1ed831e03c2ad3091bd0ee4a666fb4ff4',
  blockNumber: 40134048,
  contractAddress: null,
  cumulativeGasUsed: 44178,
  from: '0x6e3976aeaa3a59e4af51783cc46ee0ffabc5dc11',
  gasUsed: 44178,
  logs: [],
  logsBloom:
   '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
  status: true,
  to: '0xbd4a2c84edb97be5beff7cd341bd63567e73f8c9',
  transactionHash:
   '0x97feb3c270b5d041f437b9a06d853776d6411ac34ba90ca212d0d42079aa3813',
  transactionIndex: 0 }

5.deleteIdentityIssuer

Case where 3.addIdentityIssuer have already been executed

Output

------ Example of deleting the entity1 like Issuer ------

transaction { to: '0xbd4a2c84edb97be5beff7cd341bd63567e73f8c9',
  data:
   '0xcb691599000000000000000000000000d2cb24b06139c91ef6b324a49ef844bbe6ccec97',
  gasLimit: 600000,
  gasPrice: 0,
  nonce: '0x0' }
The transaction bytes data is:  0xf88682052480830927c094bd4a2c84edb97be5beff7cd341bd63567e73f8c980a4cb691599000000000000000000000000d2cb24b06139c91ef6b324a49ef844bbe6ccec971ba06a157c1d18104b707d5990506cdb857f165e9e84f78be4d9d2f076dde4c4ad4ea024da2361e6611dfd4746ff82cb0f33766aa578e28e5ccb11c5e4f4af69ccddbb
HASH:  0x9c2435a76327b7eabfbf903035a600dbe8f81e1a7eacba389ae0b0356a675cb3
Account unlocked: true
RECEIPT:  { blockHash:
   '0x8d2698a49a84ced4d18ff8d0e7e417569db361949176167955a1d3148c3d9c49',
  blockNumber: 40134179,
  contractAddress: null,
  cumulativeGasUsed: 14618,
  from: '0x6e3976aeaa3a59e4af51783cc46ee0ffabc5dc11',
  gasUsed: 14618,
  logs: [],
  logsBloom:
   '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
  status: true,
  to: '0xbd4a2c84edb97be5beff7cd341bd63567e73f8c9',
  transactionHash:
   '0x9c2435a76327b7eabfbf903035a600dbe8f81e1a7eacba389ae0b0356a675cb3',
  transactionIndex: 0 }

Case where 3.addIdentityIssuer.js hasn't yet been executed

Output

------ Example of deleting the entity1 like Issuer ------

transaction { to: '0xbd4a2c84edb97be5beff7cd341bd63567e73f8c9',
  data:
   '0xcb691599000000000000000000000000d2cb24b06139c91ef6b324a49ef844bbe6ccec97',
  gasLimit: 600000,
  gasPrice: 0,
  nonce: '0x0' }
The transaction bytes data is:  0xf88682052580830927c094bd4a2c84edb97be5beff7cd341bd63567e73f8c980a4cb691599000000000000000000000000d2cb24b06139c91ef6b324a49ef844bbe6ccec971ba04b4b77fe8260e4180ea574311abbadbdfd14312c68d814a52d31f0498c69ee9fa017dd9b2b170bda1c4b539e50604dc05b34aed4168abaa1b8bdbe28a369c61c39
HASH:  0xde8f22f0aa259cba83f76fa9e16f21060bd6e56ef9141fa7538d084c23e9a2b9
Account unlocked: true
Error: Transaction has been reverted by the EVM:
{
  "blockHash": "0x0b4657f4d67d45734c9eeaca391b0f04bb96480bbd42ddefc53e009ff52b7c00",
  "blockNumber": 40134222,
  "contractAddress": null,
  "cumulativeGasUsed": 23868,
  "from": "0x6e3976aeaa3a59e4af51783cc46ee0ffabc5dc11",
  "gasUsed": 23868,
  "logs": [],
  "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
  "status": false,
  "to": "0xbd4a2c84edb97be5beff7cd341bd63567e73f8c9",
  "transactionHash": "0xde8f22f0aa259cba83f76fa9e16f21060bd6e56ef9141fa7538d084c23e9a2b9",
  "transactionIndex": 0
}
    at /Users/danielluquequintana/Github/alastria-identity-example/node_modules/web3-core-method/src/index.js:364:46
    at process._tickCallback (internal/process/next_tick.js:68:7)

6.deleteIdentityServiceProvider

Case where 4.addIdentityServiceProvider have already been executed

Output

------ Example of deleting the entity1 like Service Provider ------

transaction { to: '0xbd4a2c84edb97be5beff7cd341bd63567e73f8c9',
  data:
   '0x3bf47215000000000000000000000000d2cb24b06139c91ef6b324a49ef844bbe6ccec97',
  gasLimit: 600000,
  gasPrice: 0,
  nonce: '0x0' }
The transaction bytes data is:  0xf88682052680830927c094bd4a2c84edb97be5beff7cd341bd63567e73f8c980a43bf47215000000000000000000000000d2cb24b06139c91ef6b324a49ef844bbe6ccec971ca0bd4f4b6da05b8e1289e139142be4ac5739854026c346829518d68a39d4171d3ba0531989fffbbaea4f3727bb334fb1811141a058259dc6c7dba7b91479367d089a
HASH:  0xf5689f07f0fec444c0329a3436019eafa5c81e0b93aa49658303e129596fb886
Account unlocked: true
RECEIPT:  { blockHash:
   '0x825051fa5e88f3de1a2a395bf2911428b04091bedc4392833faa553e4de7d14a',
  blockNumber: 40134234,
  contractAddress: null,
  cumulativeGasUsed: 14654,
  from: '0x6e3976aeaa3a59e4af51783cc46ee0ffabc5dc11',
  gasUsed: 14654,
  logs: [],
  logsBloom:
   '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
  status: true,
  to: '0xbd4a2c84edb97be5beff7cd341bd63567e73f8c9',
  transactionHash:
   '0xf5689f07f0fec444c0329a3436019eafa5c81e0b93aa49658303e129596fb886',
  transactionIndex: 0 }

Case where 4.addIdentityServiceProvider hasn't yet been executed

Output

------ Example of deleting the entity1 like Service Provider ------

transaction { to: '0xbd4a2c84edb97be5beff7cd341bd63567e73f8c9',
  data:
   '0x3bf47215000000000000000000000000d2cb24b06139c91ef6b324a49ef844bbe6ccec97',
  gasLimit: 600000,
  gasPrice: 0,
  nonce: '0x0' }
The transaction bytes data is:  0xf88682052780830927c094bd4a2c84edb97be5beff7cd341bd63567e73f8c980a43bf47215000000000000000000000000d2cb24b06139c91ef6b324a49ef844bbe6ccec971ca01c8fdd4c5c0b3cba0ff05e2e957eb0b48a044f3be877778bb4308100557d9cb7a038e7ea4941c022b28d21691d56d9888fbf518d5486a7844fb81de72a8c8f7ff0
HASH:  0x64f26d5991a3537d5ddc35335b9a5e546e9e5f60aab08efeac7cae4399369a79
Account unlocked: true
Error: Transaction has been reverted by the EVM:
{
  "blockHash": "0xdce1b9d4208fb07821a26ed0afa6381561abfeab16d7c0067314fc95566a3eaf",
  "blockNumber": 40134279,
  "contractAddress": null,
  "cumulativeGasUsed": 23532,
  "from": "0x6e3976aeaa3a59e4af51783cc46ee0ffabc5dc11",
  "gasUsed": 23532,
  "logs": [],
  "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
  "status": false,
  "to": "0xbd4a2c84edb97be5beff7cd341bd63567e73f8c9",
  "transactionHash": "0x64f26d5991a3537d5ddc35335b9a5e546e9e5f60aab08efeac7cae4399369a79",
  "transactionIndex": 0
}
    at /Users/danielluquequintana/Github/alastria-identity-example/node_modules/web3-core-method/src/index.js:364:46
    at process._tickCallback (internal/process/next_tick.js:68:7)

7.isIdentiyIssuer

Before executing 3.addIdentityIssuer

Output

------ Example of asking for isIdentityIssuer ------

isIssuerTransaction { to: '0xbd4a2c84edb97be5beff7cd341bd63567e73f8c9',
  data:
   '0x6554adf0000000000000000000000000d2cb24b06139c91ef6b324a49ef844bbe6ccec97',
  gasLimit: 600000,
  gasPrice: 0,
  nonce: '0x0' }
isIssuer? -----> false
Account unlocked: true

After executing 3.addIdentityIssuer.js

Output

------ Example of asking for isIdentityIssuer ------

isIssuerTransaction { to: '0xbd4a2c84edb97be5beff7cd341bd63567e73f8c9',
  data:
   '0x6554adf0000000000000000000000000d2cb24b06139c91ef6b324a49ef844bbe6ccec97',
  gasLimit: 600000,
  gasPrice: 0,
  nonce: '0x0' }
isIssuer? -----> true
Account unlocked: true

# 8.isIdentityServiceProvider

Before executing 4.addIdentityServiceProvider

Output

------ Example of asking for isIdentityServiceProvider ------

isServiceProviderTransaction { to: '0xbd4a2c84edb97be5beff7cd341bd63567e73f8c9',
  data:
   '0xd024d9a4000000000000000000000000d2cb24b06139c91ef6b324a49ef844bbe6ccec97',
  gasLimit: 600000,
  gasPrice: 0,
  nonce: '0x0' }
isServiceProvider? -----> false
Account unlocked: true

After executing 4.addIdentityServiceProvider

Output

------ Example of asking for isIdentityServiceProvider ------

isServiceProviderTransaction { to: '0xbd4a2c84edb97be5beff7cd341bd63567e73f8c9',
  data:
   '0xd024d9a4000000000000000000000000d2cb24b06139c91ef6b324a49ef844bbe6ccec97',
  gasLimit: 600000,
  gasPrice: 0,
  nonce: '0x0' }
isServiceProvider? -----> true
Account unlocked: true
Clone this wiki locally