Package org.hyperledger.fabric.contract
Class Context
java.lang.Object
org.hyperledger.fabric.contract.Context
This context is available to all 'transaction functions' and provides the transaction context. It also provides
access to the APIs for the world state using
getStub()
Applications can implement their own versions if they wish to add functionality. All subclasses MUST implement a constructor, for example
public MyContext extends Context {
public MyContext(ChaincodeStub stub) {
super(stub);
}
}
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionContext
(ChaincodeStub stub) Creates new client identity and sets it as a property of the stub. -
Method Summary
-
Field Details
-
stub
-
clientIdentity
-
-
Constructor Details
-
Context
Creates new client identity and sets it as a property of the stub.- Parameters:
stub
- Instance of theChaincodeStub
to use
-
-
Method Details
-
getStub
- Returns:
- ChaincodeStub instance to use
-
getClientIdentity
- Returns:
- ClientIdentity object to use
-