This tutorial will help you set up a clause to push all of its emitted obligations to a Hyperledger Fabric network.

For the purposes of the tutorial, I will use the Clause Hyperledger Fabric Sandbox environment (not available on the Clause platform by default, but do contact us if you need it)

1. Connect the App

The first step is to connect the app using the connection profile (a json file) that represents the Network you want to connect to.

  • Settings
  • Apps
  • Hyperledger Fabric -> Connect

2. Create & Configure the Contract

  • Contracts -> Create New Contract
  • Add Signatory
  • Add Clause -> fragile goods
  • Edit Contract Details (optional)
  • Import Flow -> (use the flow linked below)
  • Add additional LEGACY action
  • Action Type -> Hyperledger Fabric
  • Hyperledger Fabric Connection -> FabricAudit
  • Request Signatures

Trigger Flow (right-click and download)

3. Trigger the Clause

Find the flow trigger url and flow trigger authentication token in the flow dialog

curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer TRIGGER_TOKEN" -d '{"request": [0.5, 0.6, 0.7]}' TRIGGER_URL

This should result in the following two events in the contract timeline:

The latest of which, Clause action completed, serves as an indication that the obligation has been pushed successfully to the connected Hyperledger Fabric Network.