Developing Blockchain app using Hyperledger composer [draft]

Hyperledger Umbrella
  1. Busniess Network Archive — Capturing the core data in a business network, including the business model, transaction logic and access control, the Business Network Archive packages these elements and deploys them to a runtime.
  2. Rest API support and integration — A loopback connector for business networks that exposes a running network as a REST API which can easily be consumed by client applications and integrate non-blockchain applications.
  1. Hyperledger composer supports pluggable blockchain consensus protocols to ensure that transactions are validated according to policy by the “designated business network participants”.
npm install -g composer-cli
npm install -g composer-rest-server
npm install -g generator-hyperledger-composer
npm install -g yo
npm install -g composer-playground
curl -O -xvf fabric-dev-servers.tar.gz
yo hyperledger-composer:businessnetwork

namespace org.example.mynetwork
asset Commodity identified by tradingSymbol {
o String tradingSymbol
o String description
o String mainExchange
o Double quantity
--> Trader owner
participant Trader identified by tradeId {
o String tradeId
o String firstName
o String lastName
transaction Trade {
--> Commodity commodity
--> Trader newOwner
async function tradeCommodity(trade) {
trade.commodity.owner = trade.newOwner;
let assetRegistry = await getAssetRegistry('org.example.mynetwork.Commodity');
await assetRegistry.update(trade.commodity);
* Access control rules for tutorial-network
rule Default {
description: "Allow all participants access to all resources"
participant: "ANY"
operation: ALL
resource: "org.example.mynetwork.*"
action: ALLOW

rule SystemACL {
description: "System ACL to permit all access"
participant: "ANY"
operation: ALL
resource: "org.hyperledger.composer.system.**"
action: ALLOW
composer archive create -t dir -n .
composer network install --card PeerAdmin@hlfv1 — archiveFile tutorial-network\@0.0.1.bna
composer network start --networkName tutorial-network --networkVersion 0.0.1 --networkAdmin admin --networkAdminEnrollSecret adminpw --card PeerAdmin@hlfv1 --file networkadmin.card
REST API using Loopback
yo hyperledger-composer:angular
Angular app fires up against the REST AP at http://localhost:4200

Learner, thinker and Doer.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

State of Magisk: 2020

You don’t need a CS degree to write software

Code Smell 102 — Arrow Code

Subscribe Salesforce Platform Events by Mulesoft

More on optimization for retrieving market data in relational databases

25+ “No-code” Apps and Tools to help build your Startup

CRODO VS CeloLaunch: Battle Of Launchpads

GO-SQUADS Tech 3.0 Engineering Mini-Bootcamp: An Unexpected Journey

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Azim Shaik

Azim Shaik

Learner, thinker and Doer.

More from Medium

Security Management with SYNK

BLOCKCHAIN DEVELOPERS: Attack your excellent work in unimaginable ways.

Exploring Hyperledger Fabric and Hyperledger Explorer

What is Verifiable Credentials?