One chaincode, Multiple assets

298 views Asked by At

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!

1

There are 1 answers

0
myeongkil kim On

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

GetQueryResult

GetStateByRange