> ## Documentation Index
> Fetch the complete documentation index at: https://docs.peaq.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Event Streams

> Subscribe to blockchain events and transaction lifecycles from ROS 2.

The ROS 2 event pipeline keeps operators and autonomy stacks informed about blockchain activity in real time. `events_node` converts SDK callbacks into ROS topics so you can react to confirmations, failures, or custom pallet events without polling.

## Topics

| Topic            | Type                                | Description                                                                |
| ---------------- | ----------------------------------- | -------------------------------------------------------------------------- |
| `peaq/tx_status` | `peaq_ros2_interfaces/msg/TxStatus` | Transaction lifecycle updates (`PENDING`, `IN_BLOCK`, `FINALIZED`, errors) |
| `peaq/events`    | `peaq_ros2_interfaces/msg/Event`    | Raw blockchain events emitted by pallets (identity, storage, access, etc.) |

Both topics are QoS-configured for reliability in distributed robot fleets.

## Launch Events Node

Events node starts automatically with `core.launch.py`. To run it on its own:

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
ros2 run peaq_ros2_core events_node --ros-args \
  -p config_yaml:=/work/peaq_ros2_examples/config/peaq_robot.yaml

ros2 lifecycle set /peaq_events_node configure
ros2 lifecycle set /peaq_events_node activate
```

## Monitor Transactions

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
ros2 topic echo /peaq/tx_status
```

Example output:

```text theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
phase: IN_BLOCK
hash: 0x9b060b42...
details:
  confirmation_mode: FAST
  endpoint: identity.create
  submitted_at: "2025-10-30T10:05:31Z"
```

Use the metadata to drive dashboards, emit alerts, or trigger retries in application logic.

## Subscribe to Events

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
ros2 topic echo /peaq/events --qos-reliability reliable
```

Events include pallet name, method, and payload JSON. Example for a DID creation:

```text theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
pallet: identity
method: IdentityCreated
payload: '{"owner":"did:peaq:5G...","metadata":{"fleet":"warehouse_drivers"}}'
```

## Integrate with Autonomy Stacks

* Feed `peaq/tx_status` into behavior trees to wait for blockchain confirmation before executing moves.
* Use `peaq/events` to trigger ROS actions (e.g., start storage ingestion once a DID is acknowledged).
* Attach event subscribers to logging pipelines for compliance and analytics.

## Troubleshooting

* If events stop flowing, check lifecycle state: `ros2 lifecycle get /peaq_events_node`.
* Review `/tmp/events_node.log` for connection or authentication issues.
* Ensure `PEAQ_ROBOT_EVENTS_ENABLED=true` is set when relying on environment variables.

With event streaming in place you have an end-to-end feedback loop across identity, access, and storage operations. Pair this with the [Messaging Index](/peaqchain/sdk-reference/robotics-sdk/ros2/messaging/topics) and [Verifiable Storage](/peaqchain/sdk-reference/robotics-sdk/ros2/messaging/verifiable-storage) to cover every messaging pathway.
