Two robots
This guide runs a payer and a payee side by side, each with its own wallet and
its own payment_node, using ROS namespaces.
On one machine
Create two wallets:
ros2 run robopay_core robopay wallet create --label robot-a
ros2 run robopay_core robopay wallet create --label robot-b
Start one node per robot, each in its own namespace:
# terminal 1
ros2 run robopay_core payment_node --ros-args -r __ns:=/robot_a \
-p backend:=self_custody -p chain:=base-sepolia -p signature_exchange:=true
# terminal 2
ros2 run robopay_core payment_node --ros-args -r __ns:=/robot_b \
-p backend:=self_custody -p chain:=base-sepolia -p signature_exchange:=true
Services are now namespaced: /robot_a/transfer/send,
/robot_b/escrow/sign, and so on. The signature topic /escrow/signatures
is absolute, so both robots share it.
Each node only holds its own key. Robot A cannot sign for robot B.
On two machines
Run one node per machine with the same ROS_DOMAIN_ID. The machines must be
able to reach each other over DDS, which normally means the same local network
with multicast allowed.
Note
Docker Desktop on Windows and macOS does not pass LAN multicast into containers, so a node inside such a container will not discover a node on another machine. Run on Linux hosts, or configure a DDS discovery server.
Different owners
When the two robots belong to different people, each owner creates and funds their own wallet on their own robot. Neither needs anything from the other except an address. Use escrow rather than direct payment.