Search in sources :

Example 1 with GraphQLConfiguration

use of org.hyperledger.besu.ethereum.api.graphql.GraphQLConfiguration in project besu by hyperledger.

the class RunnerBuilder method build.

public Runner build() {
    Preconditions.checkNotNull(besuController);
    final DiscoveryConfiguration discoveryConfiguration = DiscoveryConfiguration.create().setBindHost(p2pListenInterface).setBindPort(p2pListenPort).setAdvertisedHost(p2pAdvertisedHost);
    if (discovery) {
        final List<EnodeURL> bootstrap;
        if (ethNetworkConfig.getBootNodes() == null) {
            bootstrap = EthNetworkConfig.getNetworkConfig(NetworkName.MAINNET).getBootNodes();
        } else {
            bootstrap = ethNetworkConfig.getBootNodes();
        }
        discoveryConfiguration.setBootnodes(bootstrap);
        discoveryConfiguration.setDnsDiscoveryURL(ethNetworkConfig.getDnsDiscoveryUrl());
    } else {
        discoveryConfiguration.setActive(false);
    }
    final NodeKey nodeKey = besuController.getNodeKey();
    final SubProtocolConfiguration subProtocolConfiguration = besuController.getSubProtocolConfiguration();
    final ProtocolSchedule protocolSchedule = besuController.getProtocolSchedule();
    final ProtocolContext context = besuController.getProtocolContext();
    final List<SubProtocol> subProtocols = subProtocolConfiguration.getSubProtocols();
    final List<ProtocolManager> protocolManagers = subProtocolConfiguration.getProtocolManagers();
    final Set<Capability> supportedCapabilities = protocolManagers.stream().flatMap(protocolManager -> protocolManager.getSupportedCapabilities().stream()).collect(Collectors.toSet());
    final RlpxConfiguration rlpxConfiguration = RlpxConfiguration.create().setBindHost(p2pListenInterface).setBindPort(p2pListenPort).setMaxPeers(maxPeers).setSupportedProtocols(subProtocols).setClientId(BesuInfo.nodeName(identityString)).setLimitRemoteWireConnectionsEnabled(limitRemoteWireConnectionsEnabled).setFractionRemoteWireConnectionsAllowed(fractionRemoteConnectionsAllowed);
    networkingConfiguration.setRlpx(rlpxConfiguration).setDiscovery(discoveryConfiguration);
    final PeerPermissionsDenylist bannedNodes = PeerPermissionsDenylist.create();
    bannedNodeIds.forEach(bannedNodes::add);
    final List<EnodeURL> bootnodes = discoveryConfiguration.getBootnodes();
    final Synchronizer synchronizer = besuController.getSynchronizer();
    final TransactionSimulator transactionSimulator = new TransactionSimulator(context.getBlockchain(), context.getWorldStateArchive(), protocolSchedule);
    final Bytes localNodeId = nodeKey.getPublicKey().getEncodedBytes();
    final Optional<NodePermissioningController> nodePermissioningController = buildNodePermissioningController(bootnodes, synchronizer, transactionSimulator, localNodeId, context.getBlockchain());
    final PeerPermissions peerPermissions = nodePermissioningController.map(nodePC -> new PeerPermissionsAdapter(nodePC, bootnodes, context.getBlockchain())).map(nodePerms -> PeerPermissions.combine(nodePerms, bannedNodes)).orElse(bannedNodes);
    LOG.info("Detecting NAT service.");
    final boolean fallbackEnabled = natMethod == NatMethod.AUTO || natMethodFallbackEnabled;
    final NatService natService = new NatService(buildNatManager(natMethod), fallbackEnabled);
    final NetworkBuilder inactiveNetwork = caps -> new NoopP2PNetwork();
    final NetworkBuilder activeNetwork = caps -> DefaultP2PNetwork.builder().vertx(vertx).nodeKey(nodeKey).config(networkingConfiguration).peerPermissions(peerPermissions).metricsSystem(metricsSystem).supportedCapabilities(caps).natService(natService).randomPeerPriority(randomPeerPriority).storageProvider(storageProvider).forkIdSupplier(forkIdSupplier).p2pTLSConfiguration(p2pTLSConfiguration).build();
    final NetworkRunner networkRunner = NetworkRunner.builder().protocolManagers(protocolManagers).subProtocols(subProtocols).network(p2pEnabled ? activeNetwork : inactiveNetwork).metricsSystem(metricsSystem).build();
    final P2PNetwork network = networkRunner.getNetwork();
    // ForkId in Ethereum Node Record needs updating when we transition to a new protocol spec
    context.getBlockchain().observeBlockAdded(blockAddedEvent -> {
        if (protocolSchedule.streamMilestoneBlocks().anyMatch(blockNumber -> blockNumber == blockAddedEvent.getBlock().getHeader().getNumber())) {
            network.updateNodeRecord();
        }
    });
    nodePermissioningController.ifPresent(n -> n.setInsufficientPeersPermissioningProvider(new InsufficientPeersPermissioningProvider(network, bootnodes)));
    final TransactionPool transactionPool = besuController.getTransactionPool();
    final MiningCoordinator miningCoordinator = besuController.getMiningCoordinator();
    final BlockchainQueries blockchainQueries = new BlockchainQueries(context.getBlockchain(), context.getWorldStateArchive(), Optional.of(dataDir.resolve(CACHE_PATH)), Optional.of(besuController.getProtocolManager().ethContext().getScheduler()), apiConfiguration);
    final PrivacyParameters privacyParameters = besuController.getPrivacyParameters();
    final FilterManager filterManager = new FilterManagerBuilder().blockchainQueries(blockchainQueries).transactionPool(transactionPool).privacyParameters(privacyParameters).build();
    vertx.deployVerticle(filterManager);
    createPrivateTransactionObserver(filterManager, privacyParameters);
    final P2PNetwork peerNetwork = networkRunner.getNetwork();
    final MiningParameters miningParameters = besuController.getMiningParameters();
    Optional<StratumServer> stratumServer = Optional.empty();
    if (miningParameters.isStratumMiningEnabled()) {
        var powMiningCoordinator = miningCoordinator;
        if (miningCoordinator instanceof TransitionCoordinator) {
            LOG.debug("fetching powMiningCoordinator from TransitionCoordinator");
            powMiningCoordinator = ((TransitionCoordinator) miningCoordinator).getPreMergeObject();
        }
        stratumServer = Optional.of(new StratumServer(vertx, powMiningCoordinator, miningParameters.getStratumPort(), miningParameters.getStratumNetworkInterface(), miningParameters.getStratumExtranonce(), metricsSystem));
        miningCoordinator.addEthHashObserver(stratumServer.get());
        LOG.debug("added ethash observer: {}", stratumServer.get());
    }
    sanitizePeers(network, staticNodes).map(DefaultPeer::fromEnodeURL).forEach(peerNetwork::addMaintainedConnectionPeer);
    final Optional<NodeLocalConfigPermissioningController> nodeLocalConfigPermissioningController = nodePermissioningController.flatMap(NodePermissioningController::localConfigController);
    final Optional<AccountPermissioningController> accountPermissioningController = buildAccountPermissioningController(permissioningConfiguration, besuController, transactionSimulator, context.getBlockchain());
    final Optional<AccountLocalConfigPermissioningController> accountLocalConfigPermissioningController = accountPermissioningController.flatMap(AccountPermissioningController::getAccountLocalConfigPermissioningController);
    Optional<JsonRpcHttpService> jsonRpcHttpService = Optional.empty();
    if (jsonRpcConfiguration.isEnabled()) {
        final Map<String, JsonRpcMethod> nonEngineMethods = jsonRpcMethods(protocolSchedule, context, besuController, peerNetwork, blockchainQueries, synchronizer, transactionPool, miningCoordinator, metricsSystem, supportedCapabilities, jsonRpcConfiguration.getRpcApis().stream().filter(apiGroup -> !apiGroup.toLowerCase().startsWith("engine")).collect(Collectors.toList()), filterManager, accountLocalConfigPermissioningController, nodeLocalConfigPermissioningController, privacyParameters, jsonRpcConfiguration, webSocketConfiguration, metricsConfiguration, natService, besuPluginContext.getNamedPlugins(), dataDir, rpcEndpointServiceImpl);
        jsonRpcHttpService = Optional.of(new JsonRpcHttpService(vertx, dataDir, jsonRpcConfiguration, metricsSystem, natService, nonEngineMethods, new HealthService(new LivenessCheck()), new HealthService(new ReadinessCheck(peerNetwork, synchronizer))));
    }
    Optional<JsonRpcService> engineJsonRpcService = Optional.empty();
    if (engineJsonRpcConfiguration.isPresent() && engineJsonRpcConfiguration.get().isEnabled()) {
        final Map<String, JsonRpcMethod> engineMethods = jsonRpcMethods(protocolSchedule, context, besuController, peerNetwork, blockchainQueries, synchronizer, transactionPool, miningCoordinator, metricsSystem, supportedCapabilities, engineJsonRpcConfiguration.get().getRpcApis(), filterManager, accountLocalConfigPermissioningController, nodeLocalConfigPermissioningController, privacyParameters, engineJsonRpcConfiguration.get(), webSocketConfiguration, metricsConfiguration, natService, besuPluginContext.getNamedPlugins(), dataDir, rpcEndpointServiceImpl);
        Optional<AuthenticationService> authToUse = engineJsonRpcConfiguration.get().isAuthenticationEnabled() ? Optional.of(new EngineAuthService(vertx, Optional.ofNullable(engineJsonRpcConfiguration.get().getAuthenticationPublicKeyFile()), dataDir)) : Optional.empty();
        WebSocketConfiguration engineSocketConfig = webSocketConfiguration.isEnabled() ? webSocketConfiguration : WebSocketConfiguration.createEngineDefault();
        engineJsonRpcService = Optional.of(new JsonRpcService(vertx, dataDir, engineJsonRpcConfiguration.orElse(JsonRpcConfiguration.createEngineDefault()), metricsSystem, natService, engineMethods, Optional.ofNullable(engineSocketConfig), besuController.getProtocolManager().ethContext().getScheduler(), authToUse, new HealthService(new LivenessCheck()), new HealthService(new ReadinessCheck(peerNetwork, synchronizer))));
    }
    Optional<GraphQLHttpService> graphQLHttpService = Optional.empty();
    if (graphQLConfiguration.isEnabled()) {
        final GraphQLDataFetchers fetchers = new GraphQLDataFetchers(supportedCapabilities, privacyParameters.getGoQuorumPrivacyParameters());
        final Map<GraphQLContextType, Object> graphQlContextMap = new ConcurrentHashMap<>();
        graphQlContextMap.putIfAbsent(GraphQLContextType.BLOCKCHAIN_QUERIES, blockchainQueries);
        graphQlContextMap.putIfAbsent(GraphQLContextType.PROTOCOL_SCHEDULE, protocolSchedule);
        graphQlContextMap.putIfAbsent(GraphQLContextType.TRANSACTION_POOL, transactionPool);
        graphQlContextMap.putIfAbsent(GraphQLContextType.MINING_COORDINATOR, miningCoordinator);
        graphQlContextMap.putIfAbsent(GraphQLContextType.SYNCHRONIZER, synchronizer);
        final GraphQL graphQL;
        try {
            graphQL = GraphQLProvider.buildGraphQL(fetchers);
        } catch (final IOException ioe) {
            throw new RuntimeException(ioe);
        }
        graphQLHttpService = Optional.of(new GraphQLHttpService(vertx, dataDir, graphQLConfiguration, graphQL, graphQlContextMap, besuController.getProtocolManager().ethContext().getScheduler()));
    }
    Optional<WebSocketService> webSocketService = Optional.empty();
    if (webSocketConfiguration.isEnabled()) {
        final Map<String, JsonRpcMethod> nonEngineMethods = jsonRpcMethods(protocolSchedule, context, besuController, peerNetwork, blockchainQueries, synchronizer, transactionPool, miningCoordinator, metricsSystem, supportedCapabilities, webSocketConfiguration.getRpcApis().stream().filter(apiGroup -> !apiGroup.toLowerCase().startsWith("engine")).collect(Collectors.toList()), filterManager, accountLocalConfigPermissioningController, nodeLocalConfigPermissioningController, privacyParameters, jsonRpcConfiguration, webSocketConfiguration, metricsConfiguration, natService, besuPluginContext.getNamedPlugins(), dataDir, rpcEndpointServiceImpl);
        final SubscriptionManager subscriptionManager = createSubscriptionManager(vertx, transactionPool, blockchainQueries);
        createLogsSubscriptionService(context.getBlockchain(), context.getWorldStateArchive(), subscriptionManager, privacyParameters);
        createNewBlockHeadersSubscriptionService(context.getBlockchain(), blockchainQueries, subscriptionManager);
        createSyncingSubscriptionService(synchronizer, subscriptionManager);
        webSocketService = Optional.of(createWebsocketService(vertx, webSocketConfiguration, subscriptionManager, nonEngineMethods, privacyParameters, protocolSchedule, blockchainQueries, DefaultAuthenticationService.create(vertx, webSocketConfiguration), metricsSystem));
        createPrivateTransactionObserver(subscriptionManager, privacyParameters);
    }
    Optional<MetricsService> metricsService = createMetricsService(vertx, metricsConfiguration);
    final Optional<EthStatsService> ethStatsService;
    if (!Strings.isNullOrEmpty(ethstatsUrl)) {
        ethStatsService = Optional.of(new EthStatsService(NetstatsUrl.fromParams(ethstatsUrl, ethstatsContact), blockchainQueries, besuController.getProtocolManager(), transactionPool, miningCoordinator, besuController.getSyncState(), vertx, BesuInfo.nodeName(identityString), besuController.getGenesisConfigOptions(), network));
    } else {
        ethStatsService = Optional.empty();
    }
    final Optional<JsonRpcIpcService> jsonRpcIpcService;
    if (jsonRpcIpcConfiguration.isEnabled()) {
        Map<String, JsonRpcMethod> ipcMethods = jsonRpcMethods(protocolSchedule, context, besuController, peerNetwork, blockchainQueries, synchronizer, transactionPool, miningCoordinator, metricsSystem, supportedCapabilities, jsonRpcIpcConfiguration.getEnabledApis().stream().filter(apiGroup -> !apiGroup.toLowerCase().startsWith("engine")).collect(Collectors.toList()), filterManager, accountLocalConfigPermissioningController, nodeLocalConfigPermissioningController, privacyParameters, jsonRpcConfiguration, webSocketConfiguration, metricsConfiguration, natService, besuPluginContext.getNamedPlugins(), dataDir, rpcEndpointServiceImpl);
        jsonRpcIpcService = Optional.of(new JsonRpcIpcService(vertx, jsonRpcIpcConfiguration.getPath(), new JsonRpcExecutor(new BaseJsonRpcProcessor(), ipcMethods)));
    } else {
        jsonRpcIpcService = Optional.empty();
    }
    return new Runner(vertx, networkRunner, natService, jsonRpcHttpService, engineJsonRpcService, graphQLHttpService, webSocketService, jsonRpcIpcService, stratumServer, metricsService, ethStatsService, besuController, dataDir, pidPath, autoLogBloomCaching ? blockchainQueries.getTransactionLogBloomCacher() : Optional.empty(), context.getBlockchain());
}
Also used : NoopP2PNetwork(org.hyperledger.besu.ethereum.p2p.network.NoopP2PNetwork) PermissioningConfiguration(org.hyperledger.besu.ethereum.permissioning.PermissioningConfiguration) NodeLocalConfigPermissioningController(org.hyperledger.besu.ethereum.permissioning.NodeLocalConfigPermissioningController) AuthenticationService(org.hyperledger.besu.ethereum.api.jsonrpc.authentication.AuthenticationService) WebSocketConfiguration(org.hyperledger.besu.ethereum.api.jsonrpc.websocket.WebSocketConfiguration) DockerDetector(org.hyperledger.besu.nat.docker.DockerDetector) FilterManagerBuilder(org.hyperledger.besu.ethereum.api.jsonrpc.internal.filter.FilterManagerBuilder) Map(java.util.Map) DiscoveryConfiguration(org.hyperledger.besu.ethereum.p2p.config.DiscoveryConfiguration) Objects.isNull(java.util.Objects.isNull) BesuPluginContextImpl(org.hyperledger.besu.services.BesuPluginContextImpl) NetworkUtility(org.hyperledger.besu.util.NetworkUtility) Path(java.nio.file.Path) ProtocolManager(org.hyperledger.besu.ethereum.p2p.network.ProtocolManager) PendingTransactionDroppedSubscriptionService(org.hyperledger.besu.ethereum.api.jsonrpc.websocket.subscription.pending.PendingTransactionDroppedSubscriptionService) FlexiblePrivacyPrecompiledContract(org.hyperledger.besu.ethereum.mainnet.precompiles.privacy.FlexiblePrivacyPrecompiledContract) NetworkingConfiguration(org.hyperledger.besu.ethereum.p2p.config.NetworkingConfiguration) ReadinessCheck(org.hyperledger.besu.ethereum.api.jsonrpc.health.ReadinessCheck) BlockchainQueries(org.hyperledger.besu.ethereum.api.query.BlockchainQueries) PeerPermissionsDenylist(org.hyperledger.besu.ethereum.p2p.permissions.PeerPermissionsDenylist) Set(java.util.Set) GraphQLProvider(org.hyperledger.besu.ethereum.api.graphql.GraphQLProvider) P2PNetwork(org.hyperledger.besu.ethereum.p2p.network.P2PNetwork) PrivateTransactionObserver(org.hyperledger.besu.ethereum.privacy.PrivateTransactionObserver) Stream(java.util.stream.Stream) SyncingSubscriptionService(org.hyperledger.besu.ethereum.api.jsonrpc.websocket.subscription.syncing.SyncingSubscriptionService) NewBlockHeadersSubscriptionService(org.hyperledger.besu.ethereum.api.jsonrpc.websocket.subscription.blockheaders.NewBlockHeadersSubscriptionService) WebSocketService(org.hyperledger.besu.ethereum.api.jsonrpc.websocket.WebSocketService) PendingTransactionSubscriptionService(org.hyperledger.besu.ethereum.api.jsonrpc.websocket.subscription.pending.PendingTransactionSubscriptionService) LogsSubscriptionService(org.hyperledger.besu.ethereum.api.jsonrpc.websocket.subscription.logs.LogsSubscriptionService) Capability(org.hyperledger.besu.ethereum.p2p.rlpx.wire.Capability) Predicate.not(java.util.function.Predicate.not) FLEXIBLE_PRIVACY(org.hyperledger.besu.ethereum.core.PrivacyParameters.FLEXIBLE_PRIVACY) JsonRpcExecutor(org.hyperledger.besu.ethereum.api.jsonrpc.execution.JsonRpcExecutor) LivenessCheck(org.hyperledger.besu.ethereum.api.jsonrpc.health.LivenessCheck) MetricsService(org.hyperledger.besu.metrics.MetricsService) JsonRpcProcessor(org.hyperledger.besu.ethereum.api.jsonrpc.execution.JsonRpcProcessor) AccountPermissioningController(org.hyperledger.besu.ethereum.permissioning.account.AccountPermissioningController) Bytes(org.apache.tuweni.bytes.Bytes) Supplier(java.util.function.Supplier) TLSConfiguration(org.hyperledger.besu.ethereum.p2p.rlpx.connections.netty.TLSConfiguration) KubernetesNatManager(org.hyperledger.besu.nat.kubernetes.KubernetesNatManager) ArrayList(java.util.ArrayList) ProtocolSchedule(org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule) PrivacyQueries(org.hyperledger.besu.ethereum.api.query.PrivacyQueries) Strings(com.google.common.base.Strings) FilterManager(org.hyperledger.besu.ethereum.api.jsonrpc.internal.filter.FilterManager) JsonRpcMethodsFactory(org.hyperledger.besu.ethereum.api.jsonrpc.methods.JsonRpcMethodsFactory) MiningCoordinator(org.hyperledger.besu.ethereum.blockcreation.MiningCoordinator) InsufficientPeersPermissioningProvider(org.hyperledger.besu.ethereum.permissioning.node.InsufficientPeersPermissioningProvider) DefaultAuthenticationService(org.hyperledger.besu.ethereum.api.jsonrpc.authentication.DefaultAuthenticationService) TransactionSimulator(org.hyperledger.besu.ethereum.transaction.TransactionSimulator) JsonRpcHttpService(org.hyperledger.besu.ethereum.api.jsonrpc.JsonRpcHttpService) StratumServer(org.hyperledger.besu.ethereum.stratum.StratumServer) Vertx(io.vertx.core.Vertx) Predicate.isEqual(java.util.function.Predicate.isEqual) NatMethod(org.hyperledger.besu.nat.NatMethod) GraphQLConfiguration(org.hyperledger.besu.ethereum.api.graphql.GraphQLConfiguration) IOException(java.io.IOException) MetricsConfiguration(org.hyperledger.besu.metrics.prometheus.MetricsConfiguration) DockerNatManager(org.hyperledger.besu.nat.docker.DockerNatManager) TransitionCoordinator(org.hyperledger.besu.consensus.merge.blockcreation.TransitionCoordinator) AccountPermissioningControllerFactory(org.hyperledger.besu.ethereum.permissioning.account.AccountPermissioningControllerFactory) NetworkBuilder(org.hyperledger.besu.ethereum.p2p.network.NetworkRunner.NetworkBuilder) WebSocketMethodsFactory(org.hyperledger.besu.ethereum.api.jsonrpc.websocket.methods.WebSocketMethodsFactory) Preconditions(com.google.common.base.Preconditions) PrivacyParameters(org.hyperledger.besu.ethereum.core.PrivacyParameters) PrivateWebSocketMethodsFactory(org.hyperledger.besu.ethereum.api.jsonrpc.websocket.methods.PrivateWebSocketMethodsFactory) BesuPlugin(org.hyperledger.besu.plugin.BesuPlugin) LoggerFactory(org.slf4j.LoggerFactory) Preconditions.checkArgument(com.google.common.base.Preconditions.checkArgument) JsonRpcIpcService(org.hyperledger.besu.ethereum.api.jsonrpc.ipc.JsonRpcIpcService) StorageProvider(org.hyperledger.besu.ethereum.storage.StorageProvider) Synchronizer(org.hyperledger.besu.ethereum.core.Synchronizer) NetworkName(org.hyperledger.besu.cli.config.NetworkName) DefaultP2PNetwork(org.hyperledger.besu.ethereum.p2p.network.DefaultP2PNetwork) WebSocketMessageHandler(org.hyperledger.besu.ethereum.api.jsonrpc.websocket.WebSocketMessageHandler) Collection(java.util.Collection) Blockchain(org.hyperledger.besu.ethereum.chain.Blockchain) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) MiningParameters(org.hyperledger.besu.ethereum.core.MiningParameters) Collectors(java.util.stream.Collectors) GraphQLHttpService(org.hyperledger.besu.ethereum.api.graphql.GraphQLHttpService) EthStatsService(org.hyperledger.besu.ethstats.EthStatsService) List(java.util.List) UpnpNatManager(org.hyperledger.besu.nat.upnp.UpnpNatManager) Optional(java.util.Optional) KubernetesDetector(org.hyperledger.besu.nat.kubernetes.KubernetesDetector) NodeKey(org.hyperledger.besu.crypto.NodeKey) ApiConfiguration(org.hyperledger.besu.ethereum.api.ApiConfiguration) GraphQLContextType(org.hyperledger.besu.ethereum.api.graphql.GraphQLContextType) SubProtocolConfiguration(org.hyperledger.besu.ethereum.p2p.config.SubProtocolConfiguration) NatManager(org.hyperledger.besu.nat.core.NatManager) GraphQL(graphql.GraphQL) EthNetworkConfig(org.hyperledger.besu.cli.config.EthNetworkConfig) CACHE_PATH(org.hyperledger.besu.controller.BesuController.CACHE_PATH) EngineAuthService(org.hyperledger.besu.ethereum.api.jsonrpc.authentication.EngineAuthService) NodePermissioningController(org.hyperledger.besu.ethereum.permissioning.node.NodePermissioningController) SubProtocol(org.hyperledger.besu.ethereum.p2p.rlpx.wire.SubProtocol) NetworkRunner(org.hyperledger.besu.ethereum.p2p.network.NetworkRunner) BesuController(org.hyperledger.besu.controller.BesuController) PermissioningServiceImpl(org.hyperledger.besu.services.PermissioningServiceImpl) JsonRpcConfiguration(org.hyperledger.besu.ethereum.api.jsonrpc.JsonRpcConfiguration) RpcEndpointServiceImpl(org.hyperledger.besu.services.RpcEndpointServiceImpl) DefaultPeer(org.hyperledger.besu.ethereum.p2p.peers.DefaultPeer) HealthService(org.hyperledger.besu.ethereum.api.jsonrpc.health.HealthService) WorldStateArchive(org.hyperledger.besu.ethereum.worldstate.WorldStateArchive) BaseJsonRpcProcessor(org.hyperledger.besu.ethereum.api.jsonrpc.execution.BaseJsonRpcProcessor) RlpxConfiguration(org.hyperledger.besu.ethereum.p2p.config.RlpxConfiguration) TransactionPool(org.hyperledger.besu.ethereum.eth.transactions.TransactionPool) Logger(org.slf4j.Logger) NodePermissioningControllerFactory(org.hyperledger.besu.ethereum.permissioning.NodePermissioningControllerFactory) PeerPermissionsAdapter(org.hyperledger.besu.ethereum.permissioning.node.PeerPermissionsAdapter) NetstatsUrl(org.hyperledger.besu.ethstats.util.NetstatsUrl) AccountLocalConfigPermissioningController(org.hyperledger.besu.ethereum.permissioning.AccountLocalConfigPermissioningController) GraphQLDataFetchers(org.hyperledger.besu.ethereum.api.graphql.GraphQLDataFetchers) EnodeURL(org.hyperledger.besu.plugin.data.EnodeURL) JsonRpcService(org.hyperledger.besu.ethereum.api.jsonrpc.JsonRpcService) SubscriptionManager(org.hyperledger.besu.ethereum.api.jsonrpc.websocket.subscription.SubscriptionManager) JsonRpcIpcConfiguration(org.hyperledger.besu.ethereum.api.jsonrpc.ipc.JsonRpcIpcConfiguration) ObservableMetricsSystem(org.hyperledger.besu.metrics.ObservableMetricsSystem) ProtocolContext(org.hyperledger.besu.ethereum.ProtocolContext) PeerPermissions(org.hyperledger.besu.ethereum.p2p.permissions.PeerPermissions) VisibleForTesting(com.google.common.annotations.VisibleForTesting) Collections(java.util.Collections) JsonRpcMethod(org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.JsonRpcMethod) NatService(org.hyperledger.besu.nat.NatService) AuthenticatedJsonRpcProcessor(org.hyperledger.besu.ethereum.api.jsonrpc.execution.AuthenticatedJsonRpcProcessor) StratumServer(org.hyperledger.besu.ethereum.stratum.StratumServer) DiscoveryConfiguration(org.hyperledger.besu.ethereum.p2p.config.DiscoveryConfiguration) AccountLocalConfigPermissioningController(org.hyperledger.besu.ethereum.permissioning.AccountLocalConfigPermissioningController) SubscriptionManager(org.hyperledger.besu.ethereum.api.jsonrpc.websocket.subscription.SubscriptionManager) RlpxConfiguration(org.hyperledger.besu.ethereum.p2p.config.RlpxConfiguration) EnodeURL(org.hyperledger.besu.plugin.data.EnodeURL) Bytes(org.apache.tuweni.bytes.Bytes) MiningParameters(org.hyperledger.besu.ethereum.core.MiningParameters) ReadinessCheck(org.hyperledger.besu.ethereum.api.jsonrpc.health.ReadinessCheck) HealthService(org.hyperledger.besu.ethereum.api.jsonrpc.health.HealthService) LivenessCheck(org.hyperledger.besu.ethereum.api.jsonrpc.health.LivenessCheck) SubProtocol(org.hyperledger.besu.ethereum.p2p.rlpx.wire.SubProtocol) EngineAuthService(org.hyperledger.besu.ethereum.api.jsonrpc.authentication.EngineAuthService) ProtocolContext(org.hyperledger.besu.ethereum.ProtocolContext) TransactionSimulator(org.hyperledger.besu.ethereum.transaction.TransactionSimulator) NodeKey(org.hyperledger.besu.crypto.NodeKey) JsonRpcExecutor(org.hyperledger.besu.ethereum.api.jsonrpc.execution.JsonRpcExecutor) PeerPermissionsAdapter(org.hyperledger.besu.ethereum.permissioning.node.PeerPermissionsAdapter) Synchronizer(org.hyperledger.besu.ethereum.core.Synchronizer) TransactionPool(org.hyperledger.besu.ethereum.eth.transactions.TransactionPool) Capability(org.hyperledger.besu.ethereum.p2p.rlpx.wire.Capability) WebSocketConfiguration(org.hyperledger.besu.ethereum.api.jsonrpc.websocket.WebSocketConfiguration) NatService(org.hyperledger.besu.nat.NatService) GraphQL(graphql.GraphQL) ProtocolSchedule(org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule) PrivacyParameters(org.hyperledger.besu.ethereum.core.PrivacyParameters) JsonRpcIpcService(org.hyperledger.besu.ethereum.api.jsonrpc.ipc.JsonRpcIpcService) SubProtocolConfiguration(org.hyperledger.besu.ethereum.p2p.config.SubProtocolConfiguration) ProtocolManager(org.hyperledger.besu.ethereum.p2p.network.ProtocolManager) NodePermissioningController(org.hyperledger.besu.ethereum.permissioning.node.NodePermissioningController) GraphQLDataFetchers(org.hyperledger.besu.ethereum.api.graphql.GraphQLDataFetchers) JsonRpcHttpService(org.hyperledger.besu.ethereum.api.jsonrpc.JsonRpcHttpService) EthStatsService(org.hyperledger.besu.ethstats.EthStatsService) NetworkRunner(org.hyperledger.besu.ethereum.p2p.network.NetworkRunner) GraphQLHttpService(org.hyperledger.besu.ethereum.api.graphql.GraphQLHttpService) NodeLocalConfigPermissioningController(org.hyperledger.besu.ethereum.permissioning.NodeLocalConfigPermissioningController) MiningCoordinator(org.hyperledger.besu.ethereum.blockcreation.MiningCoordinator) FilterManager(org.hyperledger.besu.ethereum.api.jsonrpc.internal.filter.FilterManager) AccountPermissioningController(org.hyperledger.besu.ethereum.permissioning.account.AccountPermissioningController) PeerPermissionsDenylist(org.hyperledger.besu.ethereum.p2p.permissions.PeerPermissionsDenylist) BaseJsonRpcProcessor(org.hyperledger.besu.ethereum.api.jsonrpc.execution.BaseJsonRpcProcessor) NetworkBuilder(org.hyperledger.besu.ethereum.p2p.network.NetworkRunner.NetworkBuilder) TransitionCoordinator(org.hyperledger.besu.consensus.merge.blockcreation.TransitionCoordinator) BlockchainQueries(org.hyperledger.besu.ethereum.api.query.BlockchainQueries) WebSocketService(org.hyperledger.besu.ethereum.api.jsonrpc.websocket.WebSocketService) NetworkRunner(org.hyperledger.besu.ethereum.p2p.network.NetworkRunner) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) InsufficientPeersPermissioningProvider(org.hyperledger.besu.ethereum.permissioning.node.InsufficientPeersPermissioningProvider) NoopP2PNetwork(org.hyperledger.besu.ethereum.p2p.network.NoopP2PNetwork) MetricsService(org.hyperledger.besu.metrics.MetricsService) NoopP2PNetwork(org.hyperledger.besu.ethereum.p2p.network.NoopP2PNetwork) P2PNetwork(org.hyperledger.besu.ethereum.p2p.network.P2PNetwork) DefaultP2PNetwork(org.hyperledger.besu.ethereum.p2p.network.DefaultP2PNetwork) FilterManagerBuilder(org.hyperledger.besu.ethereum.api.jsonrpc.internal.filter.FilterManagerBuilder) IOException(java.io.IOException) GraphQLContextType(org.hyperledger.besu.ethereum.api.graphql.GraphQLContextType) JsonRpcService(org.hyperledger.besu.ethereum.api.jsonrpc.JsonRpcService) JsonRpcMethod(org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.JsonRpcMethod) PeerPermissions(org.hyperledger.besu.ethereum.p2p.permissions.PeerPermissions) AuthenticationService(org.hyperledger.besu.ethereum.api.jsonrpc.authentication.AuthenticationService) DefaultAuthenticationService(org.hyperledger.besu.ethereum.api.jsonrpc.authentication.DefaultAuthenticationService)

Example 2 with GraphQLConfiguration

use of org.hyperledger.besu.ethereum.api.graphql.GraphQLConfiguration in project besu by hyperledger.

the class RunnerTest method graphQLConfiguration.

private GraphQLConfiguration graphQLConfiguration() {
    final GraphQLConfiguration configuration = GraphQLConfiguration.createDefault();
    configuration.setPort(0);
    configuration.setEnabled(false);
    return configuration;
}
Also used : GraphQLConfiguration(org.hyperledger.besu.ethereum.api.graphql.GraphQLConfiguration)

Example 3 with GraphQLConfiguration

use of org.hyperledger.besu.ethereum.api.graphql.GraphQLConfiguration in project besu by hyperledger.

the class RunnerBuilderTest method whenEngineApiAddedWebSocketReadyOnSamePort.

@Test
public void whenEngineApiAddedWebSocketReadyOnSamePort() {
    WebSocketConfiguration wsRpc = WebSocketConfiguration.createDefault();
    wsRpc.setEnabled(true);
    EthNetworkConfig mockMainnet = mock(EthNetworkConfig.class);
    when(mockMainnet.getNetworkId()).thenReturn(BigInteger.ONE);
    MergeConfigOptions.setMergeEnabled(true);
    when(besuController.getMiningCoordinator()).thenReturn(mock(MergeMiningCoordinator.class));
    JsonRpcConfiguration engineConf = JsonRpcConfiguration.createEngineDefault();
    engineConf.setEnabled(true);
    final Runner runner = new RunnerBuilder().discovery(true).p2pListenInterface("0.0.0.0").p2pListenPort(30303).p2pAdvertisedHost("127.0.0.1").p2pEnabled(true).natMethod(NatMethod.NONE).besuController(besuController).ethNetworkConfig(mockMainnet).metricsSystem(mock(ObservableMetricsSystem.class)).permissioningService(mock(PermissioningServiceImpl.class)).jsonRpcConfiguration(JsonRpcConfiguration.createDefault()).engineJsonRpcConfiguration(engineConf).webSocketConfiguration(wsRpc).jsonRpcIpcConfiguration(mock(JsonRpcIpcConfiguration.class)).graphQLConfiguration(mock(GraphQLConfiguration.class)).metricsConfiguration(mock(MetricsConfiguration.class)).vertx(Vertx.vertx()).dataDir(dataDir.getRoot().toPath()).storageProvider(mock(KeyValueStorageProvider.class)).forkIdSupplier(() -> Collections.singletonList(Bytes.EMPTY)).rpcEndpointService(new RpcEndpointServiceImpl()).besuPluginContext(mock(BesuPluginContextImpl.class)).build();
    assertThat(runner.getEngineJsonRpcPort()).isPresent();
}
Also used : MockitoJUnitRunner(org.mockito.junit.MockitoJUnitRunner) RpcEndpointServiceImpl(org.hyperledger.besu.services.RpcEndpointServiceImpl) ObservableMetricsSystem(org.hyperledger.besu.metrics.ObservableMetricsSystem) KeyValueStorageProvider(org.hyperledger.besu.ethereum.storage.keyvalue.KeyValueStorageProvider) InMemoryKeyValueStorageProvider(org.hyperledger.besu.ethereum.core.InMemoryKeyValueStorageProvider) MergeMiningCoordinator(org.hyperledger.besu.consensus.merge.blockcreation.MergeMiningCoordinator) WebSocketConfiguration(org.hyperledger.besu.ethereum.api.jsonrpc.websocket.WebSocketConfiguration) JsonRpcConfiguration(org.hyperledger.besu.ethereum.api.jsonrpc.JsonRpcConfiguration) EthNetworkConfig(org.hyperledger.besu.cli.config.EthNetworkConfig) GraphQLConfiguration(org.hyperledger.besu.ethereum.api.graphql.GraphQLConfiguration) Test(org.junit.Test)

Example 4 with GraphQLConfiguration

use of org.hyperledger.besu.ethereum.api.graphql.GraphQLConfiguration in project besu by hyperledger.

the class RunnerBuilderTest method whenEngineApiAddedListensOnDefaultPort.

@Test
public void whenEngineApiAddedListensOnDefaultPort() {
    JsonRpcConfiguration jrpc = JsonRpcConfiguration.createDefault();
    jrpc.setEnabled(true);
    JsonRpcConfiguration engine = JsonRpcConfiguration.createEngineDefault();
    engine.setEnabled(true);
    EthNetworkConfig mockMainnet = mock(EthNetworkConfig.class);
    when(mockMainnet.getNetworkId()).thenReturn(BigInteger.ONE);
    MergeConfigOptions.setMergeEnabled(true);
    when(besuController.getMiningCoordinator()).thenReturn(mock(MergeMiningCoordinator.class));
    final Runner runner = new RunnerBuilder().discovery(true).p2pListenInterface("0.0.0.0").p2pListenPort(30303).p2pAdvertisedHost("127.0.0.1").p2pEnabled(true).natMethod(NatMethod.NONE).besuController(besuController).ethNetworkConfig(mockMainnet).metricsSystem(mock(ObservableMetricsSystem.class)).permissioningService(mock(PermissioningServiceImpl.class)).jsonRpcConfiguration(jrpc).engineJsonRpcConfiguration(engine).graphQLConfiguration(mock(GraphQLConfiguration.class)).webSocketConfiguration(mock(WebSocketConfiguration.class)).jsonRpcIpcConfiguration(mock(JsonRpcIpcConfiguration.class)).metricsConfiguration(mock(MetricsConfiguration.class)).vertx(Vertx.vertx()).dataDir(dataDir.getRoot().toPath()).storageProvider(mock(KeyValueStorageProvider.class)).forkIdSupplier(() -> Collections.singletonList(Bytes.EMPTY)).rpcEndpointService(new RpcEndpointServiceImpl()).besuPluginContext(mock(BesuPluginContextImpl.class)).build();
    assertThat(runner.getJsonRpcPort()).isPresent();
    assertThat(runner.getEngineJsonRpcPort()).isPresent();
}
Also used : MockitoJUnitRunner(org.mockito.junit.MockitoJUnitRunner) RpcEndpointServiceImpl(org.hyperledger.besu.services.RpcEndpointServiceImpl) ObservableMetricsSystem(org.hyperledger.besu.metrics.ObservableMetricsSystem) KeyValueStorageProvider(org.hyperledger.besu.ethereum.storage.keyvalue.KeyValueStorageProvider) InMemoryKeyValueStorageProvider(org.hyperledger.besu.ethereum.core.InMemoryKeyValueStorageProvider) MergeMiningCoordinator(org.hyperledger.besu.consensus.merge.blockcreation.MergeMiningCoordinator) JsonRpcConfiguration(org.hyperledger.besu.ethereum.api.jsonrpc.JsonRpcConfiguration) EthNetworkConfig(org.hyperledger.besu.cli.config.EthNetworkConfig) JsonRpcIpcConfiguration(org.hyperledger.besu.ethereum.api.jsonrpc.ipc.JsonRpcIpcConfiguration) GraphQLConfiguration(org.hyperledger.besu.ethereum.api.graphql.GraphQLConfiguration) Test(org.junit.Test)

Example 5 with GraphQLConfiguration

use of org.hyperledger.besu.ethereum.api.graphql.GraphQLConfiguration in project besu by hyperledger.

the class ThreadBesuNodeRunner method startNode.

@Override
public void startNode(final BesuNode node) {
    if (MDC.get("node") != null) {
        LOG.error("ThreadContext node is already set to {}", MDC.get("node"));
    }
    MDC.put("node", node.getName());
    if (!node.getRunCommand().isEmpty()) {
        throw new UnsupportedOperationException("commands are not supported with thread runner");
    }
    final StorageServiceImpl storageService = new StorageServiceImpl();
    final SecurityModuleServiceImpl securityModuleService = new SecurityModuleServiceImpl();
    final Path dataDir = node.homeDirectory();
    final BesuConfiguration commonPluginConfiguration = new BesuConfigurationImpl(dataDir, dataDir.resolve(DATABASE_PATH));
    final BesuPluginContextImpl besuPluginContext = besuPluginContextMap.computeIfAbsent(node, n -> buildPluginContext(node, storageService, securityModuleService, commonPluginConfiguration));
    final ObservableMetricsSystem metricsSystem = MetricsSystemFactory.create(node.getMetricsConfiguration());
    final List<EnodeURL> bootnodes = node.getConfiguration().getBootnodes().stream().map(EnodeURLImpl::fromURI).collect(Collectors.toList());
    final NetworkName network = node.getNetwork() == null ? NetworkName.DEV : node.getNetwork();
    final EthNetworkConfig.Builder networkConfigBuilder = new EthNetworkConfig.Builder(EthNetworkConfig.getNetworkConfig(network)).setBootNodes(bootnodes);
    node.getConfiguration().getGenesisConfig().ifPresent(networkConfigBuilder::setGenesisConfig);
    final EthNetworkConfig ethNetworkConfig = networkConfigBuilder.build();
    final BesuControllerBuilder builder = new BesuController.Builder().fromEthNetworkConfig(ethNetworkConfig);
    final KeyValueStorageProvider storageProvider = new KeyValueStorageProviderBuilder().withStorageFactory(storageService.getByName("rocksdb").get()).withCommonConfiguration(commonPluginConfiguration).withMetricsSystem(metricsSystem).build();
    final TransactionPoolConfiguration txPoolConfig = ImmutableTransactionPoolConfiguration.builder().strictTransactionReplayProtectionEnabled(node.isStrictTxReplayProtectionEnabled()).build();
    final int maxPeers = 25;
    builder.synchronizerConfiguration(new SynchronizerConfiguration.Builder().build()).dataDirectory(node.homeDirectory()).miningParameters(node.getMiningParameters()).privacyParameters(node.getPrivacyParameters()).nodeKey(new NodeKey(new KeyPairSecurityModule(KeyPairUtil.loadKeyPair(dataDir)))).metricsSystem(metricsSystem).transactionPoolConfiguration(txPoolConfig).ethProtocolConfiguration(EthProtocolConfiguration.defaultConfig()).clock(Clock.systemUTC()).isRevertReasonEnabled(node.isRevertReasonEnabled()).storageProvider(storageProvider).gasLimitCalculator(GasLimitCalculator.constant()).pkiBlockCreationConfiguration(node.getPkiKeyStoreConfiguration().map(pkiConfig -> new PkiBlockCreationConfigurationProvider().load(pkiConfig))).evmConfiguration(EvmConfiguration.DEFAULT).maxPeers(maxPeers);
    node.getGenesisConfig().map(GenesisConfigFile::fromConfig).ifPresent(builder::genesisConfigFile);
    final BesuController besuController = builder.build();
    final RunnerBuilder runnerBuilder = new RunnerBuilder();
    runnerBuilder.permissioningConfiguration(node.getPermissioningConfiguration());
    final Runner runner = runnerBuilder.vertx(Vertx.vertx()).besuController(besuController).ethNetworkConfig(ethNetworkConfig).discovery(node.isDiscoveryEnabled()).p2pAdvertisedHost(node.getHostName()).p2pListenPort(0).maxPeers(maxPeers).networkingConfiguration(node.getNetworkingConfiguration()).jsonRpcConfiguration(node.jsonRpcConfiguration()).webSocketConfiguration(node.webSocketConfiguration()).jsonRpcIpcConfiguration(node.jsonRpcIpcConfiguration()).dataDir(node.homeDirectory()).metricsSystem(metricsSystem).permissioningService(new PermissioningServiceImpl()).metricsConfiguration(node.getMetricsConfiguration()).p2pEnabled(node.isP2pEnabled()).p2pTLSConfiguration(node.getTLSConfiguration()).graphQLConfiguration(GraphQLConfiguration.createDefault()).staticNodes(node.getStaticNodes().stream().map(EnodeURLImpl::fromString).collect(Collectors.toList())).besuPluginContext(new BesuPluginContextImpl()).autoLogBloomCaching(false).storageProvider(storageProvider).forkIdSupplier(() -> besuController.getProtocolManager().getForkIdAsBytesList()).rpcEndpointService(new RpcEndpointServiceImpl()).build();
    besuPluginContext.beforeExternalServices();
    runner.startExternalServices();
    besuPluginContext.addService(BesuEvents.class, new BesuEventsImpl(besuController.getProtocolContext().getBlockchain(), besuController.getProtocolManager().getBlockBroadcaster(), besuController.getTransactionPool(), besuController.getSyncState()));
    besuPluginContext.startPlugins();
    runner.startEthereumMainLoop();
    besuRunners.put(node.getName(), runner);
    MDC.remove("node");
}
Also used : BesuPluginContextImpl(org.hyperledger.besu.services.BesuPluginContextImpl) KeyPairUtil(org.hyperledger.besu.crypto.KeyPairUtil) EnodeURLImpl(org.hyperledger.besu.ethereum.p2p.peers.EnodeURLImpl) LoggerFactory(org.slf4j.LoggerFactory) RocksDBPlugin(org.hyperledger.besu.plugin.services.storage.rocksdb.RocksDBPlugin) Runner(org.hyperledger.besu.Runner) NetworkName(org.hyperledger.besu.cli.config.NetworkName) GenesisConfigFile(org.hyperledger.besu.config.GenesisConfigFile) Map(java.util.Map) BesuPluginContextImpl(org.hyperledger.besu.services.BesuPluginContextImpl) Path(java.nio.file.Path) CommandLine(picocli.CommandLine) SecurityModuleService(org.hyperledger.besu.plugin.services.SecurityModuleService) EthProtocolConfiguration(org.hyperledger.besu.ethereum.eth.EthProtocolConfiguration) PkiBlockCreationConfigurationProvider(org.hyperledger.besu.consensus.qbft.pki.PkiBlockCreationConfigurationProvider) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) PicoCLIOptions(org.hyperledger.besu.plugin.services.PicoCLIOptions) DATABASE_PATH(org.hyperledger.besu.controller.BesuController.DATABASE_PATH) EvmConfiguration(org.hyperledger.besu.evm.internal.EvmConfiguration) Collectors(java.util.stream.Collectors) BesuConfigurationImpl(org.hyperledger.besu.services.BesuConfigurationImpl) List(java.util.List) TransactionPoolConfiguration(org.hyperledger.besu.ethereum.eth.transactions.TransactionPoolConfiguration) KeyValueStorageProvider(org.hyperledger.besu.ethereum.storage.keyvalue.KeyValueStorageProvider) BesuConfiguration(org.hyperledger.besu.plugin.services.BesuConfiguration) BesuEventsImpl(org.hyperledger.besu.services.BesuEventsImpl) GasLimitCalculator(org.hyperledger.besu.ethereum.GasLimitCalculator) NodeKey(org.hyperledger.besu.crypto.NodeKey) BesuEvents(org.hyperledger.besu.plugin.services.BesuEvents) KeyPairSecurityModule(org.hyperledger.besu.crypto.KeyPairSecurityModule) ImmutableTransactionPoolConfiguration(org.hyperledger.besu.ethereum.eth.transactions.ImmutableTransactionPoolConfiguration) EthNetworkConfig(org.hyperledger.besu.cli.config.EthNetworkConfig) BesuControllerBuilder(org.hyperledger.besu.controller.BesuControllerBuilder) HashMap(java.util.HashMap) SynchronizerConfiguration(org.hyperledger.besu.ethereum.eth.sync.SynchronizerConfiguration) RunnerBuilder(org.hyperledger.besu.RunnerBuilder) BesuController(org.hyperledger.besu.controller.BesuController) StorageService(org.hyperledger.besu.plugin.services.StorageService) HashSet(java.util.HashSet) PermissioningServiceImpl(org.hyperledger.besu.services.PermissioningServiceImpl) RpcEndpointServiceImpl(org.hyperledger.besu.services.RpcEndpointServiceImpl) Logger(org.slf4j.Logger) MetricsSystemFactory(org.hyperledger.besu.metrics.MetricsSystemFactory) SecurityModuleServiceImpl(org.hyperledger.besu.services.SecurityModuleServiceImpl) StorageServiceImpl(org.hyperledger.besu.services.StorageServiceImpl) KeyValueStorageProviderBuilder(org.hyperledger.besu.ethereum.storage.keyvalue.KeyValueStorageProviderBuilder) Vertx(io.vertx.core.Vertx) GraphQLConfiguration(org.hyperledger.besu.ethereum.api.graphql.GraphQLConfiguration) File(java.io.File) EnodeURL(org.hyperledger.besu.plugin.data.EnodeURL) PicoCLIOptionsImpl(org.hyperledger.besu.services.PicoCLIOptionsImpl) ObservableMetricsSystem(org.hyperledger.besu.metrics.ObservableMetricsSystem) MDC(org.slf4j.MDC) Clock(java.time.Clock) CommandSpec(picocli.CommandLine.Model.CommandSpec) Runner(org.hyperledger.besu.Runner) NetworkName(org.hyperledger.besu.cli.config.NetworkName) BesuController(org.hyperledger.besu.controller.BesuController) KeyValueStorageProvider(org.hyperledger.besu.ethereum.storage.keyvalue.KeyValueStorageProvider) TransactionPoolConfiguration(org.hyperledger.besu.ethereum.eth.transactions.TransactionPoolConfiguration) ImmutableTransactionPoolConfiguration(org.hyperledger.besu.ethereum.eth.transactions.ImmutableTransactionPoolConfiguration) BesuControllerBuilder(org.hyperledger.besu.controller.BesuControllerBuilder) RunnerBuilder(org.hyperledger.besu.RunnerBuilder) KeyValueStorageProviderBuilder(org.hyperledger.besu.ethereum.storage.keyvalue.KeyValueStorageProviderBuilder) BesuEventsImpl(org.hyperledger.besu.services.BesuEventsImpl) BesuControllerBuilder(org.hyperledger.besu.controller.BesuControllerBuilder) KeyValueStorageProviderBuilder(org.hyperledger.besu.ethereum.storage.keyvalue.KeyValueStorageProviderBuilder) EnodeURL(org.hyperledger.besu.plugin.data.EnodeURL) RunnerBuilder(org.hyperledger.besu.RunnerBuilder) SecurityModuleServiceImpl(org.hyperledger.besu.services.SecurityModuleServiceImpl) NodeKey(org.hyperledger.besu.crypto.NodeKey) StorageServiceImpl(org.hyperledger.besu.services.StorageServiceImpl) Path(java.nio.file.Path) PkiBlockCreationConfigurationProvider(org.hyperledger.besu.consensus.qbft.pki.PkiBlockCreationConfigurationProvider) RpcEndpointServiceImpl(org.hyperledger.besu.services.RpcEndpointServiceImpl) BesuConfiguration(org.hyperledger.besu.plugin.services.BesuConfiguration) EnodeURLImpl(org.hyperledger.besu.ethereum.p2p.peers.EnodeURLImpl) PermissioningServiceImpl(org.hyperledger.besu.services.PermissioningServiceImpl) ObservableMetricsSystem(org.hyperledger.besu.metrics.ObservableMetricsSystem) KeyPairSecurityModule(org.hyperledger.besu.crypto.KeyPairSecurityModule) EthNetworkConfig(org.hyperledger.besu.cli.config.EthNetworkConfig) BesuConfigurationImpl(org.hyperledger.besu.services.BesuConfigurationImpl)

Aggregations

GraphQLConfiguration (org.hyperledger.besu.ethereum.api.graphql.GraphQLConfiguration)12 EthNetworkConfig (org.hyperledger.besu.cli.config.EthNetworkConfig)10 JsonRpcConfiguration (org.hyperledger.besu.ethereum.api.jsonrpc.JsonRpcConfiguration)8 RpcEndpointServiceImpl (org.hyperledger.besu.services.RpcEndpointServiceImpl)8 WebSocketConfiguration (org.hyperledger.besu.ethereum.api.jsonrpc.websocket.WebSocketConfiguration)7 Test (org.junit.Test)7 InMemoryKeyValueStorageProvider (org.hyperledger.besu.ethereum.core.InMemoryKeyValueStorageProvider)6 KeyValueStorageProvider (org.hyperledger.besu.ethereum.storage.keyvalue.KeyValueStorageProvider)6 ObservableMetricsSystem (org.hyperledger.besu.metrics.ObservableMetricsSystem)6 JsonRpcIpcConfiguration (org.hyperledger.besu.ethereum.api.jsonrpc.ipc.JsonRpcIpcConfiguration)5 PermissioningServiceImpl (org.hyperledger.besu.services.PermissioningServiceImpl)5 MockitoJUnitRunner (org.mockito.junit.MockitoJUnitRunner)5 Path (java.nio.file.Path)4 MergeMiningCoordinator (org.hyperledger.besu.consensus.merge.blockcreation.MergeMiningCoordinator)4 EnodeURL (org.hyperledger.besu.plugin.data.EnodeURL)4 BesuController (org.hyperledger.besu.controller.BesuController)3 NodeKey (org.hyperledger.besu.crypto.NodeKey)3 MetricsConfiguration (org.hyperledger.besu.metrics.prometheus.MetricsConfiguration)3 BesuPluginContextImpl (org.hyperledger.besu.services.BesuPluginContextImpl)3 Vertx (io.vertx.core.Vertx)2