Upgrading Chaincode Projects in the CLI

You can use this command to upgrade existing chaincode projects to use the new features of the updated Blockchain App Builder. This command works with both TypeScript and Go projects.

For Go projects, upgrade to Go v1.20.10 before you run the command to upgrade your chaincode project.

Usage:

upgrade [options]
my-mac:Project myname$ ochain upgrade -h 
Usage: upgrade [options]
Upgrade App Builder chaincode project 
Options :
    -h, --help              output command usage information
    -D, --debug             enable debug logging
    -p, --project <path>    (optional) Path to Chaincode project to upgrade. If not specified, it defaults to current directory.
    -cc, --chaincode        (optional) To upgrade chaincode project
Examples :
$> ochain upgrade --project <path of chaincode dir>
To upgrade a chaincode project, navigate to the directory containing the project and then enter the following command:
ochain upgrade

If you encounter problems while upgrading a chaincode project, you can use the --debug option to generate debug logs. On Microsoft Windows, use Command Prompt instead of PowerShell if you specify the --debug option.

After you upgrade a chaincode project, synchronize the specification file with the generated source code. For more information, see Synchronize Specification File Changes With Generated Source Code.