Rename JsonRpcService to EngineJsonRpcService (#5036)

* rename JsonRpcService to EngineJsonRpcService

Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
pull/5037/head
Daniel Lehrner 2 years ago committed by GitHub
parent c9de473a3c
commit 7130923517
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      besu/src/main/java/org/hyperledger/besu/Runner.java
  2. 6
      besu/src/main/java/org/hyperledger/besu/RunnerBuilder.java
  3. 8
      ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/EngineJsonRpcService.java
  4. 52
      ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/websocket/JsonRpcJWTTest.java

@ -16,8 +16,8 @@ package org.hyperledger.besu;
import org.hyperledger.besu.controller.BesuController;
import org.hyperledger.besu.ethereum.api.graphql.GraphQLHttpService;
import org.hyperledger.besu.ethereum.api.jsonrpc.EngineJsonRpcService;
import org.hyperledger.besu.ethereum.api.jsonrpc.JsonRpcHttpService;
import org.hyperledger.besu.ethereum.api.jsonrpc.JsonRpcService;
import org.hyperledger.besu.ethereum.api.jsonrpc.ipc.JsonRpcIpcService;
import org.hyperledger.besu.ethereum.api.jsonrpc.websocket.WebSocketService;
import org.hyperledger.besu.ethereum.api.query.cache.AutoTransactionLogBloomCachingService;
@ -65,7 +65,7 @@ public class Runner implements AutoCloseable {
private final Optional<EthStatsService> ethStatsService;
private final Optional<GraphQLHttpService> graphQLHttp;
private final Optional<JsonRpcHttpService> jsonRpc;
private final Optional<JsonRpcService> engineJsonRpc;
private final Optional<EngineJsonRpcService> engineJsonRpc;
private final Optional<MetricsService> metrics;
private final Optional<JsonRpcIpcService> ipcJsonRpc;
private final Optional<Path> pidPath;
@ -103,7 +103,7 @@ public class Runner implements AutoCloseable {
final NetworkRunner networkRunner,
final NatService natService,
final Optional<JsonRpcHttpService> jsonRpc,
final Optional<JsonRpcService> engineJsonRpc,
final Optional<EngineJsonRpcService> engineJsonRpc,
final Optional<GraphQLHttpService> graphQLHttp,
final Optional<WebSocketService> webSocketRpc,
final Optional<JsonRpcIpcService> ipcJsonRpc,

@ -33,9 +33,9 @@ import org.hyperledger.besu.ethereum.api.graphql.GraphQLContextType;
import org.hyperledger.besu.ethereum.api.graphql.GraphQLDataFetchers;
import org.hyperledger.besu.ethereum.api.graphql.GraphQLHttpService;
import org.hyperledger.besu.ethereum.api.graphql.GraphQLProvider;
import org.hyperledger.besu.ethereum.api.jsonrpc.EngineJsonRpcService;
import org.hyperledger.besu.ethereum.api.jsonrpc.JsonRpcConfiguration;
import org.hyperledger.besu.ethereum.api.jsonrpc.JsonRpcHttpService;
import org.hyperledger.besu.ethereum.api.jsonrpc.JsonRpcService;
import org.hyperledger.besu.ethereum.api.jsonrpc.authentication.AuthenticationService;
import org.hyperledger.besu.ethereum.api.jsonrpc.authentication.DefaultAuthenticationService;
import org.hyperledger.besu.ethereum.api.jsonrpc.authentication.EngineAuthService;
@ -887,7 +887,7 @@ public class RunnerBuilder {
final SubscriptionManager subscriptionManager =
createSubscriptionManager(vertx, transactionPool, blockchainQueries);
Optional<JsonRpcService> engineJsonRpcService = Optional.empty();
Optional<EngineJsonRpcService> engineJsonRpcService = Optional.empty();
if (engineJsonRpcConfiguration.isPresent() && engineJsonRpcConfiguration.get().isEnabled()) {
final Map<String, JsonRpcMethod> engineMethods =
jsonRpcMethods(
@ -934,7 +934,7 @@ public class RunnerBuilder {
engineJsonRpcService =
Optional.of(
new JsonRpcService(
new EngineJsonRpcService(
vertx,
dataDir,
engineJsonRpcConfiguration.orElse(JsonRpcConfiguration.createEngineDefault()),

@ -100,9 +100,9 @@ import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class JsonRpcService {
public class EngineJsonRpcService {
private static final Logger LOG = LoggerFactory.getLogger(JsonRpcService.class);
private static final Logger LOG = LoggerFactory.getLogger(EngineJsonRpcService.class);
private static final String SPAN_CONTEXT = "span_context";
private static final InetSocketAddress EMPTY_SOCKET_ADDRESS = new InetSocketAddress("0.0.0.0", 0);
@ -152,7 +152,7 @@ public class JsonRpcService {
private final HealthService readinessService;
/**
* Construct a JsonRpcService to handle either http or websocket clients
* Construct a EngineJsonRpcService to handle either http or websocket clients
*
* @param vertx The vertx process that will be running this service
* @param dataDir The data directory where requests can be buffered
@ -166,7 +166,7 @@ public class JsonRpcService {
* @param livenessService A service responsible for reporting whether this node is live
* @param readinessService A service responsible for reporting whether this node has fully started
*/
public JsonRpcService(
public EngineJsonRpcService(
final Vertx vertx,
final Path dataDir,
final JsonRpcConfiguration config,

@ -18,8 +18,8 @@ import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.fail;
import static org.mockito.Mockito.spy;
import org.hyperledger.besu.ethereum.api.jsonrpc.EngineJsonRpcService;
import org.hyperledger.besu.ethereum.api.jsonrpc.JsonRpcConfiguration;
import org.hyperledger.besu.ethereum.api.jsonrpc.JsonRpcService;
import org.hyperledger.besu.ethereum.api.jsonrpc.authentication.AuthenticationService;
import org.hyperledger.besu.ethereum.api.jsonrpc.authentication.EngineAuthService;
import org.hyperledger.besu.ethereum.api.jsonrpc.health.HealthService;
@ -131,8 +131,8 @@ public class JsonRpcJWTTest {
@Test
public void unauthenticatedWebsocketAllowedWithoutJWTAuth(final TestContext context) {
JsonRpcService jsonRpcService =
new JsonRpcService(
EngineJsonRpcService engineJsonRpcService =
new EngineJsonRpcService(
vertx,
bufferDir,
jsonRpcConfiguration,
@ -145,9 +145,9 @@ public class JsonRpcJWTTest {
healthy,
healthy);
jsonRpcService.start().join();
engineJsonRpcService.start().join();
final InetSocketAddress inetSocketAddress = jsonRpcService.socketAddress();
final InetSocketAddress inetSocketAddress = engineJsonRpcService.socketAddress();
int listenPort = inetSocketAddress.getPort();
final HttpClientOptions httpClientOptions =
@ -184,15 +184,15 @@ public class JsonRpcJWTTest {
});
async.awaitSuccess(10000);
jsonRpcService.stop();
engineJsonRpcService.stop();
httpClient.close();
}
@Test
public void httpRequestWithDefaultHeaderAndValidJWTIsAccepted(final TestContext context) {
JsonRpcService jsonRpcService =
new JsonRpcService(
EngineJsonRpcService engineJsonRpcService =
new EngineJsonRpcService(
vertx,
bufferDir,
jsonRpcConfiguration,
@ -205,9 +205,9 @@ public class JsonRpcJWTTest {
healthy,
healthy);
jsonRpcService.start().join();
engineJsonRpcService.start().join();
final InetSocketAddress inetSocketAddress = jsonRpcService.socketAddress();
final InetSocketAddress inetSocketAddress = engineJsonRpcService.socketAddress();
int listenPort = inetSocketAddress.getPort();
final HttpClientOptions httpClientOptions =
@ -248,7 +248,7 @@ public class JsonRpcJWTTest {
});
async.awaitSuccess(10000);
jsonRpcService.stop();
engineJsonRpcService.stop();
httpClient.close();
}
@ -265,9 +265,9 @@ public class JsonRpcJWTTest {
fail("didn't parse jwt");
}
JsonRpcService jsonRpcService =
EngineJsonRpcService engineJsonRpcService =
spy(
new JsonRpcService(
new EngineJsonRpcService(
vertx,
bufferDir,
strictHost,
@ -280,9 +280,9 @@ public class JsonRpcJWTTest {
healthy,
healthy));
jsonRpcService.start().join();
engineJsonRpcService.start().join();
final InetSocketAddress inetSocketAddress = jsonRpcService.socketAddress();
final InetSocketAddress inetSocketAddress = engineJsonRpcService.socketAddress();
int listenPort = inetSocketAddress.getPort();
final HttpClientOptions httpClientOptions =
@ -310,7 +310,7 @@ public class JsonRpcJWTTest {
});
async.awaitSuccess(10000);
jsonRpcService.stop();
engineJsonRpcService.stop();
httpClient.close();
}
@ -328,9 +328,9 @@ public class JsonRpcJWTTest {
fail("didn't parse jwt");
}
JsonRpcService jsonRpcService =
EngineJsonRpcService engineJsonRpcService =
spy(
new JsonRpcService(
new EngineJsonRpcService(
vertx,
bufferDir,
strictHost,
@ -343,9 +343,9 @@ public class JsonRpcJWTTest {
healthy,
healthy));
jsonRpcService.start().join();
engineJsonRpcService.start().join();
final InetSocketAddress inetSocketAddress = jsonRpcService.socketAddress();
final InetSocketAddress inetSocketAddress = engineJsonRpcService.socketAddress();
int listenPort = inetSocketAddress.getPort();
final HttpClientOptions httpClientOptions =
@ -377,7 +377,7 @@ public class JsonRpcJWTTest {
});
async.awaitSuccess(10000);
jsonRpcService.stop();
engineJsonRpcService.stop();
httpClient.close();
}
@ -385,8 +385,8 @@ public class JsonRpcJWTTest {
@Test
public void httpRequestWithDefaultHeaderAndInvalidJWTIsDenied(final TestContext context) {
JsonRpcService jsonRpcService =
new JsonRpcService(
EngineJsonRpcService engineJsonRpcService =
new EngineJsonRpcService(
vertx,
bufferDir,
jsonRpcConfiguration,
@ -399,9 +399,9 @@ public class JsonRpcJWTTest {
healthy,
healthy);
jsonRpcService.start().join();
engineJsonRpcService.start().join();
final InetSocketAddress inetSocketAddress = jsonRpcService.socketAddress();
final InetSocketAddress inetSocketAddress = engineJsonRpcService.socketAddress();
int listenPort = inetSocketAddress.getPort();
final HttpClientOptions httpClientOptions =
@ -427,7 +427,7 @@ public class JsonRpcJWTTest {
});
async.awaitSuccess(10000);
jsonRpcService.stop();
engineJsonRpcService.stop();
httpClient.close();
}
}

Loading…
Cancel
Save