Connect the Hyperledger Fabric App

Please ensure you have successfully connected to a Hyperledger Fabric blockchain via the Hyperledger Fabric App.

Create a Smart Clause

If you're new to Clause, follow the getting started guide. Otherwise, you should add a Smart Clause® to your contract that emits an obligation, for example, 'Full Payment Upon Signature' or 'Fragile Goods'. The obligations that a Smart Clause emits are listed in the smart clause details window.

Configure your Smart Clause's Action to use Hyperledger Fabric, Audit Trail Action. 

Simply select the FabricAudit connection in the drop down.

Sign your contract

Remember that Actions are only processed when your contract is running. Contracts are running once all signatures have been received.

Once your contract is Running, you should trigger your Smart Clause. The correct way to do this depends on which clause that you chose. For example: 

  • Full Payment upon Signature is triggered automatically when the seller signs the contract.
  • Fragile Goods is triggered by calling the Clause API

Validate that your Smart Clause has emitted an obligation in the Timeline.

You can then use the Blockchain Explorer of your chosen platform, or inspect the peer or chaincode container logs to verify that the audit trail JSON event has been written to the blockchain.

You should see the full details of any actions stored on the blockchain and sent to the container logs:

============= START : Execute storeAuditEvent ===========
============= END : Execute storeAuditEvent ===========
{ fcn: 'storeAuditEvent',
  params: 
   [ '5c9220ac988cb600290591fb',
     '{"$class":"org.accordproject.cicero.runtime.PaymentObligation","amount":{"$class":"org.accordproject.money.MonetaryAmount","doubleValue":790,"currencyCode":"USD"},"description":"penalty payment owed by Dan to Steve for delivery of fragile goods, including delays","contract":"resource:io.clause.demo.fragileGoods.FragileGoodsClause#c6dee898-ef01-4343-b153-223d442a3a0d","promisor":"resource:org.accordproject.cicero.contract.AccordParty#Dan","promisee":"resource:org.accordproject.cicero.contract.AccordParty#Steve","eventId":"valid","timestamp":"2019-03-20T11:26:25.351Z","$clauseId":"5c9220bf988cb600290591fc","$contractId":"5c9220ac988cb600290591fb","$templateUri":"ap://fragile-goods@0.9.1#57cd64ae227cc2fc27abb4308eb38f9224945aa1c90c2dc3aa217215639af877","$organizationId":"5afad66ccb1324086b9b1b94"}' ] }
============= START : Execute storeAuditEvent ===========
============= END : Execute storeAuditEvent ===========

 Please refer to the Audit Trail Event Format reference for more details on the format of the JSON.