Re: What is the purpose of shim.GetBinding()


Mr.Phuwanai Thummavet
 

I see. The function will return a HEX-encoded string of SHA256 hash of the transaction's nonce, creator and epoch concatenated. How can I get the nonce and the epoch from the shim APIs? Do you have any example code? Thanks.


On Mon, Oct 26, 2020 at 3:27 AM Brett T Logan <Brett.T.Logan@...> wrote:
Here is a pretty lengthy description of this API along with an example from the node-sdk API spec: https://hyperledger.github.io/fabric-chaincode-node/master/api/fabric-shim.ChaincodeStub.html#getBinding__anchor
 
Brett Logan
Software Engineer, IBM Blockchain
Phone: 1-984-242-6890
 
 
 
----- Original message -----
From: "Mr.Phuwanai Thummavet" <mr.thummavet@...>
Sent by: fabric@...
To: fabric <fabric@...>
Cc:
Subject: [EXTERNAL] [Hyperledger Fabric] What is the purpose of shim.GetBinding()
Date: Sun, Oct 25, 2020 5:53 AM
 
Hi everyone,
 
I want to know what is the purpose of the function stub.GetBinding() and when to use it?
Its description in interface.go is not provided enough details for me to understand.
 
// GetBinding returns the transaction binding, which is used to enforce a
// link between application data (like those stored in the transient field
// above) to the proposal itself. This is useful to avoid possible replay
// attacks.
GetBinding() ([]byte, error)

Does anyone have an example code about it?
Thank you very much.
 
--
Best Regards,
Phuwanai Thummavet
Blockchain Architect and Full-Stack Developer
 



--
Best Regards,
Phuwanai Thummavet
Blockchain Architect and Full-Stack Developer

Join fabric@lists.hyperledger.org to automatically receive all group messages.