catsdev
catsdev

Reputation: 83

One chaincode, Multiple assets

I am trying to create a chaincode with different assets types.

Imagine that I have a chaincode where I store the users created and also the transactions where the users receive points.

How can I create a chaincode in a way that I am able to queryAllUsers and queryAllPointsTransactions? without using lists as it is available in this github https://github.com/IBM/customer-loyalty-program-hyperledger-fabric-VSCode Because when using lists we have problems with multiple clients and with multiple transactions at the same time.

Does anyone can help me on this?

Thanks a lot!

Upvotes: 0

Views: 321

Answers (1)

myeongkil kim
myeongkil kim

Reputation: 2586

PutState the asset separately from each key, and use the function below.

GetQueryResult

GetStateByRange

Upvotes: 0

Related Questions