IBM Blockchain Platform (Perishable Goods) Tutorial
This tutorial creates a blockchain-based business network on the IBM Blockchain Platform that invokes Clause to execute Smart Legal Contracts.
This tutorial does not require writing any code, but familiarity with GitHub is recommended.
The state of a set of assets and participants are stored on a blockchain, whilst smart legal contracts are externalized for execution on the Clause platform. Instead of hardcoding legal business logic into the chaincode, the logic is externalized into a Smart Clause template and invoked out of process using Clause.
1. Create your IBM Blockchain Platform instance
If you have already deployed the Clause sample on IBM Blockchain Platform via the toolchain, you can skip to step 2.
Option 1: If you already have an instance of IBM Blockchain Platform
From the Samples page of your blockchain instance, choose the Clause Perishable Goods sample and follow the instructions.
Option 2: If you're new to IBM Blockchain Platform
Click the button below to automatically provision the required IBM Cloud resources and to deploy the sample.
2. Create and confirm your account on Clause
You should now have your own version of the demonstration application running that looks similar to the image below.
Use the sign-up form to register for Clause. You will need to confirm your email address to complete your registration.
3. Create your Smart Legal Contract on Clause
Once logged in to Clause:
- Click 'Create New Contract'
- Click '+ Add Clause'
- Check 'View advanced templates'
- Choose the 'perishable-goods' clause
- Optionally give your contract a name. Click The edit icon next to 'untitled' in the top-left to change the name.
- Change the parameters of the contract, for example, adjust the temperature/humidity range or the penalties.
- In the Smart Clauses® panel on the right, scroll down to Triggers.
- Copy the Trigger URL (which starts
https://api.clause.io...) into the first box in the demonstration application.
- Copy the Bearer authentication token into the second box in the demonstration application.
4. Switch back to the demonstration application
Continue to follow the instructions in the demonstration application.
If you provide many out of range readings the contract limits the penalty at the cost of the shipment. In this case it appear that no funds are transferred.
5. You're all done in Clause for now!
When you've finished the sample, there's lots more to do with Clause! For example:
- Add other clauses to your contract from a template library.
- Add signatories to your contract to electronically sign it.
- Add a custom action to automate a contractual obligation such as making a payment.
- Investigate the source code of the Smart Clause. This is written in a domain specific language for smart legal contracts called Ergo.