eos的编译,就不在这写了,官网很详细。
程序要进行debug, 编译的时候注意 ./eosio_build.sh -o Debug
qt先创建一个工程,然后导入现有的文件夹。
解决部分找不到头文件的处理办法,在eos.pro 中配置 INCLUDEPATH
CONFIG += c++11
TARGET = eos
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
BOOST_LIB_PATH=/usr/local/lib
EOS_PATH=/home/coinbase/workspace/eos
EOS_LIBRARIES_PATH=$$EOS_PATH/libraries
EOS_PLUGINS_PATH=$$EOS_PATH/plugins
EOS_CONTRACTS_PATH=$$EOS_PATH/contracts
INCLUDEPATH += /usr/local/include/boost \
$$EOS_PATH/build/contracts \
$$EOS_PATH/build/unittests/contracts \
#libraries目录下的头文件
$$EOS_LIBRARIES_PATH/fc/vendor/websocketpp \
$$EOS_LIBRARIES_PATH/fc/include \
$$EOS_LIBRARIES_PATH/abi_generator/include \
$$EOS_LIBRARIES_PATH/chainbase/include \
$$EOS_LIBRARIES_PATH/chain/include \
$$EOS_LIBRARIES_PATH/testing/include \
$$EOS_LIBRARIES_PATH/utilities/include \
$$EOS_LIBRARIES_PATH/wasm-jit/include \
#plugins目录下的头文件
$$EOS_PLUGINS_PATH/account_history_api_plugin/include \
$$EOS_PLUGINS_PATH/account_history_plugin/include \
$$EOS_PLUGINS_PATH/bnet_plugin/include \
$$EOS_PLUGINS_PATH/chain_api_plugin/include \
$$EOS_PLUGINS_PATH/chain_interface/include \
$$EOS_PLUGINS_PATH/chain_plugin/include \
$$EOS_PLUGINS_PATH/db_size_api_plugin/include \
$$EOS_PLUGINS_PATH/faucet_testnet_plugin/include \
$$EOS_PLUGINS_PATH/history_api_plugin/include \
$$EOS_PLUGINS_PATH/history_plugin/include \
$$EOS_PLUGINS_PATH/http_client_plugin/include \
$$EOS_PLUGINS_PATH/http_plugin/include \
$$EOS_PLUGINS_PATH/mongo_db_plugin/include \
$$EOS_PLUGINS_PATH/net_api_plugin/include \
$$EOS_PLUGINS_PATH/net_plugin/include \
$$EOS_PLUGINS_PATH/producer_api_plugin/include \
$$EOS_PLUGINS_PATH/producer_plugin/include \
$$EOS_PLUGINS_PATH/sql_db_plugin/include \
$$EOS_PLUGINS_PATH/template_plugin/include \
$$EOS_PLUGINS_PATH/txn_test_gen_plugin/include \
$$EOS_PLUGINS_PATH/wallet_api_plugin/include \
$$EOS_PLUGINS_PATH/wallet_plugin/include \
#
$$EOS_CONTRACTS_PATH
LIBS += $$join(BOOST_LIB_PATH,,-L,)
LIBS += -lboost_program_options
LIBS += -lboost_system -lboost_filesystem -lboost_program_options -lboost_thread
LIBS += -lboost_unit_test_framework
DEFINES += BOOST_USE_LIB
HEADERS += \
test.hpp \
contracts/asserter/asserter.hpp \
contracts/bancor/bancor.hpp \
........省略.......
配置调试程序
调试nodeos
选择 eos/build/programs/nodeos/nodeos
参数 -e -p eosio --plugin eosio::chain_api_plugin --plugin eosio::history_api_plugin
调试 cleos
参数 get info
其他参数请参考:eos 的 api
cleos 调试麻烦,每次把需要调试的参数放到 arguments里。如create wallet,创建钱包。