Trackers API - Algorand Specifications

Keyboard shortcuts

Press ← or → to navigate between chapters
Press S or / to search in the book
Press ? to show this help
Press Esc to hide this help

Algorand Specifications

Each Tracker exposes tracker-specific APIs to access the state it maintains.

Important

IMPLEMENTATION:

Tracker reference implementation.

Trackers can access the Ledger via a restricted interface called ledgerForTracker,
which grants access to the Ledger’s SQLite database, recent blocks, and other read-only
functionality.

In the other direction, the Ledger communicates with Trackers using the ledgerTracker
interface, which includes the following key methods:

Initializes the state of the Tracker. The Tracker can use the ledgerForTracker
argument to:

Notifies the Tracker of a newly added block at round rnd. The accompanying delta
parameter contains the state changes introduced by this block (see block evaluation\
section
).

Informs the Tracker that all blocks up to and including rnd are written to persistent
storage. This call is crucial for stateful trackers, as it ensures correct state
recovery and enables responses to queries about older blocks if recent uncommitted
ones are lost after a crash.

Releases any resources or memory held by the Tracker.

The reference implementation ensures that all updates to Trackers are thread-safe
using a reader-writer lock.