Hyperledger Composer transaction processor functions

A Hyperledger Composer business network definition is composed of a set of model files and a set of scripts. The scripts may contain transaction processor functions that implement the transactions defined in the business network definition's model files.

Here's an example of a script file with a transaction:

Sample transaction processor function.  * @param {org.example.basic.SampleTransaction} tx The sample transaction instance.  * @transaction  */ async function sampleExchange(tx) {     // Get the asset registry for the asset.     const assetRegistry = await getAssetRegistry('org.example.basic.SampleAsset');        //Ensure the balance is greather than the amount to be transfered if(tx.origin.value > tx.txTransferAmount) ...

Get Hands-On IoT Solutions with Blockchain now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.