Class ChaincodeBase

  • All Implemented Interfaces:
    Chaincode

    public abstract class ChaincodeBase
    extends java.lang.Object
    implements Chaincode
    • Field Detail

      • CORE_CHAINCODE_LOGGING_SHIM

        public static final java.lang.String CORE_CHAINCODE_LOGGING_SHIM
        See Also:
        Constant Field Values
      • CORE_CHAINCODE_LOGGING_LEVEL

        public static final java.lang.String CORE_CHAINCODE_LOGGING_LEVEL
        See Also:
        Constant Field Values
    • Constructor Detail

      • ChaincodeBase

        public ChaincodeBase()
    • Method Detail

      • init

        public abstract Chaincode.Response init​(ChaincodeStub stub)
        Description copied from interface: Chaincode
        Called during an instantiate transaction after the container has been established, allowing the chaincode to initialize its internal data.
        Specified by:
        init in interface Chaincode
      • start

        public void start​(java.lang.String[] args)
        Start chaincode
        Parameters:
        args - command line arguments
      • connectToPeer

        protected void connectToPeer()
                              throws java.io.IOException
        Throws:
        java.io.IOException
      • initializeLogging

        protected void initializeLogging()
      • validateOptions

        protected void validateOptions()
      • processCommandLineOptions

        protected void processCommandLineOptions​(java.lang.String[] args)
      • processEnvironmentOptions

        protected void processEnvironmentOptions()
      • getChaincodeConfig

        public java.util.Properties getChaincodeConfig()
        Obtains configuration specificially for running the chaincode, and settable on a per chaincode basis, rather than taking properties from the Peers' configuration
      • newSuccessResponse

        @Deprecated
        protected static Chaincode.Response newSuccessResponse​(java.lang.String message,
                                                               byte[] payload)
        Deprecated.
      • newSuccessResponse

        @Deprecated
        protected static Chaincode.Response newSuccessResponse()
        Deprecated.
      • newSuccessResponse

        @Deprecated
        protected static Chaincode.Response newSuccessResponse​(java.lang.String message)
        Deprecated.
      • newSuccessResponse

        @Deprecated
        protected static Chaincode.Response newSuccessResponse​(byte[] payload)
        Deprecated.
      • newErrorResponse

        @Deprecated
        protected static Chaincode.Response newErrorResponse​(java.lang.String message,
                                                             byte[] payload)
        Deprecated.
      • newErrorResponse

        @Deprecated
        protected static Chaincode.Response newErrorResponse()
        Deprecated.
      • newErrorResponse

        @Deprecated
        protected static Chaincode.Response newErrorResponse​(java.lang.String message)
        Deprecated.
      • newErrorResponse

        @Deprecated
        protected static Chaincode.Response newErrorResponse​(byte[] payload)
        Deprecated.
      • newErrorResponse

        @Deprecated
        protected static Chaincode.Response newErrorResponse​(java.lang.Throwable throwable)
        Deprecated.
      • toJsonString

        public static java.lang.String toJsonString​(org.hyperledger.fabric.protos.peer.ChaincodeShim.ChaincodeMessage message)