Learn more >
Get the code
by Raheel Zubairy | Updated February 25, 2019 - Published February 20, 2019
This developer code pattern first demonstrates how to package your smart contracts using the IBM Blockchain Platform VS Code extension, then setting up a network on IBM Blockchain Platform. You will then deploy the decentralized smart contract package onto the network. Lastly, we generate client-side certificates so you can subsequently enroll an application identity and submit transactions on the smart contract.
A key application of blockchain being 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 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 demonstrates how a Node.js smart contract can be packaged using the IBM Blockchain Platform VS Code extension. Using the extension, you can set up a local instance of the Hyperledger Fabric network, on which you can install and instantiate the contract. The application is set up with a Node.js server using the Fabric Node SDK to process transactions that communicate with the network.
When you have completed this code pattern, you will understand how to:
Ready to get started? Please see the README for detailed instructions.
See how processing events from the blockchain is a perfect use case for serverless cloud platforms.
August 30, 2019
Get the Code »
Back to top