我正在尝试在测试网http://api.kylin.alohaeos.com上部署合约。我有以下 hello2.cpp 程序
#include <eosiolib/eosio.hpp>
#include <eosiolib/print.hpp>
using namespace eosio;
class suniltestacc : public contract {
public:
using contract::contract;
[[eosio::action]]
void hi( name user ) {
//require_auth( user );
//print( "Hello, ", name{user} );
print( "Hello, ", user);
}
};
EOSIO_DISPATCH(suniltestacc, (hi))
我使用eosio-cpp -o hello2.wasm hello2.cpp --abigen
. 它给了我两个我忽略的警告。
Warning, empty ricardian clause file
Warning, empty ricardian clause file
然后我执行cleos -u http://api.kylin.alohaeos.com set contract suniltestacc /home/varsha/Varsha/contracts/hello2
这个运行成功,之后我正在尝试这个命令
cleos -u https://api.kylin.alohaeos.com push action suniltestacc hi '["bobmarley"]' -p suniltestacc@active
它给了我错误
error 2019-01-22T08:10:35.520 thread-0 main.cpp:3449 main ] Failed with error: Assert Exception (10)
!action_type.empty(): Unknown action hi in contract suniltestacc.
有人可以帮我解决这个问题。