I am following this doc: https://developers.eos.io/eosio-home/docs/your-first-contract.

This is the hello.cpp contract code which is successfully deployed:

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

class hello : public contract {
      using contract::contract;

      void testit() {
         print( "Hello, ");
EOSIO_DISPATCH( hello, (testit))

When I call cleos push action hello testit '[]' -p hello@active, this error is shown on the console:

!action_type.empty(): Unknown action testit in contract hello


Apparently, as shown in this issue https://github.com/EOSIO/eosio.cdt/issues/214, the generation of the abi is not correct, and sometimes - always in my case - the .abi file is empty.

The solution that you can use now is literally writing your own .abi file. Luckly, I had an old version of the same contract compiled with the old eosiocpp, and the .abi was exactly what I needed. So, I just used that, and everything worked.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.