Skip to main content
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

TopicTypeDescription
peaq/tx_statuspeaq_ros2_interfaces/msg/TxStatusTransaction lifecycle updates (PENDING, IN_BLOCK, FINALIZED, errors)
peaq/eventspeaq_ros2_interfaces/msg/EventRaw 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:
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

ros2 topic echo /peaq/tx_status
Example output:
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

ros2 topic echo /peaq/events --qos-reliability reliable
Events include pallet name, method, and payload JSON. Example for a DID creation:
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 and Verifiable Storage to cover every messaging pathway.