C++ contract compilation tool
The Ant Blockchain contract platform supports C++ contract development. You can compile contract source code with the mychain.mycdt compilation tool from Ant Blockchain or online using Cloud IDE. This topic provides installation instructions for the mychain.mycdt tool.
For more information, see Use Cloud IDE.
mychain.mycdt is an Ant Blockchain tool that compiles contract code into wasm bytecode. Installation packages vary by operating system. Download the package that corresponds to your operating system:
Operating system | System version number | Installation package |
Linux | centos7.2 | |
macOS | High Sierra 10.13.6 |
The following examples show how to install the mychain.mycdt tool and verify the installation.
Linux installation example
Download the mychain.mycdt installation package. Decompress the package and place it in the
$HOMEdirectory.$ cd $HOME $ tar xf MYCDT-2.19.3-Linux-x86_64.tar.gzRun the following command to export the environment variable.
$ export PATH="$HOME/MYCDT-2.19.3-Linux-x86_64/bin:$PATH"Run the following command to verify the installation.
$ my++ --versionIf the following message appears, the installation is successful.
my++ version 2.19.3
macOS installation example
Download the mychain.mycdt installation package. Decompress the package into your desired installation directory, such as
/HOME.Run the following commands to install mychain.mycdt.
$ cd /HOME tar -zxvf MYCDT-2.19.3-Linux-x86_64.tar.gzRun the following command to export the environment variable.
sudo export PATH=$PATH:/HOME/MYCDT-2.19.3-Darwin-x86_64/binRun the following command to verify the installation.
$ my++ --versionIf the following message appears, the installation is successful.
my++ version 2.19.3
Additionally, if you use a C++ Integrated Development Environment (IDE) such as VsCode or CLion to write contracts and want to enable features such as syntax suggestions, add the include directory from the mychain.mycdt installation to the header file directory configuration in your IDE. For example, on macOS, the MYCDT header file directory is $HOME/MYCDT-2.19.3-Darwin-x86_64/wasm-sysroot/include.