如何在 Hyperledger Composer 操场上解决此错误(t:标识符无法从超类型扩展)?

How to resolve this error (t: Identifier cannot extend from super type) on Hyperledger Composer playground?

我正在学习 Hyperledger 教程 Youtube Link,讲师修改了示例合同。然而,对于可以在线访问的当前版本的Hyperledger fabric playground,进入accountTransfer函数后没有提到状态。这会导致错误,如下所示:

如何解决?我已尝试搜索答案,但找不到任何解决此特定问题的答案。

t:代表交易。

你的模型有两个问题

  1. transactionId 已被保留(您不需要 model/define 它 - 提交交易时返回交易 ID - 或者如果您正在使用它,请调用其他字段出于您自己的交易目的)-文档确实提到了有关 transactionId https://hyperledger.github.io/composer/reference/cto_language.html

  2. 您在交易定义中不使用 'identified by' - 与参与者和资产不同

查看 -> https://hyperledger.github.io/composer/reference/js_scripts.html and our sample networks (which you can browse) show examples of modeled transactions -> https://github.com/hyperledger/composer-sample-networks

我想补充一点,关于建模交易的更多信息应该包含在上面 1. 中的页面参考中。

最后针对这个脱离上下文的 't:' 错误(即上面的第 1 项)- 我们有一个未解决的 Github 问题(产生错误的另一种问题,但同样的错误结果仍然如此)。 https://github.com/hyperledger/composer/issues/1497