diff --git a/pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java b/pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java index 2317f45c2f..b2fc61865e 100644 --- a/pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java +++ b/pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java @@ -741,6 +741,10 @@ MetricsConfiguration metricsConfiguration() { private Optional permissioningConfiguration() throws Exception { if (!permissionsAccountsEnabled && !permissionsNodesEnabled) { + if (rpcHttpApis.contains(RpcApis.PERM) || rpcWsApis.contains(RpcApis.PERM)) { + logger.warn( + "Permissions are disabled. Cannot enable PERM APIs when not using Permissions."); + } return Optional.empty(); } diff --git a/pantheon/src/test/java/tech/pegasys/pantheon/cli/PantheonCommandTest.java b/pantheon/src/test/java/tech/pegasys/pantheon/cli/PantheonCommandTest.java index 1586a0225e..a0f1aafeac 100644 --- a/pantheon/src/test/java/tech/pegasys/pantheon/cli/PantheonCommandTest.java +++ b/pantheon/src/test/java/tech/pegasys/pantheon/cli/PantheonCommandTest.java @@ -28,6 +28,7 @@ import static tech.pegasys.pantheon.cli.NetworkName.ROPSTEN; import static tech.pegasys.pantheon.ethereum.jsonrpc.RpcApis.ETH; import static tech.pegasys.pantheon.ethereum.jsonrpc.RpcApis.NET; +import static tech.pegasys.pantheon.ethereum.jsonrpc.RpcApis.PERM; import static tech.pegasys.pantheon.ethereum.jsonrpc.RpcApis.WEB3; import static tech.pegasys.pantheon.ethereum.p2p.config.DiscoveryConfiguration.MAINNET_BOOTSTRAP_NODES; @@ -947,13 +948,15 @@ public void rpcHttpEnabledPropertyMustBeUsed() { @Test public void rpcApisPropertyMustBeUsed() { - parseCommand("--rpc-http-api", "ETH,NET", "--rpc-http-enabled"); + parseCommand("--rpc-http-api", "ETH,NET,PERM", "--rpc-http-enabled"); verify(mockRunnerBuilder).jsonRpcConfiguration(jsonRpcConfigArgumentCaptor.capture()); verify(mockRunnerBuilder).build(); + verify(mockLogger) + .warn("Permissions are disabled. Cannot enable PERM APIs when not using Permissions."); assertThat(jsonRpcConfigArgumentCaptor.getValue().getRpcApis()) - .containsExactlyInAnyOrder(ETH, NET); + .containsExactlyInAnyOrder(ETH, NET, PERM); assertThat(commandOutput.toString()).isEmpty(); assertThat(commandErrorOutput.toString()).isEmpty();