All Projects → IBM → Decentralized Energy Composer

IBM / Decentralized Energy Composer

Licence: apache-2.0
WARNING: This repository is no longer maintained ⚠️ We are no longer showing the Hyperledger Composer Service.

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Decentralized Energy Composer

Build Blockchain Insurance App
Sample insurance application using Hyperledger Fabric
Stars: ✭ 609 (+372.09%)
Mutual labels:  blockchain, hyperledger-fabric, ibmcode
Blockchainnetwork Compositejourney
Part 1 in a series of patterns showing the building blocks of a Blockchain application
Stars: ✭ 217 (+68.22%)
Mutual labels:  blockchain, hyperledger-fabric, ibmcode
Todo List Fabricv1
A todo list application using Hyperledger Fabric V1 as a data source
Stars: ✭ 103 (-20.16%)
Mutual labels:  blockchain, hyperledger-fabric, ibmcode
Fabric Sdk Go
Stars: ✭ 712 (+451.94%)
Mutual labels:  blockchain, hyperledger-fabric
Blockchain Network On Kubernetes
Demonstrates the steps involved in setting up your business network on Hyperledger Fabric using Kubernetes APIs on IBM Cloud Kubernetes Service.
Stars: ✭ 261 (+102.33%)
Mutual labels:  blockchain, hyperledger-fabric
Zerotoblockchain
Tutorial for Zero to Blockchain series
Stars: ✭ 272 (+110.85%)
Mutual labels:  blockchain, hyperledger-fabric
Blockchain Application Using Fabric Java Sdk
Create and Deploy a Blockchain Network using Hyperledger Fabric SDK Java
Stars: ✭ 237 (+83.72%)
Mutual labels:  blockchain, hyperledger-fabric
Bigchaindb Hyperledger
BigchainDB integration with HyperLedger Fabric. In collaboration with TheLedger
Stars: ✭ 20 (-84.5%)
Mutual labels:  blockchain, hyperledger-fabric
Fabric Multi Network
Stars: ✭ 16 (-87.6%)
Mutual labels:  blockchain, hyperledger-fabric
Decentralized Energy Fabric On Ibp20
Set up a network on the IBM Blockchain Platform and deploy a decentralized energy smart contract on the network.
Stars: ✭ 29 (-77.52%)
Mutual labels:  blockchain, hyperledger-fabric
Fabricnodesdk Starter
WARNING: This repository is no longer maintained ⚠️ > This repository will not be updated. The repository will be kept available in read-only mode.
Stars: ✭ 51 (-60.47%)
Mutual labels:  hyperledger-fabric, ibmcode
Leveraging-cache-and-MessagingQueue-to-scale-BlockchainNetwork
WARNING: This repository is no longer maintained ⚠️ This repository will not be updated. The repository will be kept available in read-only mode.
Stars: ✭ 28 (-78.29%)
Mutual labels:  hyperledger-fabric, ibmcode
BlockchainPublicRegulationFabric-Food
A Public Regulation Fabric example in the Food Industry
Stars: ✭ 47 (-63.57%)
Mutual labels:  hyperledger-fabric, ibmcode
Blockchain Learning
Learn and promote blockchain together by writing
Stars: ✭ 44 (-65.89%)
Mutual labels:  blockchain, hyperledger-fabric
Blockchainsmartcontracttrading Compositejourney
WARNING: This repository is no longer maintained ⚠️ The Create and execute blockchain smart contracts from IBM Cloud has been sunset. This repository will not be updated. The repository will be kept available in read-only mode. Refer to https://github.com/IBM/SmartContractTrading-wFabric1-4-VSCodeExt for a similar example.
Stars: ✭ 69 (-46.51%)
Mutual labels:  blockchain, ibmcode
Heroes Service
Short tutorial to build a blockchain application in Go with Hyperledger Fabric
Stars: ✭ 248 (+92.25%)
Mutual labels:  blockchain, hyperledger-fabric
Balance Transfer Go
A sample go app to demonstrate fabric-client & fabric-ca-client go SDK APIs
Stars: ✭ 19 (-85.27%)
Mutual labels:  blockchain, hyperledger-fabric
Evote
A voting application that leverages Hyperledger Fabric and the IBM Blockchain Platform to record and tally ballots.
Stars: ✭ 208 (+61.24%)
Mutual labels:  blockchain, hyperledger-fabric
Loyalty Points Evm Fabric
Sample use of Ethereum smart contract in Hyperledger Fabric
Stars: ✭ 35 (-72.87%)
Mutual labels:  blockchain, hyperledger-fabric
Blockchain Real Estate
🚀基于区块链的房地产交易系统小模型。提供销售和捐赠功能。本项目使用Hyperledger Fabric构建区块链网络, go编写智能合约,应用层使用gin+fabric-sdk-go调用合约。前端展示使用vue+element。体验地址:http://blockchain.togettoyou.com/web
Stars: ✭ 81 (-37.21%)
Mutual labels:  blockchain, hyperledger-fabric

WARNING: This repository is no longer maintained ⚠️

Read this in other languages: 中文.

Decentralized Energy with Hyperledger Composer

A key application of Blockchain being currently explored is a Decentralized Energy network. The idea stems from a neighborhood where certain Residents are producing energy through Solar panels or other means, and can sell excess energy to Residents needing energy. The transactions would be based on coins in each Resident's account. As per a pre-determined contract and rate, the coins would be debited from the consumer and credited to the producer, for a certain billing period. Each transaction would need to be atomic and added to a Blockchain ledger for trust and verification. The network can include Banks to transact coins for Fiat currency (USD). The network can have Utility Company who can buy or provide energy through the network.

In this code pattern, we will create such a Blockchain application using Hyperledger Composer. The network consists of Residents, Banks and Utility Companies. Residents can exchange coins for energy among each other. The application assumes a pre-paid system where transactions occur after the energy is consumed and the values are updated. The Resident can exchange coins for Fiat money (USD) with Banks on the network. The Residents can also transact coins for energy with a Utility company on the network.

This code pattern is for developers looking to start building Blockchain applications with Hyperledger Composer. When the reader has completed this code pattern, they will understand how to:

  • Create business network using Hyperledge Composer and recording transactions on Blockchain ledger
  • Deploying the networking to an instance of Hyperledger Fabric
  • Building an Angular app to interact with the network through REST API

Architecture Flow

  1. The administrator interacts with Decentralized Energy UI comprising of Angular framework
  2. The application processes user requests to the network through a REST API.
  3. Implements requests to the Blockchain state database on Hyperledger Fabric v1
  4. The REST API is used to retrieve the state of the database
  5. The Angular framework gets the data through GET calls to the REST API

Included Components

  • Hyperledger Composer v0.20
  • Hyperledger Fabric v1.2
  • Angular Framework
  • Loopback

Running the Application

Follow these steps to setup and run this code pattern. The steps are described in detail below.

Prerequisite

  • Operating Systems: Ubuntu Linux 14.04 / 16.04 LTS (both 64-bit), or Mac OS 10.12
  • Docker (Version 17.03 or higher)
  • npm (v5.x)
  • Node (version 8.9 or higher - note version 9 is not supported)
    • to install specific Node version you can use nvm
  • Hyperledger Composer

Steps

  1. Clone the repo
  2. Setup Fabric
  3. Generate the Business Network Archive
  4. Deploy to Fabric
  5. Run Application
  6. Create Participants
  7. Execute Transactions

1. Clone the repo

Clone the Decentralized-Energy-Composer code locally. In a terminal, run:

git clone https://github.com/IBM/Decentralized-Energy-Composer
cd Decentralized-Energy-Composer

2. Setup Fabric

These commands will kill and remove all running containers, and should remove all previously created Hyperledger Fabric chaincode images:

docker kill $(docker ps -q)
docker rm $(docker ps -aq)
docker rmi $(docker images dev-* -q)

Set the fabric version to v1.2:

export FABRIC_VERSION=hlfv12

All the scripts will be in the directory /fabric-tools. Start fabric and create peer admin card:

cd fabric-dev-servers/
./downloadFabric.sh
./startFabric.sh
./createPeerAdminCard.sh

3. Generate the Business Network Archive

Next generate the Business Network Archive (BNA) file from the root directory:

cd ../
npm install

The composer archive create command in package.json has created a file called [email protected].

4. Deploy to Fabric

Now, we are ready to deploy the business network to Hyperledger Fabric. This requires the Hyperledger Composer chaincode to be installed on the peer, then the business network archive (.bna) must be sent to the peer, and a new participant, identity, and associated card must be created to be the network administrator. Finally, the network administrator business network card must be imported for use, and the network can then be pinged to check it is responding.

First, install the business network:

composer network install --card [email protected] --archiveFile [email protected]

Start the business network:

composer network start --networkName decentralized-energy-network --networkVersion 0.1.15 --networkAdmin admin --networkAdminEnrollSecret adminpw --card [email protected] --file networkadmin.card

Import the network administrator identity as a usable business network card:

composer card import --file networkadmin.card

Check that the business network has been deployed successfully, run the following command to ping the network:

composer network ping --card [email protected]

5. Run Application

First, go into the angular-app folder and install the dependency:

cd angular-app/
npm install

To start the application:

npm start

The application should now be running at: http://localhost:4200

The REST server to communicate with network is available here: http://localhost:3000/explorer/

6. Create Participants

Once the application opens, create participants and fill in dummy data. Create Residents, Banks and Utility Companies.

7. Execute Transactions

Execute transactions manually between Residents, Resident and Bank, and Resident and Utility Company. After executing transactions, ensure the participants account values are updated.

At the end of your session, stop fabric:

cd ~/fabric-tools
./stopFabric.sh
./teardownFabric.sh

Extending Code Pattern

This application demonstrates a basic idea of a decentralized energy network using Blockchain and can be expanded in several ways:

  • Adding specific permissions and participant access
  • Setting up real time transactions among participants
  • Integrating with IoT to read from power meter and distribute energy

Deploy to IBM Cloud

The blockchain network can be deployed to IBM Cloud. You can use the IBM Blockchain platform and start for free under Starter Membership Plan. Follow these instructions to deploy the business network to IBM Blockchain platform.

Additional Resources

License

This code pattern is licensed under the Apache Software License, Version 2. Separate third party code objects invoked within this code pattern are licensed by their respective providers pursuant to their own separate licenses. Contributions are subject to the Developer Certificate of Origin, Version 1.1 (DCO) and the Apache Software License, Version 2.

Apache Software License (ASL) FAQ

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].