Class Context

  • public class Context
    extends java.lang.Object
    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) {
    • Constructor Detail

      • Context

        public Context​(ChaincodeStub stub)
        Creates new client identity and sets it as a property of the stub.
        stub - Instance of the ChaincodeStub to use
    • Method Detail

      • getStub

        public ChaincodeStub getStub()
        ChaincodeStub instance to use
      • getClientIdentity

        public ClientIdentity getClientIdentity()
        ClientIdentity object to use