Created
July 19, 2019 07:32
-
-
Save emshan/ae7aa0e94402a76399347d173878b715 to your computer and use it in GitHub Desktop.
create user using fabric-ca-client/ verifying id through client identity chaincode(CID)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# for attribute based access control, insert :ecert options in the attibutes | |
fabric-ca-client register \ | |
--id.name user \ | |
--id.secret password \ | |
--id.type user \ | |
--id.affiliation Org1 \ | |
--id.attrs 'attr=true:ecert, hf.Affiliation=Org1:ecert' | |
# for enrollment.attrs, attributes named gets copied to ecert | |
# opt means the attributes can be optional | |
fabric-ca-client enroll -u http://user@localhost:7054 --enrollment.attrs "some,thing:opt" | |
# github.com/hyperledger/fabric/core/chaincode/lib/cid | |
# golang | |
stub shim.ChaincodeStubInterface | |
# get msp id from the cert | |
cid.GetMSPID(stub) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment