Does Hyperledger-Fabric provide a way to find out who (msg.sender in Ethereum) is called a chain?

In Hyperledger-Fabric, how to get Ethereum as "msg.sender" in the chained code? (also when chaining code A calls chaining B, will there be a "msg.sender" script address of A (as in Ethereum)?

+3


source to share


2 answers


To add to Mo-Che Chan's answer:

func (stub *ChaincodeStub) GetCreator() ([]byte, error)

      

GetCreator returns the SignatureHeader.Creator of the signed object referenced by this stub.

GetCreator must receive a signed offer and offer.

From the HyperLedger Blog :

The Creator field stores the x.509 certificate, public key, and membership (MSP) that issued this information to the client. The Nonce field contains some random bytes.

type SignatureHeader struct {   
    Creator []byte 
    Nonce []byte 
}

      



And from another post on the same blog, block structure diagrams. It has a section in each transaction (see line 4) for

Developer ID (certificate, public key) - Client

It seems that yes, it would be the equivalent of msg.sender in Solidity.

Block structure

+2


source


func (stub *ChaincodeStub) GetCreator() ([]byte, error)

      

GetCreator returns the SignatureHeader.Creator of the signed object referenced by this stub.



GetCreator must receive a signed offer and offer.

0


source







All Articles