安装完以后 会产生 eosio-cpp_, eosio-cc, eosio-ld, eosio-pp, and _eosio_abigen (These are the C++ compiler, C compiler, linker, postpass tool and ABI generator.) 这些交互工具。html
// step 1 $ git clone --recursive https://github.com/eosio/eosio.cdt
PS:整个克隆过程很慢,若是中断进入项目根目录,执行git submodule update --init --recursive继续下载。git
// step 2 // ./build.sh <CORE_SYMBOL> coresymbol能够理解为链名称 这里用eos $ ./build.sh EOS
build完成以后会出现如下界面:github
___ ___ ___ ___ / /\ / /\ / /\ ___ / /\ / /:/_ / /::\ / /:/_ / /\ / /::\ / /:/ /\ / /:/\:\ / /:/ /\ / /:/ / /:/\:\ / /:/ /:/_ / /:/ \:\ / /:/ /::\ /__/::\ / /:/ \:\ /__/:/ /:/ /\ /__/:/ \__\:\ /__/:/ /:/\:\ \__\/\:\__ /__/:/ \__\:\ \ \:\/:/ /:/ \ \:\ / /:/ \ \:\/:/~/:/ \ \:\/\ \ \:\ / /:/ \ \::/ /:/ \ \:\ /:/ \ \::/ /:/ \__\::/ \ \:\ /:/ \ \:\/:/ \ \:\/:/ \__\/ /:/ /__/:/ \ \:\/:/ \ \::/ \ \::/ /__/:/ \__\/ \ \::/ \__\/ \__\/ \__\/ \__\/ For more information: EOSIO website: https://eos.io
安装:web
// step 3 sudo ./install.sh
安装完后 一样会出现安装成功画面, 这一步install会将下列可执行工具链接到 bin目录下工具
llvm-ranlib
llvm-ar
llvm-objdump
llvm-readelf
eosio-cc
eosio-cpp
eosio-ld
eosio-pp
eosio-abigen
wasm2wat
wat2wasmpost
在路径eosio.cdt/examples 有hello合约的示例ui
#include <eosiolib/eosio.hpp> #include <eosiolib/print.hpp> using namespace eosio; class hello : public eosio::contract { public: using contract::contract; [[eosio::action]] void hi( name user ) { print("Hello World",name{user}); } }; EOSIO_DISPATCH( hello, (hi))
1 编译wasm文件spa
$ eosio-cpp hello.cpp -o hello.wasm
2 编译abi文件orm
// 1 在编译wasm文件的同时加上--abigen flag能够同时编译abi文件 $ eosio-cpp hello.cpp -o hello.wasm --abigen // 2 直接使用eosio-abigen 编译 $ eosio-abigen hello.cpp --output=hello.abi