Hyperledger fabric 在composer rest server中创建参与者或资产时无法实例化抽象类型
我的模型如下Hyperledger fabric 在composer rest server中创建参与者或资产时无法实例化抽象类型,hyperledger-fabric,hyperledger-composer,Hyperledger Fabric,Hyperledger Composer,我的模型如下 abstract concept Address { o String street o String zip o String city o String country } participant Actor identified by userId { o String userId o String firstName o String name o Address address } 当我在composer rest服务器中发布一个新的
abstract concept Address {
o String street
o String zip
o String city
o String country
}
participant Actor identified by userId {
o String userId
o String firstName
o String name
o Address address
}
当我在composer rest服务器中发布一个新的参与者时,我得到以下错误
无法在命名空间中实例化抽象类型地址
io.mydomain.myapp
我在这里遗漏了什么呢?抽象类型不应该被实例化,所以它不能被创建也就不足为奇了 阅读: 具体而言,这一报价值得关注: 可选的“抽象”声明,用于指示此类型不能 被创造。抽象资源可以用作其他资源的基础 要扩展的类。抽象类的扩展不继承 抽象身份。例如,上面定义的资产载体应 永远不要创建,因为应该有更具体的资产类别 定义为扩展它 考虑文档的概念副标题
TL;DR:阅读文档。将地址声明为普通概念类:概念地址{…}而不是抽象类。