0

I am working with hyperledger iroha for a supply chain management project. So, I started with this guide : [https://iroha.readthedocs.io/en/develop/getting_started/index.html] in which a sample iroha network is created with three roles admin, user & money_creator.

Now, I am trying to add more roles to the network. So, I made changes to the genesis.block.

genesis.block file

{
   "block_v1":{
     "payload":{
        "transactions":[
           {
              "payload":{
                 "reducedPayload":{
                    "commands":[
                       {
                          "addPeer":{
                             "peer":{
                                "address":"127.0.0.1:10001",
                                "peerKey":"bddd58404d1315e0eb27902c5d7c8eb0602c16238f005773df406bc191308929"
                             }
                          }
                       },
                       {
                          "createRole":{
                             "roleName":"admin",
                             "permissions":[
                                "can_add_peer",
                                "can_add_signatory",
                                "can_create_account",
                                "can_create_domain",
                                "can_get_all_acc_ast",
                                "can_get_all_acc_ast_txs",
                                "can_get_all_acc_detail",
                                "can_get_all_acc_txs",
                                "can_get_all_accounts",
                                "can_get_all_signatories",
                                "can_get_all_txs",
                                "can_get_blocks",
                                "can_get_roles",
                                "can_read_assets",
                                "can_remove_signatory",
                                "can_set_quorum",
                                "can_create_role"
                             ]
                          }
                       },
                       {
                          "createRole":{
                             "roleName":"farmer",
                             "permissions":[
                                "can_add_signatory",
                                "can_get_my_acc_detail",
                                "can_get_my_acc_txs",
                                "can_get_my_account",
                                "can_get_my_signatories",
                                "can_grant_can_transfer_my_assets",
                                "can_receive",
                                "can_transfer"
                             ]
                          }
                       },
                       {
                          "createRole":{
                             "roleName":"logistics",
                             "permissions":[
                                "can_add_signatory",
                                "can_get_my_acc_detail",
                                "can_get_my_acc_txs",
                                "can_get_my_account",
                                "can_get_my_signatories",
                                "can_grant_can_transfer_my_assets",
                                "can_receive",
                                "can_transfer"
                             ]
                          }
                       },
                       {
                          "createRole":{
                             "roleName":"warehouse",
                             "permissions":[
                                "can_add_signatory",
                                "can_get_my_acc_detail",
                                "can_get_my_acc_txs",
                                "can_get_my_account",
                                "can_get_my_signatories",
                                "can_grant_can_transfer_my_assets",
                                "can_receive",
                                "can_transfer"
                             ]
                          }
                       },
                       {
                          "createRole":{
                             "roleName":"buyer",
                             "permissions":[
                                "can_add_signatory",
                                "can_get_my_acc_detail",
                                "can_get_my_acc_txs",
                                "can_get_my_account",
                                "can_get_my_signatories",
                                "can_grant_can_transfer_my_assets",
                                "can_receive",
                                "can_transfer"
                             ]
                          }
                       },
                       {
                          "createDomain":{
                             "domainId":"test",
                             "defaultRole":"user"
                          }
                       },
                       {
                          "createAsset":{
                             "assetName":"coin",
                             "domainId":"test",
                             "precision":2
                          }
                       },
                       {
                          "createAccount":{
                             "accountName":"admin",
                             "domainId":"test",
                         "publicKey":"313a07e6384776ed95447710d15e59148473ccfc052a681317a72a69f2a49910"
                          }
                       },
                       {
                          "createAccount":{
                             "accountName":"test",
                             "domainId":"test",
                             "publicKey":"716fe505f69f18511a1b083915aa9ff73ef36e6688199f3959750db38b8f4bfc"
                          }
                       },
                       {
                          "appendRole":{
                             "accountId":"admin@test",
                             "roleName":"admin"
                          }
                       },
                       {
                          "appendRole":{
                             "accountId":"admin@test",
                             "roleName":"money_creator"
                          }
                       }
                    ],
                    "quorum":1
                 }
              }
           }
        ],
        "txNumber":1,
        "height":"1",
        "prevBlockHash":"0000000000000000000000000000000000000000000000000000000000000000"
     }
   }
}

But, these changes are not getting reflected in the network. I just made changes to the file & saved it. And started the containers again and queried the network. But, it still shows only 3 roles.

The output of all the roles in the network

How to make these changes get reflected in the iroha network? I believe that changes made to the genesis block will effect the network. But, there should be something done to make the changes reflected in the network. Can someone please help me find a way out to see the changes made to the genesis block in the actual network?

goldie
  • 1
  • I had to delete the blockstore everytime i make changes to the genesis block. Is there anyother way to reflect the changes in the network? – goldie Mar 14 '23 at 12:26

0 Answers0