1

When I run the hello world contract locally it prints Hello to the console, but when i deploy it to Kylin it doesn't. Is this expected? If so how to can I return something like json from a deployed contract? Or maybe im looking in the wrong place?

The contract is...

#include <eosio/eosio.hpp>

using namespace eosio;

class [[eosio::contract]] oinkcontract : public contract {
  public:
      using contract::contract;

      [[eosio::action]]
      void hi( name user ) {
         print( "Hello, ", user);
      }
};

I push the action

my-MBP:kylin me$ cleos -u https://api.kylin.alohaeos.com:443 push action oinkcontract hi '["oinkeooalice"]' -p oinkeooalice@active
executed transaction: f307667ea4266cc599d4fb51bc960eb240eef3a9196500007eb769819bf8fb8f  104 bytes  186 us
#  oinkcontract <= oinkcontract::hi             {"user":"oinkeooalice"}

I expect "Hello, oinkeooalice" but I dont see it in the console or in the block explorer deployed here

0

This depends on whether or not the node you are sending it to has the option to print console commands or not. If it doesn't then you won't see the message when you push the command with cleos.

You can get around this in several different ways:

  1. Run your own Kylin nodeos node with printing turned on
  2. If you are debugging, replace print with eosio::check(false, "your print statement"); to force an error and print that to cleos output
|improve this answer|||||
  • I have been using api.kylin.alohaeos.com:443 is there a way to find out if it has the option to print to console turned on or not? – Bill Jul 8 '19 at 11:39
  • Almost all public nodes turn this feature off because it uses up lots of bandwidth and disk space – Phillip Hamnett - EOS42 Jul 8 '19 at 11:46

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.