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, 2019 in Blockchain by Malik
887 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,740 points
1,861 views
0 votes
0 answers

How to set chaincode path in Hyperledger Fabric in fabric.sh file

i set the path to chaincode in ...READ MORE

Mar 23, 2019 in Blockchain by Malik

retagged Mar 25, 2019 by Omkar 1,421 views
+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,100 points
2,956 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,740 points
795 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 2, 2018 in Blockchain by aryya
• 7,460 points
1,453 views
+2 votes
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
• 69,220 points
644 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, 2019 in Blockchain by anonymous
1,262 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP