0

我刚刚完成了复数课程并顺利完成了官方项目文档的教程,但是使用 CLI 我无法使用函数 get_acc_ast_tx、get_acc_tx,我检查了对等密钥和配置文件并对应于 genesis 文件,其中admin@test 被允许使用这些功能,我得到:

[2019-12-08 04:55:57.883070400] [E] [CLI/ResponseHandler/Query]:查询无状态无效。

我使用的 genesis 文件是 git 存储库的初始文件:

{
"blockV1": {
    "payload": {
        "transactions": [{
            "payload": {
                "reducedPayload": {
                    "commands": [{
                        "addPeer": {
                            "peer": {
                                "address": "127.0.0.1:10001",
                                "peerKey": "bddd58404d1315e0eb27902c5d7c8eb0602c16238f005773df406bc191308929"
                            }
                        }
                    }, {
                        "createRole": {
                            "roleName": "admin",
                            "permissions": ["can_add_peer", "can_add_signatory", "can_create_account", "can_create_domain", "can_get_all_acc_ast", "can_get_all_acc_ast_txs", "can_get_all_acc_detail", "can_get_all_acc_txs", "can_get_all_accounts", "can_get_all_signatories", "can_get_all_txs", "can_get_blocks", "can_get_roles", "can_read_assets", "can_remove_signatory", "can_set_quorum"]
                        }
                    }, {
                        "createRole": {
                            "roleName": "user",
                            "permissions": ["can_add_signatory", "can_get_my_acc_ast", "can_get_my_acc_ast_txs", "can_get_my_acc_detail", "can_get_my_acc_txs", "can_get_my_account", "can_get_my_signatories", "can_get_my_txs", "can_grant_can_add_my_signatory", "can_grant_can_remove_my_signatory", "can_grant_can_set_my_account_detail", "can_grant_can_set_my_quorum", "can_grant_can_transfer_my_assets", "can_receive", "can_remove_signatory", "can_set_quorum", "can_transfer"]
                        }
                    }, {
                        "createRole": {
                            "roleName": "money_creator",
                            "permissions": ["can_add_asset_qty", "can_create_asset", "can_receive", "can_transfer"]
                        }
                    }, {
                        "createDomain": {
                            "domainId": "test",
                            "defaultRole": "user"
                        }
                    }, {
                        "createAsset": {
                            "assetName": "coin",
                            "domainId": "test",
                            "precision": 2
                        }
                    }, {
                        "createAccount": {
                            "accountName": "admin",
                            "domainId": "test",
                            "publicKey": "313a07e6384776ed95447710d15e59148473ccfc052a681317a72a69f2a49910"
                        }
                    }, {
                        "createAccount": {
                            "accountName": "test",
                            "domainId": "test",
                            "publicKey": "716fe505f69f18511a1b083915aa9ff73ef36e6688199f3959750db38b8f4bfc"
                        }
                    }, {
                        "appendRole": {
                            "accountId": "admin@test",
                            "roleName": "admin"
                        }
                    }, {
                        "appendRole": {
                            "accountId": "admin@test",
                            "roleName": "money_creator"
                        }
                    }],
                    "quorum": 1
                }
            }
        }],
        "txNumber": 1,
        "height": "1",
        "prevBlockHash": "0000000000000000000000000000000000000000000000000000000000000000"
    }
}

}

我在 MAC OS CATALINA 中使用 docker 的超级账本映像。

我根据本手册遵循了教程:https ://iroha.readthedocs.io/en/latest/build/index.html

非常感谢你的帮助。

4

2 回答 2

0

不幸的是,CLI 已经过时了——我们正在为其开发新的解决方案,但同时最好使用可用的 SDK 之一——用于JavaPythonJSiOS(如果您更喜欢移动开发)。它们都包含示例,因此使用它们应该不会太棘手。虽然,如果您遇到任何问题,请使用此处的聊天之一与我们联系。

于 2020-02-18T11:19:02.357 回答
0

这是由于过时的cli。开发的较新版本将取代它,但尚未准备好。

确切的问题是在 iroha 中为这些查询添加了分页元数据,但是 cli 没有更新以正确设置它。Protobuf 传输允许 cli 发送不带一些后来添加的字段的查询,但 iroha 拒绝处理它。

您可以使用始终保持最新的客户端库之一:https ://iroha.readthedocs.io/en/latest/develop/libraries.html 。

于 2020-02-18T11:19:06.113 回答