https://github.com/platonnetwork/platon-cdt
Wasm contract Development Kit
https://github.com/platonnetwork/platon-cdt
Last synced: about 1 month ago
JSON representation
Wasm contract Development Kit
- Host: GitHub
- URL: https://github.com/platonnetwork/platon-cdt
- Owner: PlatONnetwork
- License: gpl-3.0
- Created: 2019-04-01T06:35:03.000Z (about 6 years ago)
- Default Branch: feature/wasm
- Last Pushed: 2022-02-23T08:51:46.000Z (about 3 years ago)
- Last Synced: 2024-04-22T00:43:36.647Z (about 1 year ago)
- Language: C++
- Size: 10.6 MB
- Stars: 8
- Watchers: 6
- Forks: 14
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

[中文](./README_cn.md)
# PlatON-CDT (Contract Development Toolkit)
PlatON-CDT is a toolchain for WebAssembly(WASM) and set of tools to faciliate
contract writing for the PlatON platform.## Build
### Required
- GCC 5.4+ or Clang 4.0+
- CMake 3.5+
- Git
- Tar
- Wget
- Golang 1.14+### Ubuntu
**Required:** 18.04
- **Install Dependencies**
``` shell
sudo apt install build-essential cmake libz-dev libtinfo-dev tar wget
```- **Get Source Code**
```shell
git clone https://github.com/PlatONnetwork/PlatON-CDT.git
cd PlatON-CDT
git checkout feature/wasm
```- **Build Code**
- **Build with script**
``` sh
./scripts/build.sh
cd build
sudo make install
```- **cmake build**
``` sh
mkdir build && cd build
cmake ..
make -j
sudo make install
```Some common cmake options:
- `-DTEST=ON` To build a unit test module, you need to install go1.13 and above first (the unit test module is not built by default).
- `-DCMAKE_INSTALL_PREFIX=directory` Specify the directory to install cdt related tools and dependent libraries (default `/ usr / local`).
- `-DCDT_BUILD_TYPE=type` The valid options for the build type are Debug and Release. Debug mode assertion checking will be enabled, and the log file will print debugging and error information. (The default is Release).If you are building a unit test module, you need to download PlatON-Go in the ./tools/platon-test/node directory, and compile it after the download is complete.
```shell
cd tools/platon-test && mkdir node && cd node
git clone [email protected]:PlatONnetwork/PlatON-Go.git --recursive
cd PlatON-Go
git checkout ${BRANCH}
make all
```## Usage
If you use the CMAKE_INSTALL_PREFIX option to specify the installation directory, you must add the executable file path generated by PlatON-CDT to the PATH environment variable before using PlatON-CDT (installed in the /usr/local/bin directory by default).
``` bash
platon-cpp test.cpp
```run command could generate test.wasm and test.abi.json in current dirctoy.
## License
GNU General Public License v3.0, see [LICENSE](https://github.com/PlatONnetwork/PlatON-CDT/blob/master/LICENSE).