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

How to use Iroha client

Bulat Nasrulin edited this page Aug 6, 2017 · 2 revisions

Use grpc flag to send transaction or query to Iroha network.

Send transaction to Iroha

./iroha-cli --grpc --json_transaction tx.json

Transaction must be signed with known entities, which are contained in chain. Such entities are called signatories in Iroha.

A transaction example:

{
    "signatures": [
        {
            "pubkey": "f24325aa9b91526a83e722e19fa2a3ad7f3966abe066a9302b5d2092fe960254",
            "signature": "4563f8de6ee45e44b462a7027d1640376dece03eaf1091f8e69cdc9531957b178f00667e9241ba2d09f49b7861419b89af4986eb4d332e9d7efb31bb1105890e"
        }
    ],
    "created_ts": 1501800685578,
    "creator_account_id": "admin@test",
    "tx_counter": 1,
    "commands": [
        {
            "command_type": "AddAssetQuantity",
            "account_id": "test@test",
            "asset_id": "coin#test",
            "amount": {
                "int_part": 20,
                "frac_part": 0
            }
        }
    ]
}

Send query to Iroha

./iroha-cli --grpc --json_query query.json

Query must be signed with known entity, known by Iroha.

A query example:

{
    "signature": 
        {
            "pubkey": "f24325aa9b91526a83e722e19fa2a3ad7f3966abe066a9302b5d2092fe960254",
            "signature": "4563f8de6ee45e44b462a7027d1640376dece03eaf1091f8e69cdc9531957b178f00667e9241ba2d09f49b7861419b89af4986eb4d332e9d7efb31bb1105890e"
        },
    "created_ts": 1501800685578,
    "creator_account_id": "admin@test",
    "query_counter": 1,
    "query_type" : "GetAccount",
    "account_id": "test@test"
}
Clone this wiki locally