Skip to content

Commit

Permalink
log bootnodes and static nodes list at debug level (hyperledger#6273)
Browse files Browse the repository at this point in the history
* log bootnodes and static nodes list at debug level

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>

* log if zero bootnodes

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>

* null safeguards

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>

---------

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
Signed-off-by: jflo <justin+github@florentine.us>
  • Loading branch information
macfarla authored and jflo committed Dec 12, 2023
1 parent ce148f6 commit 012b3db
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions besu/src/main/java/org/hyperledger/besu/cli/BesuCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -2120,8 +2120,6 @@ private void configure() throws Exception {
instantiateSignatureAlgorithmFactory();

logger.info(generateConfigurationOverview());
logger.info("Connecting to {} static nodes.", staticNodes.size());
logger.trace("Static Nodes = {}", staticNodes);
logger.info("Security Module: {}", securityModuleName);
}

Expand Down Expand Up @@ -3119,9 +3117,14 @@ private EthNetworkConfig updateNetworkConfig(final NetworkName network) {
if (listBootNodes != null) {
if (!p2PDiscoveryOptionGroup.peerDiscoveryEnabled) {
logger.warn("Discovery disabled: bootnodes will be ignored.");
} else {
logger.info("Configured {} bootnodes.", listBootNodes.size());
logger.debug("Bootnodes = {}", listBootNodes);
}
DiscoveryConfiguration.assertValidBootnodes(listBootNodes);
builder.setBootNodes(listBootNodes);
} else {
logger.info("0 Bootnodes configured");
}
return builder.build();
}
Expand Down Expand Up @@ -3224,7 +3227,11 @@ private Set<EnodeURL> loadStaticNodes() throws IOException {
staticNodesPath = dataDir().resolve(staticNodesFilename);
}
logger.debug("Static Nodes file: {}", staticNodesPath);
return StaticNodesParser.fromPath(staticNodesPath, getEnodeDnsConfiguration());
final Set<EnodeURL> staticNodes =
StaticNodesParser.fromPath(staticNodesPath, getEnodeDnsConfiguration());
logger.info("Connecting to {} static nodes.", staticNodes.size());
logger.debug("Static Nodes = {}", staticNodes);
return staticNodes;
}

private List<EnodeURL> buildEnodes(
Expand Down

0 comments on commit 012b3db

Please sign in to comment.