Emitting events in Gno

Emitting events in blockchain systems is one of the ways to make off-chain life easier. To emit an event, simply use the Emit() function found in the std package.

This function takes in string arguments as follows:

std.Emit("EventName", "key1", "value1", "key2", "value2")

The function takes in a variadic number of key:value pairs after the event name.

Events are stored in block results, and can be listened to via the tx-indexer.

Click here⚡︎ to submit a transaction that will emit an event.