0

I am a beginner with hyperledger. I want to retrieve all data from Asset of Car for do something in javascript file in hyperledger composer. I don't need to input id of asset car one by one. how can i do?


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 Answers1

1

If you want data of all the cars, you can write a query and use it in a transaction function

query.qry

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

Take a look at this query tutorial it might help

Sneha
  • 147
  • 7