美文网首页
EOSIO.CDT (协议开发工具包)

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

作者: 施天助 | 来源:发表于2019-02-04 09:53 被阅读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

相关文章

网友评论

      本文标题:EOSIO.CDT (协议开发工具包)

      本文链接:https://www.haomeiwen.com/subject/jtrpsqtx.html