registerBeforeEvent and registerAfterEvent

I think there’s some confusion.

Emitting new events, can be done via the client API or the provided runtime functions (in any runtime).

If you register before/after hooks, they will only fire if the REST API /v2/event path receives a new event to emit, they will not if you use the runtime function inside a custom RPC.

To process events, you need to register a function that will fire asynchronously on emitted events. This function can only be registered in the Go runtime.

1 Like