Skip to content

Inspect the signed event bus

Node events flow through the PLEXSPHERE_NODE_EVENTS JetStream stream, driven by an outbox poller whose high-water mark is the plexsphere.sse_relay_cursor Postgres row. There is no plexctl events command yet, so this guide uses the nats CLI and psql.

Prerequisites

  • The nats CLI configured against the deployment's JetStream.
  • Read access to the plexsphere Postgres role.

Steps

Inspect the stream

shell
nats stream info PLEXSPHERE_NODE_EVENTS
# State:
#   Messages: 1,284   First Seq: 1   Last Seq: 1,284
nats stream view PLEXSPHERE_NODE_EVENTS --raw --count 1
# {"event_type":"peer_registered","occurred_at":"2026-04-27T10:15:30Z",…}

Each message carries a Nats-Msg-Id header equal to the originating outbox row's UUID; JetStream uses it for dedup.

Inspect the relay cursor

sql
SELECT stream_name, last_published_seq
FROM plexsphere.sse_relay_cursor
WHERE stream_name = 'PLEXSPHERE_NODE_EVENTS';
-- stream_name            | last_published_seq
-- PLEXSPHERE_NODE_EVENTS | 1284
-- (1 row)

Force a re-publish from a known point

Lower the cursor to re-emit envelopes. Nats-Msg-Id dedup makes the replay safe — envelopes already on the stream are dropped:

sql
UPDATE plexsphere.sse_relay_cursor SET last_published_seq = <seq>
WHERE stream_name = 'PLEXSPHERE_NODE_EVENTS';
-- UPDATE 1

Verification

shell
nats stream view PLEXSPHERE_NODE_EVENTS --count 5
# [1] Subject: …  {"event_type":"peer_registered",…}
# [2] Subject: …  {"event_type":"peer_psk_assigned",…}
# … (deduped by Nats-Msg-Id, so re-emitted envelopes appear once)

The expected envelopes reappear without duplicates.

See also