diff --git a/framework/src/test/java/org/tron/core/metrics/MetricsApiServiceTest.java b/framework/src/test/java/org/tron/core/metrics/MetricsApiServiceTest.java index 5203f035e4f..db05044f2ca 100644 --- a/framework/src/test/java/org/tron/core/metrics/MetricsApiServiceTest.java +++ b/framework/src/test/java/org/tron/core/metrics/MetricsApiServiceTest.java @@ -12,7 +12,6 @@ import org.tron.common.application.ApplicationFactory; import org.tron.common.application.TronApplicationContext; import org.tron.common.parameter.CommonParameter; -import org.tron.common.utils.PublicMethod; import org.tron.core.Constant; import org.tron.core.config.DefaultConfig; import org.tron.core.config.args.Args; @@ -47,18 +46,6 @@ public void init() throws IOException { }, "config.conf" ); - Args.getInstance().setRpcEnable(false); - Args.getInstance().setRpcSolidityEnable(false); - Args.getInstance().setRpcPBFTEnable(false); - Args.getInstance().setFullNodeHttpEnable(false); - Args.getInstance().setFullNodeHttpPort(PublicMethod.chooseRandomPort()); - Args.getInstance().setPBFTHttpEnable(false); - Args.getInstance().setPBFTHttpPort(PublicMethod.chooseRandomPort()); - Args.getInstance().setSolidityNodeHttpEnable(false); - Args.getInstance().setSolidityHttpPort(PublicMethod.chooseRandomPort()); - Args.getInstance().setJsonRpcHttpFullNodeEnable(false); - Args.getInstance().setJsonRpcHttpSolidityNodeEnable(false); - Args.getInstance().setJsonRpcHttpPBFTNodeEnable(false); CommonParameter parameter = Args.getInstance(); parameter.setNodeListenPort(port); parameter.getSeedNode().getAddressList().clear(); diff --git a/framework/src/test/java/org/tron/core/services/RpcApiServicesTest.java b/framework/src/test/java/org/tron/core/services/RpcApiServicesTest.java index ebb9e0bb223..deea264800c 100644 --- a/framework/src/test/java/org/tron/core/services/RpcApiServicesTest.java +++ b/framework/src/test/java/org/tron/core/services/RpcApiServicesTest.java @@ -135,8 +135,11 @@ public static void init() throws IOException { Args.setParam(new String[]{"-d", temporaryFolder.newFolder().toString()}, Constant.TEST_CONF); String OWNER_ADDRESS = Wallet.getAddressPreFixString() + "548794500882809695a8a687866e76d4271a1abc"; + getInstance().setRpcEnable(true); getInstance().setRpcPort(PublicMethod.chooseRandomPort()); + getInstance().setRpcSolidityEnable(true); getInstance().setRpcOnSolidityPort(PublicMethod.chooseRandomPort()); + getInstance().setRpcPBFTEnable(true); getInstance().setRpcOnPBFTPort(PublicMethod.chooseRandomPort()); String fullNode = String.format("%s:%d", getInstance().getNodeLanIp(), getInstance().getRpcPort()); diff --git a/framework/src/test/java/org/tron/core/services/WalletApiTest.java b/framework/src/test/java/org/tron/core/services/WalletApiTest.java index 443bbe96068..8890d4bfd9e 100644 --- a/framework/src/test/java/org/tron/core/services/WalletApiTest.java +++ b/framework/src/test/java/org/tron/core/services/WalletApiTest.java @@ -3,7 +3,11 @@ import io.grpc.ManagedChannelBuilder; import java.io.IOException; import lombok.extern.slf4j.Slf4j; -import org.junit.*; +import org.junit.After; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.ClassRule; +import org.junit.Test; import org.junit.rules.TemporaryFolder; import org.tron.api.GrpcAPI.EmptyMessage; import org.tron.api.WalletGrpc; @@ -32,14 +36,6 @@ public static void init() throws IOException { "--p2p-disable", "true"}, Constant.TEST_CONF); Args.getInstance().setRpcPort(PublicMethod.chooseRandomPort()); Args.getInstance().setRpcEnable(true); - Args.getInstance().setRpcSolidityEnable(false); - Args.getInstance().setRpcPBFTEnable(false); - Args.getInstance().setFullNodeHttpEnable(false); - Args.getInstance().setPBFTHttpEnable(false); - Args.getInstance().setSolidityNodeHttpEnable(false); - Args.getInstance().setJsonRpcHttpFullNodeEnable(false); - Args.getInstance().setJsonRpcHttpSolidityNodeEnable(false); - Args.getInstance().setJsonRpcHttpPBFTNodeEnable(false); context = new TronApplicationContext(DefaultConfig.class); appT = ApplicationFactory.create(context); appT.startup(); diff --git a/framework/src/test/java/org/tron/core/services/filter/HttpApiAccessFilterTest.java b/framework/src/test/java/org/tron/core/services/filter/HttpApiAccessFilterTest.java index c0a199542a4..9484155a0b7 100644 --- a/framework/src/test/java/org/tron/core/services/filter/HttpApiAccessFilterTest.java +++ b/framework/src/test/java/org/tron/core/services/filter/HttpApiAccessFilterTest.java @@ -39,18 +39,12 @@ public class HttpApiAccessFilterTest extends BaseTest { static { Args.setParam(new String[]{"-d", dbPath()}, Constant.TEST_CONF); Args.getInstance().setFullNodeAllowShieldedTransactionArgs(false); - Args.getInstance().setRpcEnable(false); - Args.getInstance().setRpcSolidityEnable(false); - Args.getInstance().setRpcPBFTEnable(false); Args.getInstance().setFullNodeHttpEnable(true); Args.getInstance().setFullNodeHttpPort(PublicMethod.chooseRandomPort()); Args.getInstance().setPBFTHttpEnable(true); Args.getInstance().setPBFTHttpPort(PublicMethod.chooseRandomPort()); Args.getInstance().setSolidityNodeHttpEnable(true); Args.getInstance().setSolidityHttpPort(PublicMethod.chooseRandomPort()); - Args.getInstance().setJsonRpcHttpFullNodeEnable(false); - Args.getInstance().setJsonRpcHttpSolidityNodeEnable(false); - Args.getInstance().setJsonRpcHttpPBFTNodeEnable(false); } @Test diff --git a/framework/src/test/java/org/tron/core/services/filter/LiteFnQueryGrpcInterceptorTest.java b/framework/src/test/java/org/tron/core/services/filter/LiteFnQueryGrpcInterceptorTest.java index 081b5839f84..0db3a6a99ce 100644 --- a/framework/src/test/java/org/tron/core/services/filter/LiteFnQueryGrpcInterceptorTest.java +++ b/framework/src/test/java/org/tron/core/services/filter/LiteFnQueryGrpcInterceptorTest.java @@ -55,8 +55,11 @@ public class LiteFnQueryGrpcInterceptorTest { @BeforeClass public static void init() throws IOException { Args.setParam(new String[]{"-d", temporaryFolder.newFolder().toString()}, Constant.TEST_CONF); + Args.getInstance().setRpcEnable(true); Args.getInstance().setRpcPort(PublicMethod.chooseRandomPort()); + Args.getInstance().setRpcSolidityEnable(true); Args.getInstance().setRpcOnSolidityPort(PublicMethod.chooseRandomPort()); + Args.getInstance().setRpcPBFTEnable(true); Args.getInstance().setRpcOnPBFTPort(PublicMethod.chooseRandomPort()); String fullnode = String.format("%s:%d", Args.getInstance().getNodeLanIp(), Args.getInstance().getRpcPort()); diff --git a/framework/src/test/java/org/tron/core/services/filter/RpcApiAccessInterceptorTest.java b/framework/src/test/java/org/tron/core/services/filter/RpcApiAccessInterceptorTest.java index 38af756f790..57fcc5a2202 100644 --- a/framework/src/test/java/org/tron/core/services/filter/RpcApiAccessInterceptorTest.java +++ b/framework/src/test/java/org/tron/core/services/filter/RpcApiAccessInterceptorTest.java @@ -56,8 +56,11 @@ public class RpcApiAccessInterceptorTest { @BeforeClass public static void init() throws IOException { Args.setParam(new String[] {"-d", temporaryFolder.newFolder().toString()}, Constant.TEST_CONF); + Args.getInstance().setRpcEnable(true); Args.getInstance().setRpcPort(PublicMethod.chooseRandomPort()); + Args.getInstance().setRpcSolidityEnable(true); Args.getInstance().setRpcOnSolidityPort(PublicMethod.chooseRandomPort()); + Args.getInstance().setRpcPBFTEnable(true); Args.getInstance().setRpcOnPBFTPort(PublicMethod.chooseRandomPort()); String fullNode = String.format("%s:%d", Args.getInstance().getNodeLanIp(), Args.getInstance().getRpcPort()); diff --git a/framework/src/test/java/org/tron/core/services/http/TriggerSmartContractServletTest.java b/framework/src/test/java/org/tron/core/services/http/TriggerSmartContractServletTest.java index 7332cf83cba..e9cd9cb1f26 100644 --- a/framework/src/test/java/org/tron/core/services/http/TriggerSmartContractServletTest.java +++ b/framework/src/test/java/org/tron/core/services/http/TriggerSmartContractServletTest.java @@ -33,16 +33,8 @@ public static void init() throws Exception { Args.setParam( new String[]{"--output-directory", dbPath(), "--debug", "--witness"}, Constant.TEST_CONF); Args.getInstance().needSyncCheck = false; - Args.getInstance().setRpcEnable(false); - Args.getInstance().setRpcSolidityEnable(false); - Args.getInstance().setRpcPBFTEnable(false); Args.getInstance().setFullNodeHttpEnable(true); Args.getInstance().setFullNodeHttpPort(PublicMethod.chooseRandomPort()); - Args.getInstance().setPBFTHttpEnable(false); - Args.getInstance().setSolidityNodeHttpEnable(false); - Args.getInstance().setJsonRpcHttpFullNodeEnable(false); - Args.getInstance().setJsonRpcHttpSolidityNodeEnable(false); - Args.getInstance().setJsonRpcHttpPBFTNodeEnable(false); httpNode = String.format("%s:%d", "127.0.0.1", Args.getInstance().getFullNodeHttpPort()); } diff --git a/framework/src/test/resources/config-localtest.conf b/framework/src/test/resources/config-localtest.conf index d7f573fe90e..4f435692deb 100644 --- a/framework/src/test/resources/config-localtest.conf +++ b/framework/src/test/resources/config-localtest.conf @@ -116,11 +116,21 @@ node { ] http { - fullNodePort = 8090 - solidityPort = 8091 + fullNodeEnable = false + solidityEnable = false + PBFTEnable = false + } + + jsonrpc { + httpFullNodeEnable = false + httpSolidityEnable = false + httpPBFTEnable = false } rpc { + enable = false + solidityEnable = false + PBFTEnable = false port = 50051 # default value is 50061 # solidityPort = 50061 diff --git a/framework/src/test/resources/config-test-index.conf b/framework/src/test/resources/config-test-index.conf index 6eb3621e747..cff08fd3abb 100644 --- a/framework/src/test/resources/config-test-index.conf +++ b/framework/src/test/resources/config-test-index.conf @@ -76,9 +76,23 @@ node { version = 43 # 43: testnet; 101: debug } + http { + fullNodeEnable = false + solidityEnable = false + PBFTEnable = false + } + + jsonrpc { + httpFullNodeEnable = false + httpSolidityEnable = false + httpPBFTEnable = false + } + rpc { port = 50051 - + enable = false + solidityEnable = false + PBFTEnable = false # Number of gRPC thread, default availableProcessors / 2 # thread = 16 diff --git a/framework/src/test/resources/config-test-mainnet.conf b/framework/src/test/resources/config-test-mainnet.conf index ad72d2afaaa..de9170a0ec4 100644 --- a/framework/src/test/resources/config-test-mainnet.conf +++ b/framework/src/test/resources/config-test-mainnet.conf @@ -82,6 +82,24 @@ node { version = 43 # 43: testnet; 101: debug } + http { + fullNodeEnable = false + solidityEnable = false + PBFTEnable = false + } + + jsonrpc { + httpFullNodeEnable = false + httpSolidityEnable = false + httpPBFTEnable = false + } + + rpc { + enable = false + solidityEnable = false + PBFTEnable = false + } + } sync { diff --git a/framework/src/test/resources/config-test.conf b/framework/src/test/resources/config-test.conf index db24bb2a8a0..8aedcc2f2ec 100644 --- a/framework/src/test/resources/config-test.conf +++ b/framework/src/test/resources/config-test.conf @@ -106,10 +106,15 @@ node { } http { - fullNodeEnable = true - fullNodePort = 8090 - solidityEnable = true - solidityPort = 8091 + fullNodeEnable = false + solidityEnable = false + PBFTEnable = false + } + + jsonrpc { + httpFullNodeEnable = false + httpSolidityEnable = false + httpPBFTEnable = false } # use your ipv6 address for node discovery and tcp connection, default false @@ -171,6 +176,9 @@ node { } rpc { + enable = false + solidityEnable = false + PBFTEnable = false port = 50051 PBFTPort = 50072 diff --git a/plugins/src/test/java/org/tron/plugins/DbLiteTest.java b/plugins/src/test/java/org/tron/plugins/DbLiteTest.java index 5153acc9c11..7e403a95dda 100644 --- a/plugins/src/test/java/org/tron/plugins/DbLiteTest.java +++ b/plugins/src/test/java/org/tron/plugins/DbLiteTest.java @@ -77,14 +77,6 @@ public void init() throws IOException { Args.getInstance().setAllowAccountStateRoot(1); Args.getInstance().setRpcPort(PublicMethod.chooseRandomPort()); Args.getInstance().setRpcEnable(true); - Args.getInstance().setRpcSolidityEnable(false); - Args.getInstance().setRpcPBFTEnable(false); - Args.getInstance().setFullNodeHttpEnable(false); - Args.getInstance().setPBFTHttpEnable(false); - Args.getInstance().setSolidityNodeHttpEnable(false); - Args.getInstance().setJsonRpcHttpFullNodeEnable(false); - Args.getInstance().setJsonRpcHttpSolidityNodeEnable(false); - Args.getInstance().setJsonRpcHttpPBFTNodeEnable(false); databaseDir = Args.getInstance().getStorage().getDbDirectory(); // init dbBackupConfig to avoid NPE Args.getInstance().dbBackupConfig = DbBackupConfig.getInstance();