Configuration/creation of particle mesh network? Updation of mesh network during removal of node?

I have 3 queries regarding the particle mesh network. The project I will be working on requires a couple of xenons(8-9) connected to an argon gateway relaying real time sensor data to the cloud, using a mesh network. My questions are:-

  1. Since particle mesh is based on thread(which is fail-safe), during network creation if a leader node fails, then how is the network created? Does another end node automatically take over as a leader?
  2. Suppose I want to remove or replace an end node from my network, then how does the network get updated regarding this? Is it automatic or is some kind of manual configuration required?
  3. Lastly, I want to connect the argon to my own cloud to process the sensor data rather than use particle’s cloud, is it possible?
    Any sample programs to help me with these queries are also welcome.
  1. What do you consider a leader?
    All nodes are also routers/repeaters while they are active - currently there is no way to demote a given node to be a pure end-node without participating in the mesage routing.
    There is also no dedicated leader but there usually is (currently one and only) one gateway which bridges between the mesh and the cloud.

  2. Any given node can "disappear" from the mesh at any given time to which the mesh will automatically adopt. As long the topography of your mesh allows all remaining nodes will still be able to communicate with eachother as mesh communication is broadcasted within the mesh. A topoligy breaks/fracture may cause two or more independent mesh networks that will still "function" but may have difficulty finding back together and only the one fraction with the gateway will be able to communicate with the outside world.
    There is no explicit way to replace a device but removing one and adding another is always possible.

  3. This is possible. Depending on your definition of cloud this may be more or less complicated tho'

Since all of the above is the default behaviour without special code required there is little we can show in terms of sample code :wink:

Can the mesh handle rerouting on it's own, if it's not predefined within the code?

Any given node can “disappear” from the mesh at any given time to which the mesh will automatically adopt. As long the topography of your mesh allows all remaining nodes will still be able to communicate with eachother as mesh communication is broadcasted within the mesh. A topoligy breaks/fracture may cause two or more independent mesh networks that will still “function” but may have difficulty finding back together and only the one fraction with the gateway will be able to communicate with the outside world.
There is no explicit way to replace a device but removing one and adding another is always possible.

Say, if I have 2 router nodes to a gateway with 2 edge nodes for each router, which are just within the distance of each router, would the mesh be able to automatically subscribe and route the mesh data through the other router if one goes down without explictely doing so in the application code?

Thanks in advance!