new Context()
Example
class ScenarioContext extends Context{
constructor(){
super();
}
generateKey(){
return this.stub.createCompositeKey('type',['keyvalue']);
}
}
Methods
-
setChaincodeStub(stub)
-
This sets the chaincode stub object with api to use for worldstate access. MUST NOT BE CALLED FROM SMART CONTRACT CODE
Parameters:
Name Type Description stub
ChaincodeStub chaincode stub instance -
setClientIdentity(clientIdentity)
-
This sets the ClientIdentity object to use for information on the transaction invoking identity MUST NOT BE CALLED FROM SMART CONTRACT CODE
Parameters:
Name Type Description clientIdentity
ClientIdentity chaincode stub instance