Skip to main content

Consensus Barrier

A consensus barrier allows you to ensure that all participants have performed a required action before the simulation can move forward. A participant who has taken a required action is said to have arrived at the barrier.

Timer

Barriers often have a time limit associated with them. In this case, once the time runs out, a default action is taken on behalf of those participants who haven't arrived.

The barrier's timer can be paused to allow participants more time.

Once all the participants have arrived, or the time limit has expired, the barrier is said to be triggered.

Note

The barrier doesn't actually keep an active timer. Instead, we keep track of when it was initiated. The barrier is triggered only if it is pinged after its time limit has been reached.

Transparency

A barrier is said to be transparent if the participants' decisions are submitted directly to the model when the barrier is triggered.

Roles

When we talk about a role in the context of barriers, we are referring to a world persona and the number of participants with that persona. In other words, the number of people playing a specific role in the game who must arrive at the barrier for the game to move forward.

Unique identifier

A barrier is always created for a world and is uniquely identified by the world key, a name, and a stage. The name and stage are strings.

learn more

The consensus adapter in the JS libraries provides functionality for managing consensus barriers.