Generate Stablecoin Chaincode

You can use Blockchain App Builder to generate the stablecoin chaincode from the provided specification file.

The stablecoin chaincode is provided as a chaincode package in the Oracle Blockchain Platform console. The chaincode contains controller methods and updated automatically generated methods that support user validation and authorization. The Stablecoin specification file is one of the default specification files in Blockchain App Builder.
  1. In Blockchain App Builder, use the Stablecoin specification file to generate chaincode.
    For more information on generating chaincode, see Create a Chaincode Project with the Blockchain App Builder CLI and Create a Chaincode Project with the Blockchain App Builder Visual Studio Code Extension in Blockchain App Builder for Oracle Blockchain Platform.
  2. Extract the stablecoin.zip file in the downloaded stablecoin chaincode package.
  3. Navigate to the chaincode directory, and then copy the following files into the chaincode that you generated by using the stablecoin specification file and Blockchain App Builder, overwriting the previous files.
    src/Stablecoin.controller.ts 
    src/Stablecoin.model.ts 
    lib/constants.ts 
    lib/token-account.ts
  4. If you used a chaincode name other than Stablecoin, update the imports in the files.
    The following example shows how to update the imports for a chaincode named MyCoin.
    import { AccountPolicyCheck } from "../model/MyCoin.model";
    import { ApprovalPolicyCheck } from "../model/MyCoin.model";