Skip to content

Browse state and watch live events

Goal: look up what is stored in the state store (configuration, order books, indicator values, ...) and follow the CloudEvents published on chosen topics, live.

Prerequisites

Browse state

  1. Open States: Infra top tab, 4 (States) in the default layout.
  2. Narrow the list: press / and type a filter, e.g. name:cfg.*, kind:orderbook BTC_USDT, name:cfg.* -name:*.index. Enter keeps it, Esc clears it. The status line shows how many keys pass (3/54). Language: Keybindings › Filtering.
  3. Tree view (optional): T splits the keys at ., each node with its key count.
  4. Open a key: highlight it, Enter. Its value shows in its first representation (an order book as a ladder, a number at full precision, JSON as a tree).
    • v — next representation (e.g. JSON tree → indented JSON).
    • h — switch to the key's stream (each value read while the pane is shown; a number as a line plot over time) and back.
    • Esc — back to the list.

The pane lists up to 1000 keys and reads the store every 2 s while shown. It is read-only: the TUI has no key to edit or delete a state entry (a script can, Write and run a script).

Watch live events

  1. Open Events: Infra top tab, 8 (Events).
  2. Subscribe to topics: press a. In the picker, type to narrow the list (presets, the topics feeds publish and workers listen on, every topic the api saw in the last 7 days), space to select topics, then Add. A topic nobody used yet can be typed in the box below the list. The subscribed topics are saved in the TUI's state (~/.local/state/virtufin/tui/state.json) for the next start.
  3. Read the log: newest events arrive at the bottom.
    • space — pause / resume (events received while paused are written on resume);
    • c — clear the log;
    • / — filter, e.g. type:*.gap -name:sys.*;
    • w / t — wall-clock / message (CloudEvent time) timestamp column;
    • T — topic tree beside the log; Enter on a topic opens its stream (v, h, Esc as for state keys), on a node its events, on the root all.
  4. Unsubscribe: d, pick the topics to remove.

The default subscription is the state-change topics (state saved / deleted).

What you should see

  • States: one row per key with its value on one line.
  • Events: per event <time> <type> on <topic> @ <source> (<id>…), then its payload (JSON indented); the status line lists the subscribed topics.

Troubleshooting

Symptom Cause and fix
The States status line says the store has more Over 1000 keys: QueryState has no paging; filter with /.
A key's value does not update Most writes (workers' state, order books, accounts) publish no change event; the pane rereads every 2 s only while shown.
reconnecting... on Events The stream retries a transient failure by itself.
events: error: <reason> and no more retries The api rejected a topic for good (e.g. a state key such as api\|\|act.exchange... pasted as a topic). Remove it with d.
The topic list in the picker is short and the status line names an error Pubsub.ListTopics failed; type the topic in the box instead.
A filter line turns red The expression does not parse; the status line says why.

From the AI tab: state__get, state__keys, topics__list, topics__read (the next events on topics) (The TUI's API). Reference: Keybindings › States, › Events, › Representations.