What Are Chaincode Samples?

Oracle Blockchain Platform includes chaincode samples written in Go and Node.js to help you learn how to implement and manage your network’s chaincodes.

To get to the Chaincode Samples page in the Oracle Blockchain Platform console, open the Developer Tools tab and select Samples.

The Chaincode Samples page contains:

  • The Balance Transfer sample is a simple chaincode representing two parties with account balances and operations to query the balances and transfer funds between parties.
  • The Marbles sample includes a chaincode to create marbles where each marble has a color and size attribute. You can assign a marble to an owner and enable operations to query status and trade marbles by name or color between owners.
  • The Car Dealer sample includes a chaincode to manage the production, transfer, and querying of vehicle parts; the vehicles assembled from these parts; and transfer of the vehicles.

    In this sample, a large auto maker and its dealers and buyers have created a blockchain network to streamline its supply chain activities. Blockchain helps them reduce the time required to reconcile issues with the vehicle and parts audit trail.

  • The Fiat Money Token sample includes a chaincode to manage the complete life cycle of a fractional fungible token that represents fiat money. After you initialize the token, create token user accounts, and assign the minter role, you can issue, transfer, and burn tokens. You can also track token account balances and transaction history. For more information about the token samples, see Working With the Sample Token Specification Files.
  • The Loyalty Token sample includes a chaincode to manage a loyalty program by using tokens. Loyalty points can be awarded, redeemed, and transferred. For more information about the token samples, see Working With the Sample Token Specification Files.
  • The NFT Art Collection Marketplace sample includes a chaincode to simulate a marketplace for buying and selling non-fungible tokens (NFTs) associated with works of art. In this sample, museums can mint (create) NFTs for artworks in the blockchain network. Consumers can then buy and then resell NFTs from the museums. The NFT Art Collection Marketplace sample is designed for chaincode development in TypeScript, and is in available in two versions: one for the ERC-721 token standard, and one for the ERC-1155 token standard. For more information about the token samples, see Working With the Sample Token Specification Files.

Use the Download sample here links under each sample to download the sample chaincode. The download contains the Go and Node.js versions of the chaincode.

The download also contains a Java version of the chaincode.