6

I am porting Ethereum smart contract in Solidity to EOS platform, but I meet a problem: how to send some events to Dapp so as to update the UI? Now I have to poll the table the smart contract saved to get the status.

Is there event emitting function in EOS smart contract? Or is there another better solution to get the smart contract internal data?

1

Check out the demux library for listening to EOS blockchain events. As far as I know there is no event logs like in Ethereum so you have to poll the api node

| improve this answer | |
2

Currently, an event system like on the ethereum blockchain is not really supported. There are two github issues of the eos code that mention this feature, but say that it is not directly supported

In https://github.com/EOSIO/eos/issues/4003#issuecomment-400155409 the poster says that you currently could achieve this by using a plugin on your own nodeos server.

In https://github.com/EOSIO/eos/issues/1640#issuecomment-375488939 Dan says that it is possible, but the tooling is still being developed.

| improve this answer | |
  • This one has been flagged as a low-quality answer, please include the answering content in your answer and use the link as reference. – John Williamson Jul 17 '18 at 1:06
0

You want to use require_recipient(dapp_acc) and from your node you will listen and receive it, then you can broadcast to your dapp.

| improve this answer | |
  • To listen and receive it, must this be implemented within the node as a "plugin"? Then the plugin can do whatever it wants (arbitrary C++ code)? – Aaron Voelker May 29 '18 at 4:33
  • require_recipient is more about relaying actions than notifying clients – friedger Jul 16 '18 at 8:07

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.