Oracle BlockChain Service: creating a smart contract aka how to write a chaincode by Lonneke Dikmans
Blog: PaaS Community
In the first blog about blockchain, I used Oracle Compute Cloud Classic and installed MultiChain on it. Since then, Oracle has released a Blockchain Cloud Service with a lot of out of the box functionality, based on Hyperledger.
In this blog post I will describe how to create a smart contract for a webshop use case: getting offers from different suppliers for a specific order. I already know node.js so I will write the ChainCode in node. Note that go is also supported.
- A running instance of Oracle Blockchain Service
- Node.js installed on your laptop
There are a number of steps involved in writing a smart contract (or chaincode).
- Design the chaincode
- Write a chaincode (in Node)
- Deploy a ChainCode to a Peer
- Test the chaincode with Postman
Before you write a chaincode, you need to know what transactions need to be supported. In our example we have a webshop, that issues requests for shipping after ordering an item. Shippers can create an offer. If they are selected by the customer, they pickup the shipment. The customer receives the goods at the end of the cycle. For more information about designing the chaincode, see the hyperledger documentation. Read the complete article here
For regular information on Oracle PaaS become a member in the PaaS (Integration & Process) Partner Community please register here.