EOSIO.CDT (协议开发工具包)

2019-02-04  本文已影响0人  施天助

宿主机上安装 eosio.cdt,安装耗时比较久:参考

安装完之后做一个简单的协议例子参考
eosio-cpp -help

stz1-helloword.hpp:

#include <eosiolib/eosio.hpp>
using namespace eosio;

class token : public contract {
    public:
        using contract::contract;
        /// @abi action
        void hi( account_name user);
};

stz1-helloword.cpp:

#include "stz1-helloword.hpp"

void hello:hi( account_name user){
    print( "Hello, ", name{user} );
}

EOSIO_ABI( hello, (hi) )

方式一:
eosiocpp -o stz1-helloword.wasm stz1-helloword.cpp
eosiocpp -g stz1-helloword.abi stz1-helloword.cpp

方式二:
eosio-cpp stz1-helloword.cpp -o stz1-helloword.wasm -abigen

eosio-cpp ballot.cpp -o ballot.wasm -abigen

上一篇 下一篇

猜你喜欢

热点阅读