Skip to content
This repository has been archived by the owner on Apr 17, 2019. It is now read-only.

Feature/genesis parser #1775

Merged
merged 6 commits into from
Oct 15, 2018
Merged

Feature/genesis parser #1775

merged 6 commits into from
Oct 15, 2018

Conversation

grimadas
Copy link
Contributor

@grimadas grimadas commented Oct 11, 2018

Description of the Change

This pr adds a genesis parser script. It will generate a nice md file with tables of accounts, permissions etc.

For example:

Domains

Domain id Default Role
notary none
d3 client
btcSession none
ethereum none
bitcoin none

Assets

Asset id Precision:
ether#ethereum 18
btc#bitcoin 8

Roles

Role Name Permissions
notary can_get_all_acc_ast, can_get_all_accounts, can_create_asset, can_add_asset_qty, can_transfer, can_set_detail, can_get_all_txs, can_receive, can_get_blocks, can_read_assets, can_add_signatory, can_set_quorum
relay_deployer can_set_detail
token_service can_set_detail, can_create_asset
registration_service can_create_account, can_set_detail, can_get_all_accounts, can_get_domain_accounts, can_get_all_txs, can_get_blocks, can_set_quorum
client can_get_my_account, can_get_my_acc_ast, can_get_my_acc_ast_txs, can_get_my_acc_txs, can_get_my_txs, can_transfer, can_receive
withdrawal can_get_domain_accounts, can_get_blocks, can_read_assets
vacuumer can_get_domain_accounts, can_read_assets
none
tester can_get_all_accounts, can_get_all_acc_ast, can_add_asset_qty, can_transfer, can_create_asset, can_create_account, can_receive, can_read_assets, can_append_role, can_add_peer, can_set_detail, can_get_blocks, can_get_domain_accounts, can_set_quorum, can_add_signatory, can_create_account, can_get_all_txs, can_get_domain_acc_detail, can_read_assets
whitelist_setter can_set_detail
notary_holder can_set_detail

Accounts

Account id Roles All permissions
test@notary none, tester can_add_asset_qty, can_add_peer, can_add_signatory, can_append_role, can_create_account, can_create_asset, can_get_all_acc_ast, can_get_all_accounts, can_get_all_txs, can_get_blocks, can_get_domain_acc_detail, can_get_domain_accounts, can_read_assets, can_receive, can_set_detail, can_set_quorum, can_transfer
eth_registration_service_red@notary none, registration_service, relay_deployer can_create_account, can_get_all_accounts, can_get_all_txs, can_get_blocks, can_get_domain_accounts, can_set_detail, can_set_quorum
notary_red@notary none, notary can_add_asset_qty, can_add_signatory, can_create_asset, can_get_all_acc_ast, can_get_all_accounts, can_get_all_txs, can_get_blocks, can_read_assets, can_receive, can_set_detail, can_set_quorum, can_transfer
token_storage_service@notary none, token_service can_create_asset, can_set_detail
notaries@notary none, notary_holder can_set_detail
whitelist_setter@notary none, whitelist_setter can_set_detail
user1@notary none
mst_btc_registration_service_red@notary none, registration_service can_create_account, can_get_all_accounts, can_get_all_txs, can_get_blocks, can_get_domain_accounts, can_set_detail, can_set_quorum
vacuumer@notary none, vacuumer can_get_domain_accounts, can_read_assets
pregen_btc_pk_trigger@notary none
btc_registration_service_red@notary none, registration_service can_create_account, can_get_all_accounts, can_get_all_txs, can_get_blocks, can_get_domain_accounts, can_set_detail, can_set_quorum
withdrawal_red@notary none, withdrawal can_get_blocks, can_get_domain_accounts, can_read_assets

Benefits

Such md file can be used in Iroha projects to manage accounts and permissions.

Possible Drawbacks

None

Signed-off-by: grimadas <[email protected]>
Signed-off-by: grimadas <[email protected]>
Signed-off-by: grimadas <[email protected]>
@grimadas grimadas added the needs-review pr awaits review from maintainers label Oct 11, 2018
@@ -0,0 +1,107 @@
import sys

sys.path.insert(0, 'build/shared_model/bindings')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe you can get rid of bindings and use just python's proto files?

because of bindings this script can not be executed anywhere except current dir within iroha

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok

Signed-off-by: grimadas <[email protected]>
@@ -7,3 +7,4 @@
!permissions/*
!prepare.sh
!README.md
!genesis_parser.py
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That probably should be a different directory. Scripts maybe

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, please mv to 'scripts' directory or create dir 'utils'.

Signed-off-by: grimadas <[email protected]>
@grimadas grimadas merged commit 8c2cf73 into dev Oct 15, 2018
@grimadas grimadas deleted the feature/genesis_parser branch October 15, 2018 10:35
bakhtin pushed a commit that referenced this pull request Nov 2, 2018
* Add genesis block parser

Signed-off-by: Bulat Nasrulin <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs-review pr awaits review from maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants