Package org.hyperledger.fabric.shim
Class ChaincodeBase
- java.lang.Object
-
- org.hyperledger.fabric.shim.ChaincodeBase
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.hyperledger.fabric.shim.Chaincode
Chaincode.Response
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CORE_CHAINCODE_LOGGING_LEVEL
static java.lang.String
CORE_CHAINCODE_LOGGING_SHIM
static java.lang.String
DEFAULT_HOST
static int
DEFAULT_PORT
-
Constructor Summary
Constructors Constructor Description ChaincodeBase()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract Chaincode.Response
init(ChaincodeStub stub)
Called during an instantiate transaction after the container has been established, allowing the chaincode to initialize its internal data.abstract Chaincode.Response
invoke(ChaincodeStub stub)
Called for every Invoke transaction.protected static Chaincode.Response
newErrorResponse()
protected static Chaincode.Response
newErrorResponse(byte[] payload)
protected static Chaincode.Response
newErrorResponse(java.lang.String message)
protected static Chaincode.Response
newErrorResponse(java.lang.String message, byte[] payload)
protected static Chaincode.Response
newErrorResponse(java.lang.Throwable throwable)
protected static Chaincode.Response
newSuccessResponse()
protected static Chaincode.Response
newSuccessResponse(byte[] payload)
protected static Chaincode.Response
newSuccessResponse(java.lang.String message)
protected static Chaincode.Response
newSuccessResponse(java.lang.String message, byte[] payload)
void
start(java.lang.String[] args)
Start 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
-
DEFAULT_HOST
public static final java.lang.String DEFAULT_HOST
- See Also:
- Constant Field Values
-
DEFAULT_PORT
public static final int DEFAULT_PORT
- See Also:
- Constant Field Values
-
-
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.
-
invoke
public abstract Chaincode.Response invoke(ChaincodeStub stub)
Description copied from interface:Chaincode
Called for every Invoke transaction. The chaincode may change its state variables.
-
start
public void start(java.lang.String[] args)
Start chaincode- Parameters:
args
- command line arguments
-
newSuccessResponse
protected static Chaincode.Response newSuccessResponse(java.lang.String message, byte[] payload)
-
newSuccessResponse
protected static Chaincode.Response newSuccessResponse()
-
newSuccessResponse
protected static Chaincode.Response newSuccessResponse(java.lang.String message)
-
newSuccessResponse
protected static Chaincode.Response newSuccessResponse(byte[] payload)
-
newErrorResponse
protected static Chaincode.Response newErrorResponse(java.lang.String message, byte[] payload)
-
newErrorResponse
protected static Chaincode.Response newErrorResponse()
-
newErrorResponse
protected static Chaincode.Response newErrorResponse(java.lang.String message)
-
newErrorResponse
protected static Chaincode.Response newErrorResponse(byte[] payload)
-
newErrorResponse
protected static Chaincode.Response newErrorResponse(java.lang.Throwable throwable)
-
-