A method, apparatus, and computer program product is provided for configuring a microgrid. A first configuration of the microgrid having a set of microgrid elements is initialized. An address for each element in the set of microgrid elements of the microgrid is verified. In response to receiving status data from the set of microgrid elements connected in a peer-to-peer network indicating a reconfiguration of the microgrid, the set of microgrid elements is re-aligned to form a second grid configuration. The second grid configuration is executed.