Let’s play with the hello contract comes with eos.
So we make a little change to the hello.cpp
Here, require_auth requires we input the argument as the account name otherwise it will fail. And you also have to change the config.ini so it will print in the console.
contracts-console = true
In this case, you can compile the cpp file.
$ eosiocpp -o hello.wast hello.cpp
Set the contract and execute it.
sam@hero:~/Documents/eos/contracts$ cleos set contract samtre hello/ -p samtre
You will see this in the nodeos output.
2018-07-30T03:23:56.657 thread-0 apply_context.cpp:28 print_debug ]
In the later posts, I will talk about eos source code or some more advanced smart contract.