我已经完成了 iroha 配置并启动了 iroha 守护进程。我使用以下命令创建了一个新帐户,
iroha-cli --new_account --account_name user1@test
我能够与 iroha-cli 交互,但无法创建任何交易或查询,即使我无法获取帐户信息。
Choose what to do:
1. New transaction (tx)
2. New query (qry)
3. New transaction status request (st)
> : 2
Choose query:
1. Get all permissions related to role (get_role_perm)
2. Get Transactions by transactions' hashes (get_tx)
3. Get information about asset (get_ast_info)
4. Get Account's Transactions (get_acc_tx)
5. Get Account's Asset Transactions (get_acc_ast_tx)
6. Get all current roles in the system (get_roles)
7. Get Account's Signatories (get_acc_sign)
8. Get Account's Assets (get_acc_ast)
9. Get Account Information (get_acc)
0. Back (b)
> : 9
Requested account Id: user1@test
Query is formed. Choose what to do:
1. Send to Iroha peer (send)
2. Save as json file (save)
0. Back (b)
> : 1
Peer address (0.0.0.0):
Peer port (50051):
[2019-02-04 09:00:34.748141999][th:185][error] QueryResponseHandler Query is stateful invalid
--------------------
我在创世 block 中添加了帐户公共(public) ID 并重新启动了守护进程,但仍然遇到相同的错误,请任何人建议我正确的方法,提前致谢。
最佳答案
我找到了解决方案...
重新启动 iroha 守护进程时,我收到以下警告。
[2019-02-21 04:54:25.009069450][th:108][warning] MAIN Passed genesis block will be ignored without --overwrite_ledger flag. Restoring existing state.
这意味着如果您编辑了创世 block ,那么您必须在启动守护进程时启用 --overwrite_ledger 标志,否则它将忽略当前创世 block 并读取前一个创世 block 的数据。
以下是添加新帐户的另一种方法
- 使用以下命令创建新帐户后,它将生成 key 对
iroha-cli --new_account --account_name user1@test
- 以管理员帐户身份登录 iroha-cli
- 选择新交易
- 选择创建帐户
- 输入第一步中生成的帐户名、域名 ID 和公钥
现在您的新帐户已添加,您可以使用该帐户执行交易。
您可以采用第一种方法或第二种方法,但第二种方法是添加新帐户的更好解决方案,因为不需要覆盖分类账。
希望对其他人有帮助......!
关于hyperledger - IROHA 新帐户已创建,但无法从管理员帐户获取帐户信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54513308/