首页 文章

Hyperledger Composer中的Javascript文件

提问于
浏览
0

我是hyperledger的初学者 . 我想从Asset of Car中检索所有数据,以便在hyperledger composer中的javascript文件中执行某些操作 . 我不需要逐个输入资产车的id . 我能怎么做?

Model

participant Car identified by participant id{
 o String id
 o String name
}

asset CarAsset identified by id{
 o String id
 o String type
}

transaction CarTransaction{
 --> UserAsset asset
 //what can i do in here?
}

Transaction

function carTransaction(tx){
 //what can i do in here?
}

1 回答

  • 0

    如果您想要所有汽车的数据,您可以编写查询并在交易功能中使用它

    query.qry

    query select Cars {
      description: "Select all cars"
      statement:
          SELECT <your namespace>.Car
    }
    

    看看这个查询tutorial它可能会有所帮助

相关问题