SAMeh-ZAGhloul / blockchain-starter-kit-20181003143210104

Created for toolchain: https://console.ng.bluemix.net/devops/toolchains/e738f787-e69e-4fd8-b5c9-cbd8229a24c4?env_id=ibm%3Ayp%3Aus-south

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Clause Sample for IBM Blockchain Platform

Legal Contracts are the foundation of the exchange of value between humans. As most things become digitized, so are contracts. Blockchain is transforming the exchange of assets to a model based on a business network using a distributed ledger. This model requires that we establish governing rules for digital asset exchanges; hence the idea of smart contracts was born. The Accord Project is an open source software initiative that has established specifications, tooling and code for smart legal contracts.

The Clause platform manages digital legal contracts that adhere to the Accord Project open-source specifications for smart legal contracts

This code pattern illustrates how a legal agreement (such as a shipping contract) can be automated with the use of trusted data from the IBM Blockchain Platform. In this scenario, the Hyperledger Composer business network (executing on Hyperledger Fabric v1) invokes the Clause platform. Hyperledger Fabric stores the state of assets on the blockchain, while the Cicero engine (from the Accord Project) executes contract logic off-chain on the Clause platform.

The developer creates a blockchain-based business network on the IBM Blockchain Platform that invoke Clause to execute Smart Legal Contracts. When the reader has completed this code pattern, they will understand how to:

  • Deploy a network to IBM Blockchain Starter Plan
  • Configure and use the Clause platform to build and execute a contract
  • Run an Angular application that utilizes the Clause smart contract

Architecture Flow

  1. Application receives a shipment request
  2. A transaction is submitted to IBM Blockchain Platform
  3. A call is issued to Clause to trigger execution of a smart legal contract
  4. The smart legal contract is executed and assuming verifications pass; then a payment is subsequently calculated
  5. Assets on the blockchain are updated: blocks are written to the network and the world state is updated

Included Components

  • Hyperledger Composer v0.19.4 Hyperledger Composer is an extensive, open development toolset and framework to make developing blockchain applications easier
  • Hyperledger Fabric v1.1 Hyperledger Fabric is a platform for distributed ledger solutions, underpinned by a modular architecture delivering high degrees of confidentiality, resiliency, flexibility and scalability.
  • IBM Blockchain Starter Plan The IBM Blockchain Platform Starter Plan allows to build and try out blockchain network in an environment designed for development and testing
  • Clause Clause edits and executes smart legal contracts, connecting them to existing event sources and systems

Featured Technologies

Prerequisites

  1. If you do not have an IBM Cloud account yet, you will need to create one here.

Steps

  1. Deploy to IBM Cloud
  2. Setup Smart Legal Contract
  3. Running the Client Application

Step 1. Deploy to IBM Cloud

A. Click the link below to automate the provision of a service on IBM Cloud and to deploy the contract and app contained in this repository.

Deploy to IBM Cloud

B. Authorize IBM Cloud to access your GitHub account. This sample will be forked into your account so you can modify it.

C. In the Delivery Pipeline tab under Tool Integrations. Enter the service name of your Blockchain instance from your IBM Cloud dashboard, it will be something like Blockchain-xy.

D. Click Create to trigger the deployment, then click 'Delivery Pipeline' to monitor to progress. Wait for both the 'Build' and 'Deploy' stages to pass, this should take about 10 minutes.

Step 2. Setup Smart Legal Contract

While you are waiting you can get started with setting up your Smart Legal Contract on Clause. In that link, begin with Step 3.

Step 3. Running the Client Application

You can read more about the Client Application here.

Click the Client App link under 'LAST EXECUTION RESULT' to view your demonstration app, it should look like the screenshot at the top of this page. Note that Hyperledger Composer is used to store the state of shipments, importers, growers, shippers on the blockchain, while the contract logic is invoked out-of-process using the Cicero Server. Follow the instructions

Links

Learn more

  • Blockchain Code Patterns: Enjoyed this Code Pattern? Check out our other Blockchain Code Patterns

  • Blockchain 101: Learn why IBM believes that blockchain can transform businesses, industries – and even the world. Blockchain 101

  • How to integrate Clause with Blockchain: Learn about the 4 ways you can integrate Smart Legal Contracts from Clause with Blockchain. Integrate Clause with Blockchain

License

Apache 2.0

© Copyright 2018, Clause Inc.

About

Created for toolchain: https://console.ng.bluemix.net/devops/toolchains/e738f787-e69e-4fd8-b5c9-cbd8229a24c4?env_id=ibm%3Ayp%3Aus-south

License:Apache License 2.0


Languages

Language:JavaScript 30.6%Language:TypeScript 26.1%Language:Shell 19.9%Language:HTML 16.5%Language:CSS 6.9%