MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / is_bootstrapping_node

Function is_bootstrapping_node

nodedb/src/control/cluster/tls.rs:152–159  ·  view source on GitHub ↗

A node is treated as a bootstrapper if either: - `force_bootstrap = true` (operator override), or - it is the lexicographically smallest seed and its `listen` address is among the seeds (the standard single-node / first-in-cluster path).

(settings: &ClusterSettings)

Source from the content-addressed store, hash-verified

150/// - it is the lexicographically smallest seed and its `listen` address is
151/// among the seeds (the standard single-node / first-in-cluster path).
152fn is_bootstrapping_node(settings: &ClusterSettings) -> bool {
153 if settings.force_bootstrap {
154 return true;
155 }
156 let mut seeds = settings.seed_nodes.clone();
157 seeds.sort();
158 seeds.first() == Some(&settings.listen) && seeds.contains(&settings.listen)
159}
160
161fn load_from_paths(paths: &TlsPaths, tls_dir: &Path) -> crate::Result<TlsCredentials> {
162 let cert = read_single_cert(&paths.cert)?;

Callers 1

resolve_credentialsFunction · 0.85

Calls 3

firstMethod · 0.80
cloneMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected