Event Listener
In order to provide a performant experience to the user with aggregated data with Sui objects acting as the source of truth, Sage leverages an internal listening service that listens to and responds to onchain events.
There are two types of actions that may take place:
Database updates
Onchain move calls
Database
For performance reasons Sage implement a neo4j graph database that can be used to query data by the Sage frontend app. This effectively means maintaining a centralized copy of the onchain data, however the source of truth is always be considered to be the Sui objects.
The structure of the listening service and the onchain data makes it possible, though not necessarily easy or quick, to reconstruct the database or caching layer.
Onchain Move Calls
It may be necessary to call additional code onchain as the result of other events occurring on the network. The most likely known case of this currently is automatically generating invite codes for users based on certain actions, at least in the beginning.
Last updated