不在 Hyperledger Composer 中正确声明

Propertly not declared in Hyperledger Composer

我在 hyperledger composer playground 中遇到了这个错误:

enter image description here

这是我的提交交易代码:

{
  "$class": "org.example.basic.CarTransaction",
  "car": "resource:org.example.basic.Car#1",
  "newOwner": "resource:org.example.basic.Person#2"
}

我想你忘记在模态(cto)文件的事件中添加 newOwner 属性。

您没有提供代码,所以您的活动应该如下所示(示例) :

event CarTransaferEvent {
  --> Car asset
  o String oldOwner
  o String newOwner
}

现在您可以在交易发生时发出事件。您必须在 logic.js.

中为此编写代码