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.

  • What version of eosio.cdt do you use? The latest version (1.6.1) uses different ABI generation process, so many empty ABI cases are resolved. If you use previous version, I recommend upgrading it. – conr2d Apr 14 at 12:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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