We can define many things in chaincode "invoke" function.And we can also define many "transaction" in hyperledger composer network.What's more these two concept can change the ledger statement.
If I can use getNativeAPI().invokeChaincode() to call a "transaction in the other network?For example, if I have transaction:
In cto
participant ValifyParticipant identified by valifiedId {
o String valifiedId
o String organization
o Double validRate
o Double passRate
}
@returns(String)
transaction ValifyTransaction {
o String detail
o String valid
--> ValifyParticipant valifyParticipant
--> Participant Participant
}
In logic.js:
/**
* Sample valify manual transaction fuction
* @param {org.example.com.ValifyTransaction} vct the sample valify manual submit transaction instance.
* @returns {String}(https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string) The string.
* @transaction
*/
async function ValifyCompoundTransaction(vct) {
....
}
How can I call ValifyCompoundTransaction
in another network with the function getNativeAPI().invokeChaincode()
I have followed the tutorial:
https://hyperledger.github.io/composer/latest/tutorials/invoke-composer-network
to use getNative().invokechaincode() to execute function which is below:
const otherNetworkData = await getNativeAPI().invokeChaincode('example-test-network',['getResourceInRegistry','Participant','org.example.com.Participant','1'],'firstchannel');
But failed and get the reason below:
2018-09-21 02:31:00.211 UTC [committer/txvalidator] validateTx -> ERRO 03c VSCCValidateTx for transaction txId = 60730ff6a58440f3a59322ca9590d2eeff933c23b074e73611dfc4ff9b6f8322 returned error: VSCC error: endorsement policy failure, err: signature set did not satisfy policy
2018-09-21 02:31:28.273 UTC [chaincode] HandleTransaction -> ERRO 042 [e2243000] Failed to handle INVOKE_CHAINCODE. error: could not get valid transaction
But When I remove the invokeChaincode() above it works fine