Skip to content
CCPEDIAby Unity Nodes
Discussions/App Development/What does Root Event mean for a Transaction?Forum ↗

What does Root Event mean for a Transaction?

App Development2 posts224 viewsLast activity Oct 2021
SH
shiuuOP
Oct 2021

TransactionTree has a property RootEventIds: Generated Documentation (Untitled)
What is the significance of Root Event?

CO
cocreature
Oct 2021

The root events correspond to the commands you submitted. So if you submit a create command, the corresponding create event will be a root event id. If you submit an exercise command, the corresponding exercise event will be a root event id (but not the children of that exercise).

For single-command submissions there will only be one root event id. For multi-command submissions you get one per command. There is one slight caveat: createAndExercise produces both a create event and an exercise event so in that case one command maps to two root events.

A common usecase for root events is to traverse the transaction tree in execution order where you start with the root event ids and then traverse each node before traversing its children.

← Back to Discussions