Skip to content

Commit

Permalink
addressing some of the feedback during PR Review
Browse files Browse the repository at this point in the history
Signed-off-by: Alfredo Gutierrez <[email protected]>
  • Loading branch information
AlfredoG87 committed Aug 7, 2024
1 parent 3057f7c commit 77fb265
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,16 @@
import com.swirlds.config.api.ConfigurationExtension;
import java.util.Set;

/** Registers configuration types for the server. */
@AutoService(ConfigurationExtension.class)
public class BlockNodeConfigExtension implements ConfigurationExtension {

/**
* {@inheritDoc}
*
* @return Set of configuration data types for the server
*/
@Override
public Set<Class<? extends Record>> getConfigDataTypes() {
return Set.of(BasicCommonConfig.class, MetricsConfig.class, PrometheusConfig.class);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,13 @@
import com.swirlds.config.api.Configuration;
import com.swirlds.metrics.api.Metrics;

/**
* Context for the block node. This record is returned by the BlockNodeContextFactory when a new
* configuration is created.
*
* @param metrics the metrics used for monitoring and reporting
* @param metricsService the service responsible for handling metrics
* @param configuration the configuration settings for the block node
*/
public record BlockNodeContext(
Metrics metrics, MetricsService metricsService, Configuration configuration) {}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import java.io.IOException;
import java.nio.file.Path;

/** Static factory that creates {@link BlockNodeContext} */
public class BlockNodeContextFactory {
private static final System.Logger logger =
System.getLogger(BlockNodeContextFactory.class.getName());
Expand All @@ -35,6 +36,10 @@ public class BlockNodeContextFactory {

private BlockNodeContextFactory() {}

/**
* @return an instance of {@link BlockNodeContext} which holds {@link Configuration}, {@link
* Metrics} and {@link MetricsService} for the rest of the application to use.
*/
public static BlockNodeContext create() {
final Configuration configuration = getConfiguration();
final Metrics metrics = getMetrics(configuration);
Expand Down
15 changes: 9 additions & 6 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,19 @@ gradleEnterprise {
dependencyResolutionManagement {
versionCatalogs {
create("libs") {
// define a constant for the com.swirlds version, since they are all in lockstep
val swirldsVersion = "0.51.5"

// Compile time dependencies
version("com.google.protobuf", "3.24.0")
version("io.helidon.webserver.http2", "4.0.10")
version("io.helidon.webserver.grpc", "4.0.10")
version("com.swirlds.metrics.api","0.51.5")
version("com.swirlds.metrics.impl","0.51.5")
version("com.swirlds.common", "0.51.5")
version("com.swirlds.config.impl", "0.51.5")
version("com.swirlds.config.processor", "0.51.5")
version("com.swirlds.config.extensions", "0.51.5")
version("com.swirlds.metrics.api", swirldsVersion)
version("com.swirlds.metrics.impl", swirldsVersion)
version("com.swirlds.common", swirldsVersion)
version("com.swirlds.config.impl", swirldsVersion)
version("com.swirlds.config.processor", swirldsVersion)
version("com.swirlds.config.extensions", swirldsVersion)
version("com.google.auto.service.processor", "1.1.1")
version("com.google.auto.service", "1.1.1")
version("org.hyperledger.besu.nativelib.secp256k1", "0.8.2")
Expand Down

0 comments on commit 77fb265

Please sign in to comment.