Skip to main content

Introduction

Typically, when using Paima, you are reacting to events created by underlying funnels. There are cases, however, where you want your rollup itself to be emitting events.

Event types

Within this, there are two types of events your rollup may want to emit:

  1. Timers & Ticks: These are events that trigger your rollup's state machine (at a later time). This is useful when you want your app to either have
    • "ticks" (regular updates) such as resetting a user leaderboards every 24hrs
    • timed events such as a potion boosting strength for 5 minutes
  2. Log Events: These are events that do not trigger your rollup's state machine. This is useful when you want to have events purely for data analytics purposes, or to power frontend functionality (be it tools like explorers, clients or other tools)

Differentiating events

Typically, when processing events in Paima, the event is uniquely is uniquely defined by the underlying funnel that fetched the data (ex: which user sent the transaction? Which smart contract triggered the event?), which makes it easy to query and process this information. Equivalently, we need a way to differentiate events created by Paima itself.

Precompiles play this role in Paima, by allowing you to attach a namespace to events that are created to make it easier to filter through them.