Quickstart
Peer-to-Peer Messaging with hyveOS
Quickstart Setup. Two Raspberry Pi 5s with hyveOS installed.
Neither is connected to the Internet.
Peer-to-peer messaging is a fundamental building block of decentralized applications.
Prerequisite
Make sure you have access to two machines,
from now on called node0
and node1
,
having installed hyveOS
.
It can your robots.
Also, be sure that all of your docker
permissions are set up correctly.
E.g., per usual, the user on the node needs permission to talk to the Docker daemon through the Unix socket.
Hello World
Now that hyveOS
is installed, we are ready to do some application development.
In this introductory Hello World Quick Start,
we focus on you understanding how to deploy and run an application and to get a feeling for the effects of hyveOS. We will:
- Deploy a containerized decentral application from
node0
to bothnode0
andnode1
- Observe a simple peer-to-peer message exchange between the nodes
Deploying the application
We will leverage hyveOS
application distribution system and will start the Hello World application for both nodes from node0
.
For this, we will need the ID of node1
as well as the Hello World application, which, for the sake of this Quickstart, we already built for you to download on node0
.
Identify node1
To get node1
’s id, run the following on node1
Copy the <ID>
.
Pull the Docker image
Pull our pre-built Hello-World application only to node0
. Run on node0
Deploy the Application to both nodes
We are now using hyvectl to deploy the Hello World application to
both nodes only from node0
.
As initial deployment can take a few seconds,
you want to begin with deploying to node 1
, from node0
.
To deploy and start the application on node1
through node 0
, run on node0
first:
where <ID>
is the ID of node1
, you copied from the previous step.
To then start the application on node0
, run on node0
Output
That’s it! You have successfully used hyveOS to send messages from node 1
to node 0
and vice versa.
hyveOS took care of distributing and starting the application automatically.
You should now see the communication between the nodes in both terminals using the appropriate Docker commands.
If you want to dive deeper into the code and understand application, or need to see commands for viewing the output, check out the Hello World Full Tutorial.
Terminate the Loop
What does the application do?
Hello World Code
node 0
will discover node 1
and vice versa.
Once they have found each other, they both subscribe to the topic greetings
.
Everyone subscribed to greetings
will receive all the messages someone else sends
into the topic—our decentralized pub-sub system will take care of that.
Both nodes will periodically send the message Hello from <own_node_id>
into greetings
and each will receive
and print the message of the form Hello from <other_node_id>
from the other one.
Note the loop in the node
function. You will see a bunch of messages.
© 2025 P2P Industries. This documentation is licensed under the MIT License.
Cookie Policy
Privacy Policy