{"id":24259069,"url":"https://github.com/mizukisonoko/iroha-cli","last_synced_at":"2025-07-14T09:08:59.653Z","repository":{"id":26069557,"uuid":"107254987","full_name":"MizukiSonoko/iroha-cli","owner":"MizukiSonoko","description":"YACI:  Yet Another Cli of Iroha 👏👏👏","archived":false,"fork":false,"pushed_at":"2018-03-13T01:10:13.000Z","size":389,"stargazers_count":9,"open_issues_count":6,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-04T23:42:01.306Z","etag":null,"topics":["cli","iroha","protobuf-grpc"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MizukiSonoko.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-17T10:44:33.000Z","updated_at":"2019-01-25T14:02:50.000Z","dependencies_parsed_at":"2022-07-27T06:16:22.783Z","dependency_job_id":null,"html_url":"https://github.com/MizukiSonoko/iroha-cli","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/MizukiSonoko/iroha-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MizukiSonoko%2Firoha-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MizukiSonoko%2Firoha-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MizukiSonoko%2Firoha-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MizukiSonoko%2Firoha-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MizukiSonoko","download_url":"https://codeload.github.com/MizukiSonoko/iroha-cli/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MizukiSonoko%2Firoha-cli/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265266137,"owners_count":23737174,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","iroha","protobuf-grpc"],"created_at":"2025-01-15T05:51:30.109Z","updated_at":"2025-07-14T09:08:59.618Z","avatar_url":"https://github.com/MizukiSonoko.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n## YAC: Yet Another Cli of Iroha\n[![CircleCI](https://circleci.com/gh/MizukiSonoko/iroha-cli.svg?style=shield)](https://circleci.com/gh/MizukiSonoko/iroha-cli)\n\n[![PyPI version](https://badge.fury.io/py/iroha-ya-cli.svg)](https://badge.fury.io/py/iroha-ya-cli)\n\n[hyperledger/iroha](https://github.com/hyperledger/iroha) is open source, I want to contribute to it...  \n\n## Suppert version  \n\n- python2.7 =\u003e ToDo\n- python3.4 =\u003e ToDo\n- python3.5 =\u003e ⚪️ \n- python3.6 =\u003e ToDo\n\n\n## Simple install\n\n```\n$ pip install iroha-ya-cli\n```\n\n## How to use\n\n#### 0) Make `keypair` and `config.yml` in this.\n```\n$ iroha-ya-cli keygen  --account_name mizuki --make_conf yes\n```\n\nResult\n```\n$ ls -lth | head  -n 4\ntotal 76K\n-rw-r--r--   1 mizuki staff  122 Oct 27 07:38 config.yml\n-rw-r--r--   1 mizuki staff   88 Oct 27 07:38 mizuki.pri\n-rw-r--r--   1 mizuki staff   44 Oct 27 07:38 mizuki.pub\n```\n**Please change permission for protect key!!**\n\n#### 1) Change information in generated `config.yml` \nThis file contains target peer information and my account info.\n```config\naccount:\n  name: mizuki\n  privateKeyPath: mizuki.pri\n  publicKeyPath: mizuki.pub\npeer:\n  address: localhost\n  port: 50051\n```\nPeer is target where cli send tx to. I guess Iroha uses grpc, so port is 50051.\n\n####  2) Check config is whether correct or not using `config` command. \n\n```\n$ iroha-ya-cli config --config config.yml\n\n  Config\n =========\n\n name      : mizuki\n publicKey : d5MxIVcHE2eq883JFYxkQVKZV794hWqR2VnXj/iSU1A=\n privateKey: GOcAK**...**Gvg==\n targetPeer: localhost:50051\n\n```\n\n#### 3) Send tx like this\n\n```\n$ iroha-ya-cli tx  CreateAsset --domain_id japan --precision 0 --asset_name yen --config config.yml\n== Grpc happens error ==\n- Server is active?: False\n- What's happen?   : Connect Failed\n\nTransaction is not arrived...\nCould you ckeck this =\u003e localhost:50051\n\n```\nI sent. (This error is expected, no problem 😅 😅 )\n\n#### 4) You can know optin using `-h` or `--help` command.\n\nIn first, you can see all command use this.\n```\nirohac\n```\n\nIn second, you can see detail of each command.\n```\n$ iroha-ya-cli tx CreateAsset -h\nusage: iroha-ya-cli tx CreateAsset [-h] --asset_name ASSET_NAME --domain_id\n                                   DOMAIN_ID [--precision PRECISION]\n                                   [--config CONFIG]\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --asset_name ASSET_NAME\n                        asset name like mizuki\n  --domain_id DOMAIN_ID\n                        new account will be in this domain like japan\n  --precision PRECISION\n                        how much support .000, default 0\n  --config CONFIG       config.yml's path\n  \n```\n \n#### 5) You can know data in Iroha using `query`.\n\n```\nirohac --hostname=localhost:50051 --account_id=admin@test GetAccount --account_id admin@test\n```\n\nResponse is json. so you can use command like `jq`\n```\n{\n  \"account\": {\n    \"permissions\": {\n      \"canTransfer\": true,\n      \"readAllAccounts\": true,\n      \"createDomains\": true,\n      \"removeSignatory\": true,\n      \"setQuorum\": true,\n      \"createAccounts\": true,\n      \"createAssets\": true,\n      \"addSignatory\": true,\n      \"issueAssets\": true,\n      \"setPermissions\": true\n    },\n    \"accountId\": \"admin@test\",\n    \"quorum\": 1,\n    \"domainName\": \"test\"\n  }\n}\n```\n\n\n## Sample\n\n### Tx\n\n- CreateDomain\n```\nirohac --hostname=localhost:50051 --account_id=admin@test CreateDomain --default_role user --domain_id aizu\n```\n\n- CreateAccount\n\n```\nirohac --hostname=localhost:50051 --account_id=admin@test CreateAccount --account_name mizuki --domain_id japan\n```\n\n....\n\n### Query\n\n- GetAccount \n```\nirohac --hostname=localhost:50051 --account_id=admin@test GetAccount --account_id admin@test\n```\n\n- GetAccountTransactions\n\n```\nirohac --hostname=localhost:50051 --account_id=admin@test GetAccountTransactions --account_id admin@test\n```\n\n....\n\n## Test\n```\npython -m unittest discover\n```\n\n## Develop\n```\n# Compile protofile \ngit clone https://github.com/MizukiSonoko/iroha-cli.git\ncd iroha-cli\ndocker run -it -v  $(pwd):/opt/iroha-mizuki-cli mizukisonoko/alpine-grpc-protobuf sh -c  \"cd /opt/iroha-mizuki-cli/schema; ls *.proto | xargs -I{} sh -c 'protoc -I=./ --python_out=../ {}; protoc -I=./ --python_out=../ --grpc_out=../ --plugin=protoc-gen-grpc=`which grpc_python_plugin` {}'\"\npip install -r requirements.txt \n```\n\n\n## Env\n- protobuf + grpc [mizukisonoko/alpine-grpc-protobuf](https://github.com/MizukiSonoko/alpine-grpc-protobuf)\n\n\n\n## Tips\n\nHow to conver hyperledger/iroha-cli's key and cli's key? \nYou can use `ase64.b64encode(bytearray.fromhex())` and `binascii.hexlify(base64.b64decode())`\n```\npubkey_in_iroha = 'c2b800f08c0b45ac9935f03471a04aa1414a974a9f03300503529f578e2031de'\npubkey_in_cli   = 'wrgA8IwLRayZNfA0caBKoUFKl0qfAzAFA1KfV44gMd4='\nconverted_pubkey_iroha = base64.b64encode(bytearray.fromhex(pubkey_in_iroha)).decode()\nconverted_pubkey_cli = binascii.hexlify(base64.b64decode(pubkey_in_cli)).decode()\n\nprint(converted_pubkey_iroha == pubkey_in_cli)\nprint(converted_pubkey_cli == pubkey_in_iroha)\n```\n**Be careful decode()/encode(), byte,str**\n\nIt happens this\n```\nRunning PyYAML-3.12/setup.py -q bdist_egg --dist-dir /tmp/easy_install-wwituzoz/PyYAML-3.12/egg-dist-tmp-kgc91i9t\nbuild/temp.linux-x86_64-3.5/check_libyaml.c:2:18: fatal error: yaml.h: No such file or directory\ncompilation terminated.\n\nlibyaml is not found or a compiler error: forcing --without-libyaml\n```\n=\u003e `apt install -y libyaml-dev`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmizukisonoko%2Firoha-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmizukisonoko%2Firoha-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmizukisonoko%2Firoha-cli/lists"}