We’re giving away 1,500 more DJI Tello drones. Enter to win ›
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 VSCode 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 VSCode 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.
Get the Code »
Use the IBM Blockchain Platform's VS Code extension to streamline the process of developing, testing, and deploying a smart contract.
Back to top