Creating a private network of Raspberry Pi Nodes

Hello All,

I am a little confused on the use case of a private network.

So currently I wish to create a network of nodes which are all Rpi. As per the documentation I managed to make a private network just as in the sample template.json having 2 nodes ~/net1/Node and ~/net1/Primary on a single Rpi(lets call it Rpi1). I could start the node and the network . Now my question is how do we connect new Rpi(lets call it Rpi2) devices as nodes on this private network running on Rpi1.

  • I copied the genesis.json of the private network to the new Rpi2 and started the node using the command
    ./goal start node -d ~/node/data
  • One suggestion which I read was using the option -p “Rpi1_ip:algod-listen.net port of Rpi1”. But not sure if it is required as it starts without the -p options also.
  • One suggestion was using the testnet but I want to run a closed network with only the Rpi nodes for a benchmark application so why the testnet in that case. Is a private network only for running multiple nodes on a single standalone system?
  • Any changes to the config.json are required or does it also have to be copied along with the genesis.json?
  • How do we know if Rpi2 is connected to the private network hosted by Rpi1?
  • Documentation on switching networks to a private network and then connecting nodes to the same private network would be useful.

Thank you All.

@anupcoded,

When running a private network on a single device, you traditionally use the “goal network XXX” commands, which helps you to achieve that.

I don’t know what your goal here, so I’ll assume it’s primarily for testing and not for commercially deploying a permanent network. ( i.e. might require some DNS tinkering, which you’d rather avoid ).

In a nutshell, what you’d like to do is to have the two nodes sharing the same genesis file, and having:

  1. one relay node. This node need to have it’s NetAddress configured in it’s config.json file. ( let’s say it’s running on Rpi1 )
  2. one non-relay node. This one need to be invoked using goal node start -d <data dir> -p <the ip address of Rpi1:port>

As a prerequisite, both devices need to be connected to the same network and able to communicate with each other.

Regarding performance testing on testnet - I would generally advise against it. When running various tests on testnet, you share a network with others. I don’t know how beneficial that would be, as the results might get skewed by 3rd party transactions.
On the other hand, testing it on Raspberry PI might no be the best idea either - these devices are pretty weak, and would not get to the performance characteristics you’d see from any commercial deployed network.

Running a private network on a single computer is a great way to emulate the functional correctness of the various Algorand platform components, while excluding the network as a medium. Since all the communication between the nodes is over TCP, it’s pretty trivial to move these to the cloud and test it there later on.

Regarding the config.json changes you’ve asked - no I don’t think that on the non-relay node you would need any particular settings there.

It’s pretty easy to tell if Rpi2 is connected to the network. Assuming that Rpi2 has no accounts on it, just start it and watch the round number. If the round number is going up, it means that the network is advancing. The Rpi2 node would not be able to do that without having any algos ( which it doesn’t, since we’ve already confirmed that… ) or by being connected to the Rpi1 network.

Note that while this isn’t a “complicated” setup, it’s not a typical installation either, so you might need to do some trial and error here.

Hope that this would help.

Awesome!! Thank you Tsachi.

The primary purpose is for testing .

Like you said the NetAddress is the key property here.

I would like to point out that when setting the NetAddress please use the ip of the device rather than setting it to the default 127.0.0.1:port. eg(192.168.x.x:7667)
Just copy the gensis.json and while starting the node use:
goal node start -d -p
It works like a charm!!!

Thank you for your help.

1 Like