How to Set Condition on apistub.getstateByRange(startkey,endkey) in Go chaincode of hyperledger fabric

+1 vote
actually i have 2 structure in my chaincode and i stored both structure data in ledger and i want to display data of each structure as their need not display all data at a time i want to set condition on query all state function(APIstub.GetStateByRange(startKey, endKey)) i want to restract some state that does not display when we query all state and i would be display retracted state as their need.

e.g structure1 one state having name ,number,address,qualification attributes

structure2 2nd state having name ,cnic ,number,address ,qualification attributes

i want when we query all states then only states(structure1) that having no CNIC attribute will be display

we used apistub.putprivatedata and apistub.getprivatedata but its not work plzzz tell me where i am wrong

my code is following

  
    KEY=strconv.Itoa(rand.Int())

    APIstub.PutState(KEY,carAsBytes) // public record

    APIstub.PutPrivateData("3740633141725",KEY,carAsBytes2) private record

  return shim.Success(nil)
Jul 14 in Blockchain by Malik
55 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Blockchain

0 votes
1 answer

How to set chaincode path in Hyperledger Fabric?

For chaincode to properly run on your ...READ MORE

answered Jul 27, 2018 in Blockchain by digger
• 26,550 points
530 views
0 votes
0 answers
+1 vote
2 answers

How to return value from a chaincode in Hyperledger Fabric?

Hyperledger Fabric supports only 2 types of ...READ MORE

answered Jun 13, 2018 in Blockchain by Perry
• 17,020 points
864 views
0 votes
1 answer

How to control visibility of assets in Hyperledger Fabric?

you can use proof of Authority consensus ...READ MORE

answered Jul 10, 2018 in Blockchain by digger
• 26,550 points
111 views
0 votes
1 answer

How to set up hyperledger fabric on 2 different PCs?

I would recommend that you look at ...READ MORE

answered Aug 1, 2018 in Blockchain by ariaholic
• 7,340 points
167 views
+1 vote
3 answers
0 votes
1 answer

How to connect channels of different systems in Hyperledger Fabric?

When you create a channel, you will ...READ MORE

answered Nov 20, 2018 in Blockchain by Omkar
• 67,620 points
66 views
0 votes
1 answer
0 votes
0 answers

how to add path of chain code in hyperledger fabric in startfabric.sh

#!/bin/bash # # Copyright IBM Corp All Rights Reserved # # ...READ MORE

Mar 17 in Blockchain by anonymous
177 views