pub async fn refresh_node_registry(
node_registry: &mut NodeRegistry,
service_control: &dyn ServiceControl,
print_refresh_message: bool,
full_refresh: bool,
is_local_network: bool,
) -> Result<()>Expand description
Refreshes the status of the node registry’s services.
The mechanism is different, depending on whether it’s a service-based network or a local network.
For a service-based network, at a minimum, the refresh determines if each service is running. It does that by trying to find a process whose binary path matches the path of the binary for the service. Since each service uses its own binary, the path is a unique identifer. So you can know if any particular service is running or not. A full refresh uses the RPC client to connect to the node’s RPC service to determine things like the number of connected peers.
For a local network, the node paths are not unique, so we can’t use that. We consider the node running if we can connect to its RPC service; otherwise it is considered stopped.