Quite simply, hyperledger chaincode is programmatic business logic written in either Java, Node.js, or Go to manipulate user
created business objects. Once the chaincode is completed, tested, and deployed into a hyperledger fabric business network it
is available for execution.
One of the big advantages of using hyperledger composer is that it allows users to represent their business domain objects in a more
straight forward manner. Using the built in business modeling tool (hyperledger composer), most business objects can be created
with almost no programming skills at all. Below is an example of a valid model.
Hyperledger chaincode can be written using Java, Node.js or Go.Below is an example of
some chaincode that would be used with the business model object shown above.
Advantages of using Hyperledger Fabric Chaincode
many primate data types, looping control, arrays, mappings, and structures.
Using the truffle framework, unit testing is supported using both mocha and chai.
Developers have full control over the chaincode regarding which users or groups can execute the code once it is deployed ( ACL lists ).
Hyperledger composer is also available in an on-line sandbox, where you can create and test newly created business objects and chaincode. Developers are
not required to install any tools on their local machines. Chaincode and business objects can be exported and then imported as needed.
Unlike ethereum, executing chain code within a hyperledger blockchain is "free". There is no associated cost, coin or token
required, an the chain code can be executed as often as needed.