Welcome to Iroha-Cli !🗻¶
What’s Iroha-cli?¶
iroha-ya-cli は Irohaの台帳を変更、内容確認をquery / tx を使い行うもの
iroha-ya-cli is that send tx / query to Iroha and read / write ledger data
Who uses Iroha-cli?¶
User who wants to access Iroha ledger. Not support user who wants to provision or manage Iroha network
いろは台帳にアクセスする(Tx/Query)人を主に対象とする。台帳を管理する人は現状、対象としない
What Iroha-cli has function?¶
Generally iroha-ya-cli has two parts.
CLIは以下の2つを基本機能として持つ
- send transaction to iroha for writing data / Transactionをいろはに署名付きで投げ、台帳にデータを追加、更新を行う
- send query to iroha for getting data / Queryをいろはに署名付きで投げ、台帳のデータを取得する
In addition, supports this
それに加え以下の機能を持つ
- generate keypair,config / 秘密鍵、構成ファイルの作成
Contents¶
Getting Started¶
What’s required Iroha-cli?¶
iroha-ya-cli running on Python🐍
In now, only Python3.5
Simple Install¶
Cli is hosted by pypi. pypi/iroha-ya-cli
so you can install using this command.
pip install iroha-ya-cli
or
git clone -b v1.2.5 https://github.com/MizukiSonoko/iroha-cli.git
cd iroha-cli
python setup.py install
This is release list .
Generate key pair and config¶
You should create keypair and config.
KeyPair is very important.If you lost keypair, You willn’t be able to access Iroha ledger
注意!KeyPairはアカウントと紐付いており紛失するとIrohaに対しへアクセス(Transaction/Query)ができなくなります
iroha-ya-cli keygen --account_name mizuki --make_conf yes
- account_name KeyPairに紐付くAccountの名前です。この名前のKeyが生成されます。名前はCreateAccount等のコマンドを実行しない限り、Irohaとは関係ないので変更しても問題ありません。
root@9a7f3f24d416:/# ls -htl
total 76K
-rw-r--r-- 1 root root 122 Nov 28 01:33 config.yml
-rw-r--r-- 1 root root 88 Nov 28 01:33 mizuki.pri
-rw-r--r-- 1 root root 44 Nov 28 01:33 mizuki.pub
Testのため、Permissionを644にしていますが、推奨されません。600にしてください
Common Error¶
chino
Samples¶
Generate KeyPair / Configure¶
Irohaでは全ての処理に電子署名を必要とします。なのでIrohaを扱う上で一番最初に行うべきことは自分自身の鍵を持つことです。
コマンドは
iroha-ya-cli keygen --account_name mizuki --make_conf yes
です。もし詳細が知りたい場合は -h
で見ることが出来ます
root@9a7f3f24d416:/# iroha-ya-cli keygen -h
usage: iroha-ya-cli keygen [-h] [--make_conf MAKE_CONF] --account_name ACCOUNT_NAME [--config CONFIG]
optional arguments:
-h, --help show this help message and exit
--make_conf MAKE_CONF
generate conf.yml
--account_name ACCOUNT_NAME
target's account name
--config CONFIG config.yml's path
生成物として、 config.yml
mizuki.pri
mizuki.pri
の 3つがカレントディレクトリに生成されます。
root@9a7f3f24d416:/# ls -l
total 76K
-rw-r--r-- 1 root root 122 Nov 28 01:33 config.yml
-rw-r--r-- 1 root root 88 Nov 28 01:33 mizuki.pri
-rw-r--r-- 1 root root 44 Nov 28 01:33 mizuki.pub
- mizuki.pri 秘密鍵です。秘密にしてください。内容は
Base64
でエンコードされています。
- mizuki.pub 公開鍵です。内容は
Base64
でエンコードされています。
- config.yml 設定ファイルです。
account
はCliを実行する人の情報です。Pathはconfigからの相対パスか絶対パスで指定します。peer
は Transaction/Queryを投げる先の情報です。