Special Interaction Type of Ccontract¶
Introduction of the contract event.¶
- The contract can emit the event.The emit event is recorded on the block chain.When nodes on a blockchain network are synchronized to these events, some scripts can be triggered according to the local configuration.
- The parameters in emit correspond to several global variables when the local callback script is executed.truncated（whether the parameters thrown by emit are truncated）, param（the string format of emit）, contract_id（The contract ID where the tag is located），event_type(The event type in string format)。
Method that triggers a contract event.¶
You can use keyword emit to trigger a contract event.Each time the implementation of the emit statement will trigger a event type of contract event.
The syntax is:
emit hello("glua") -- hello is the name of the event. "glua" is the parameter EventName supports up to 49 bytes long string. EventArg supports up to 1024 bytes, long truncated.