Select wallet identity


Nikos Karamolegkos
 

Hello, I am studying the wallet functionality from here. I can see that the user Isabella can have multiple identities so I understand that in the chaincode I can verify not only the user but the identity (e.g ID1, ID2) of the user too (who invoked the transaction). Therefore, my questions are:
1) Is there any code sample that does that verification inside the chaincode?
2) How can select from my client application a specific ID from the wallet in order to invoke the transaction? (eg. ID1)

Thanks,

-- 
Nikos Karamolegkos
R & D engineer at ICS-FORTH
Telecommunications and Networks Lab (TNL)


Nikos Karamolegkos
 

Any help on that?


David Enyeart
 

1)
Example of verifying invoker identity:
https://github.com/hyperledger/fabric-samples/blob/main/asset-transfer-private-data/chaincode-go/chaincode/asset_transfer.go#L580-L590
Example of verifying invoker org:
https://github.com/hyperledger/fabric-samples/blob/main/asset-transfer-secured-agreement/chaincode-go/asset_transfer.go#L468-L487

2)
Example of selecting wallet identity:
https://github.com/hyperledger/fabric-samples/blob/main/asset-transfer-basic/application-javascript/app.js#L103


Dave Enyeart


"Nikos Karamolegkos" ---11/15/2021 04:07:40 AM---Hello, I am studying the wallet functionality from here  <INVALID URI REMOVED

From: "Nikos Karamolegkos" <nkaram@...>
To: "fabric" <fabric@...>
Date: 11/15/2021 04:07 AM
Subject: [EXTERNAL] [Hyperledger Fabric] Select wallet identity
Sent by: fabric@...





Hello, I am studying the wallet functionality from here. I can see that the user Isabella can have multiple identities so I understand that in the chaincode I can verify not only the user but the identity (e.g ID1, ID2) of the user too (who ZjQcmQRYFpfptBannerStart 
This Message Is From an External Sender
This message came from outside your organization.
ZjQcmQRYFpfptBannerEnd

Hello, I am studying the wallet functionality from here. I can see that the user Isabella can have multiple identities so I understand that in the chaincode I can verify not only the user but the identity (e.g ID1, ID2) of the user too (who invoked the transaction). Therefore, my questions are:
1) Is there any code sample that does that verification inside the chaincode?
2) How can select from my client application a specific ID from the wallet in order to invoke the transaction? (eg. ID1)

Thanks,

--
Nikos Karamolegkos
R & D engineer at ICS-FORTH
Telecommunications and Networks Lab (TNL)






Nikos Karamolegkos
 

Thank you. So in order to match the user Isabella with a second ID (i.e ID2), I just have to create an new identity (using the register and enroll procedure of fabric-ca-client) and then add this identity to Isabella's wallet path?