And what is your question? Do you want us to write the code for you?
I can see couple of challenges you should tackle in order to solve this problem
1) Create static nodes --> it is explained in the documentation and there are several examples using it
2) Send Hello Packets --> again in the tutorial you can learn how to send traffic to other nodes
3) In com. range --> I assume you will use WiFi and the topic of setting the communication range is discussed hundreds of times in the mailing list.
4) Receiving Nodes should send ACKs --> see (2) and applications such as Ping
5) the main node ... --> you lost me here. You started saying that _EVERY_ node sends hellos, not a single _main_. And what happens after it receives the ACK? Another send?
Please study the tutorial and think of your design better.