Skip to content

Issuer examples

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

1.addEntity

Output

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

The transaction bytes data is:  0xf90288820a7d80830927c094bd4a2c84edb97be5beff7cd341bd63567e73f8c980b90224c4c023330000000000000000000000003342664027077aea360fa3fc762a17bacbd4569800000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000001e000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000008456e746964616433000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a412d34393933343538310000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000157777772e656e7469646164332e636f6d2f6c6f676f000000000000000000000000000000000000000000000000000000000000000000000000000000000000147777772e656e7469646164332e636f6d2f41494400000000000000000000000000000000000000000000000000000000000000000000000000000000000000147777772e656e7469646164332e636f6d2f414f410000000000000000000000001ba09d6e7290b96dfea7db622070ce0360d113c049205ee5c4ded4bd15ad095d26c0a07d46b041656b8364d76ccde3e425529295f5c1d791587b8f423091281c8ff666
HASH:  0x50975166da444d05a9cef6593ffb58bb52f0f4a7c980c584cff9ea8153a83a39
Account unlocked: true
RECEIPT:  { blockHash:
   '0x2fb7459c83ba650477a049ae7970e4da5418598d130102b17336984284ddf916',
  blockNumber: 40131426,
  contractAddress: null,
  cumulativeGasUsed: 182579,
  from: '0xa9728125c573924b2b1ad6a8a8cd9bf6858ced49',
  gasUsed: 182579,
  logs: [],
  logsBloom:
   '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
  status: true,
  to: '0xbd4a2c84edb97be5beff7cd341bd63567e73f8c9',
  transactionHash:
   '0x50975166da444d05a9cef6593ffb58bb52f0f4a7c980c584cff9ea8153a83a39',
  transactionIndex: 0 }

2.addIdentityIssuer

Output

------ Example of adding  the entity3 like Issuer ------

The transaction bytes data is:  0xf8a7820a7e80830927c094bd4a2c84edb97be5beff7cd341bd63567e73f8c980b844889776a80000000000000000000000003342664027077aea360fa3fc762a17bacbd4569800000000000000000000000000000000000000000000000000000000000000021ba03fa079b392f47503757f756086b612427d54b7dee7dfcc69207f2c20ae4ef0eba0676d2c6a399f5b61909b2dcf7bba70992699959826e4a164e46643ebc569d3da
HASH:  0x1b15e49f00d97f2941f0df1b46ee8b54392fb759891875f9beaddd13bb657c71
Account unlocked: true
RECEIPT:  { blockHash:
   '0x28e8edb4de98c1ad334bb0f321cf4aa1fe07d5070d7d7011903453cba4a044cf',
  blockNumber: 40131438,
  contractAddress: null,
  cumulativeGasUsed: 52073,
  from: '0xa9728125c573924b2b1ad6a8a8cd9bf6858ced49',
  gasUsed: 52073,
  logs: [],
  logsBloom:
   '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
  status: true,
  to: '0xbd4a2c84edb97be5beff7cd341bd63567e73f8c9',
  transactionHash:
   '0x1b15e49f00d97f2941f0df1b46ee8b54392fb759891875f9beaddd13bb657c71',
  transactionIndex: 0 }

3.deleteIdentityIssuer

Case where 1.addEntity and 2.addIdentityIssuer were executed

Output

------ Example of deleting entity3 like Issuer ------

transaction { to: '0xbd4a2c84edb97be5beff7cd341bd63567e73f8c9',
  data:
   '0xcb6915990000000000000000000000003342664027077aea360fa3fc762a17bacbd45698',
  gasLimit: 600000,
  gasPrice: 0,
  nonce: '0x0' }
The transaction bytes data is:  0xf886820a7f80830927c094bd4a2c84edb97be5beff7cd341bd63567e73f8c980a4cb6915990000000000000000000000003342664027077aea360fa3fc762a17bacbd456981ca05d9d9dc4709ebce62d6c275223824e97b584435c3afdef4691afa6af595e2adaa06d62251e8abca1b54782d151b66812e54cf042f930329a65ba46f6c3ff489e18
HASH:  0x2ce0578505f36b10980e9dead54d127616a3816e8c2cdbce2938b5f8a045fccc
Account unlocked: true
RECEIPT:  { blockHash:
   '0xf5c804901dcd257accaaac2a4f0f5cb5a8d4eeb5e7b4b4b6fd977c4ceb34f5ac',
  blockNumber: 40131516,
  contractAddress: null,
  cumulativeGasUsed: 14618,
  from: '0xa9728125c573924b2b1ad6a8a8cd9bf6858ced49',
  gasUsed: 14618,
  logs: [],
  logsBloom:
   '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
  status: true,
  to: '0xbd4a2c84edb97be5beff7cd341bd63567e73f8c9',
  transactionHash:
   '0x2ce0578505f36b10980e9dead54d127616a3816e8c2cdbce2938b5f8a045fccc',
  transactionIndex: 0 }

Case where 1.addEntity and 2.addIdentityIssuer were not executed or 3.deleteIdentityIssuer was already executed successfully

Output

------ Example of deleting entity3 like Issuer ------

transaction { to: '0xbd4a2c84edb97be5beff7cd341bd63567e73f8c9',
  data:
   '0xcb6915990000000000000000000000003342664027077aea360fa3fc762a17bacbd45698',
  gasLimit: 600000,
  gasPrice: 0,
  nonce: '0x0' }
The transaction bytes data is:  0xf886820a8080830927c094bd4a2c84edb97be5beff7cd341bd63567e73f8c980a4cb6915990000000000000000000000003342664027077aea360fa3fc762a17bacbd456981ca01d7936d37e063cb248941604144ac55fdb70b8cd2aad112c6c622fe412e31742a06ee8bc7f7e9fbed3db1caa8d27ec986113585ff775ae50ecbeb0186059c76d3d
HASH:  0x96e167770fb7e87d78d61284afa08deee2d96d586de5ca62881fa4bddd5dd0b5
Account unlocked: true
Error: Transaction has been reverted by the EVM:
{
  "blockHash": "0x51d9af666aba7c9d8bc7da5326a92b3706a7ba286948594f761fcea586108e51",
  "blockNumber": 40131552,
  "contractAddress": null,
  "cumulativeGasUsed": 23868,
  "from": "0xa9728125c573924b2b1ad6a8a8cd9bf6858ced49",
  "gasUsed": 23868,
  "logs": [],
  "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
  "status": false,
  "to": "0xbd4a2c84edb97be5beff7cd341bd63567e73f8c9",
  "transactionHash": "0x96e167770fb7e87d78d61284afa08deee2d96d586de5ca62881fa4bddd5dd0b5",
  "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)

4.isIdentityIssuer

Case where 1.addEntity and 2.addIdentityIssuer were executed

Output

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

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

Case where 1.addEntity and 2.addIdentityIssuer were not executed or 3.deleteIdentityIssuer was already executed successfully

Output

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

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