From f2919005600805b51f8c11793a3dc73605d2a320 Mon Sep 17 00:00:00 2001 From: Kyon <32325790+kyonRay@users.noreply.github.com> Date: Fri, 21 Jul 2023 18:29:37 +0800 Subject: [PATCH 1/8] (tools): fix get_account.sh to add .public.pem pk. (#782) --- tools/get_account.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/get_account.sh b/tools/get_account.sh index 3b4a0a23..1b191171 100755 --- a/tools/get_account.sh +++ b/tools/get_account.sh @@ -130,15 +130,17 @@ main() LOG_INFO "Private Key (pem) : ${output_path}/0x${accountAddress}.pem" # echo "0x${privKey}" > ${output_path}/${accountAddress}.private.hex openssl ec -in ${output_path}/0x${accountAddress}.pem -pubout -out ${output_path}/0x${accountAddress}.pem.pub 2>/dev/null - LOG_INFO "Public Key (pem) : ${output_path}/0x${accountAddress}.pem.pub" + openssl ec -in ${output_path}/0x${accountAddress}.pem -pubout -out ${output_path}/0x${accountAddress}.public.pem 2>/dev/null + LOG_INFO "Public Key (pem) : ${output_path}/0x${accountAddress}.public.pem" else LOG_INFO "Note: the entered password cannot contain Chinese characters!" openssl pkcs12 -export -name key -nocerts -inkey "${output_path}/ecprivkey.pem" -out "${output_path}/0x${accountAddress}.p12" || $(rm ${output_path}/0x${accountAddress}.p12 && rm ${output_path}/ecprivkey.pem && exit 1) openssl ec -in ${output_path}/ecprivkey.pem -pubout -out ${output_path}/0x${accountAddress}.pem.pub 2>/dev/null + openssl ec -in ${output_path}/ecprivkey.pem -pubout -out ${output_path}/0x${accountAddress}.public.pem 2>/dev/null rm ${output_path}/ecprivkey.pem LOG_INFO "Account Address : 0x${accountAddress}" LOG_INFO "Private Key (p12) : ${output_path}/0x${accountAddress}.p12" - LOG_INFO "Public Key (pem) : ${output_path}/0x${accountAddress}.pem.pub" + LOG_INFO "Public Key (pem) : ${output_path}/0x${accountAddress}.public.pem" fi # LOG_INFO "Private Key (hex) : 0x${privKey}" # echo "0x${pubKey}" > ${output_path}/${accountAddress}.public.hex From be8b0042acee1bba0ba39d8e8ee17b334c34645e Mon Sep 17 00:00:00 2001 From: wenlinli <1574249665@qq.com> Date: Mon, 28 Aug 2023 09:54:15 +0800 Subject: [PATCH 2/8] update clog default config (#792) --- src/integration-test/resources/clog.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/integration-test/resources/clog.ini b/src/integration-test/resources/clog.ini index d6647b9d..9041fec8 100644 --- a/src/integration-test/resources/clog.ini +++ b/src/integration-test/resources/clog.ini @@ -4,6 +4,6 @@ ; network statistics interval, unit is second, default is 60s stat_flush_interval=60 ; info debug trace - level=DEBUG + level=debug ; MB max_log_file_size=200 From 56396b812daea5cee30cea0731601cd169a0d0db Mon Sep 17 00:00:00 2001 From: Kyon <32325790+kyonRay@users.noreply.github.com> Date: Tue, 29 Aug 2023 07:49:51 +0800 Subject: [PATCH 3/8] (contract,command): fix call link error when getABI cannot return abi, fix auth need command to use is enable committee flag. (#791) --- build.gradle | 2 +- release_note.txt | 2 +- src/integration-test/java/console/TestBase.java | 2 +- src/main/java/console/Console.java | 6 +++--- src/main/java/console/NonInteractiveConsole.java | 6 +++--- src/main/java/console/auth/AuthImpl.java | 2 +- src/main/java/console/command/JlineUtils.java | 4 ++-- .../java/console/command/model/CommandInfo.java | 4 ++-- src/main/java/console/common/ConsoleVersion.java | 2 +- .../console/contract/ConsoleContractImpl.java | 16 +++++++++++++--- tools/download_console.sh | 2 +- 11 files changed, 29 insertions(+), 19 deletions(-) diff --git a/build.gradle b/build.gradle index 39c397e5..ee9a9edb 100644 --- a/build.gradle +++ b/build.gradle @@ -40,7 +40,7 @@ dependencies { //compile 'org.fisco-bcos:solcJ:0.5.2.1' compile 'org.fisco-bcos:solcJ:0.8.11.1' - compile('org.fisco-bcos.java-sdk:fisco-bcos-java-sdk:3.4.0') { + compile('org.fisco-bcos.java-sdk:fisco-bcos-java-sdk:3.5.0-SNAPSHOT') { exclude group: "org.slf4j" } diff --git a/release_note.txt b/release_note.txt index c219f723..c0c4025d 100644 --- a/release_note.txt +++ b/release_note.txt @@ -1 +1 @@ -v3.4.0 +v3.5.0 diff --git a/src/integration-test/java/console/TestBase.java b/src/integration-test/java/console/TestBase.java index e5ee762e..6e70a6cb 100644 --- a/src/integration-test/java/console/TestBase.java +++ b/src/integration-test/java/console/TestBase.java @@ -24,7 +24,7 @@ public static void setUpBeforeClass() throws Exception { consoleInitializer = new ConsoleInitializer(); consoleInitializer.init(new String[0]); isWasm = consoleInitializer.getClient().isWASM(); - isAuthCheck = consoleInitializer.getClient().isAuthCheck(); + isAuthCheck = consoleInitializer.getClient().isEnableCommittee(); authFace = consoleInitializer.getAuthFace(); consoleClientFace = consoleInitializer.getConsoleClientFace(); precompiledFace = consoleInitializer.getPrecompiledFace(); diff --git a/src/main/java/console/Console.java b/src/main/java/console/Console.java index 0d56961d..37e4b756 100644 --- a/src/main/java/console/Console.java +++ b/src/main/java/console/Console.java @@ -61,7 +61,7 @@ public static void main(String[] args) { WelcomeInfo.welcome(); String pwd = consoleInitializer.getPrecompiledFace().getPwd(); SupportedCommand.setIsAuthOpen( - consoleInitializer.getClient().isAuthCheck() + consoleInitializer.getClient().isEnableCommittee() && !consoleInitializer.getClient().isWASM()); SupportedCommand.setIsWasm(consoleInitializer.getClient().isWASM()); @@ -105,7 +105,7 @@ public static void main(String[] args) { SupportedCommand.getCommandInfo( params[0], consoleInitializer.getClient().isWASM(), - consoleInitializer.getClient().isAuthCheck()); + consoleInitializer.getClient().isEnableCommittee()); if (commandInfo != null) { if (CrudCommand.CRUD_COMMANDS.contains(params[0])) { String[] inputParamString = new String[1]; @@ -137,7 +137,7 @@ public static void main(String[] args) { // update the client when switch group JlineUtils.switchGroup(consoleInitializer.getClient()); SupportedCommand.setIsAuthOpen( - consoleInitializer.getClient().isAuthCheck() + consoleInitializer.getClient().isEnableCommittee() && !consoleInitializer.getClient().isWASM()); SupportedCommand.setIsWasm(consoleInitializer.getClient().isWASM()); } diff --git a/src/main/java/console/NonInteractiveConsole.java b/src/main/java/console/NonInteractiveConsole.java index 2dee6557..a4c0eaf5 100644 --- a/src/main/java/console/NonInteractiveConsole.java +++ b/src/main/java/console/NonInteractiveConsole.java @@ -40,7 +40,7 @@ public static void main(String[] args) { } SupportedCommand.isWasm = consoleInitializer.getClient().isWASM(); - SupportedCommand.isAuthOpen = consoleInitializer.getClient().isAuthCheck(); + SupportedCommand.isAuthOpen = consoleInitializer.getClient().isEnableCommittee(); try { String[] command = params[0].split(" "); CommandInfo commandInfo = null; @@ -50,13 +50,13 @@ public static void main(String[] args) { SupportedCommand.getCommandInfo( command[0], consoleInitializer.getClient().isWASM(), - consoleInitializer.getClient().isAuthCheck()); + consoleInitializer.getClient().isEnableCommittee()); } else { commandInfo = SupportedCommand.getCommandInfo( params[0], consoleInitializer.getClient().isWASM(), - consoleInitializer.getClient().isAuthCheck()); + consoleInitializer.getClient().isEnableCommittee()); } if (commandInfo != null) { if (CrudCommand.CRUD_COMMANDS.contains(command[0])) { diff --git a/src/main/java/console/auth/AuthImpl.java b/src/main/java/console/auth/AuthImpl.java index 55768f84..36902750 100644 --- a/src/main/java/console/auth/AuthImpl.java +++ b/src/main/java/console/auth/AuthImpl.java @@ -36,7 +36,7 @@ public class AuthImpl implements AuthFace { public AuthImpl(Client client) { CryptoKeyPair cryptoKeyPair = client.getCryptoSuite().getCryptoKeyPair(); - boolean authAvailable = client.isAuthCheck() && !client.isWASM(); + boolean authAvailable = client.isEnableCommittee() && !client.isWASM(); if (authAvailable) { this.authManager = new AuthManager(client, cryptoKeyPair); } else { diff --git a/src/main/java/console/command/JlineUtils.java b/src/main/java/console/command/JlineUtils.java index 59665a39..331aa658 100644 --- a/src/main/java/console/command/JlineUtils.java +++ b/src/main/java/console/command/JlineUtils.java @@ -69,7 +69,7 @@ public static LineReader getLineReader(Client client) throws IOException { List completers = new ArrayList<>(); List commands = - SupportedCommand.getAllCommand(client.isWASM(), client.isAuthCheck()); + SupportedCommand.getAllCommand(client.isWASM(), client.isEnableCommittee()); contractAddressCompleter = new ContractAddressCompleter(client); contractMethodCompleter = new ContractMethodCompleter(client); accountCompleter = new AccountCompleter(client); @@ -167,7 +167,7 @@ public static LineReader getLineReader(Client client) throws IOException { Arrays.asList( StatusQueryCommand.SET_SYSTEM_CONFIG_BY_KEY.getCommand(), StatusQueryCommand.GET_SYSTEM_CONFIG_BY_KEY.getCommand())); - if (client.isAuthCheck()) { + if (client.isEnableCommittee()) { commands.add(AuthOpCommand.SET_SYS_CONFIG_PROPOSAL.getCommand()); } diff --git a/src/main/java/console/command/model/CommandInfo.java b/src/main/java/console/command/model/CommandInfo.java index f5626bc3..f7b95ff9 100644 --- a/src/main/java/console/command/model/CommandInfo.java +++ b/src/main/java/console/command/model/CommandInfo.java @@ -281,7 +281,7 @@ public void callCommand(ConsoleInitializer consoleInitializer, String[] params, HelpInfo.printHelp( command, consoleInitializer.getClient().isWASM(), - consoleInitializer.getClient().isAuthCheck()); + consoleInitializer.getClient().isEnableCommittee()); return; } @@ -300,7 +300,7 @@ public void callCommand(ConsoleInitializer consoleInitializer, String[] params, HelpInfo.printHelp( command, consoleInitializer.getClient().isWASM(), - consoleInitializer.getClient().isAuthCheck()); + consoleInitializer.getClient().isEnableCommittee()); return; } // check version diff --git a/src/main/java/console/common/ConsoleVersion.java b/src/main/java/console/common/ConsoleVersion.java index 25369c5b..d373e0d3 100644 --- a/src/main/java/console/common/ConsoleVersion.java +++ b/src/main/java/console/common/ConsoleVersion.java @@ -2,7 +2,7 @@ public class ConsoleVersion { - public static final String Version = "3.4.0"; + public static final String Version = "3.5.0"; public static void main(String[] args) { System.out.println("console version: " + Version); diff --git a/src/main/java/console/contract/ConsoleContractImpl.java b/src/main/java/console/contract/ConsoleContractImpl.java index 07525d73..6d05175b 100644 --- a/src/main/java/console/contract/ConsoleContractImpl.java +++ b/src/main/java/console/contract/ConsoleContractImpl.java @@ -21,6 +21,7 @@ import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter; +import java.math.BigInteger; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.LocalDateTime; @@ -40,9 +41,11 @@ import org.fisco.bcos.sdk.v3.client.protocol.response.Abi; import org.fisco.bcos.sdk.v3.codec.ContractCodecException; import org.fisco.bcos.sdk.v3.codec.EventEncoder; +import org.fisco.bcos.sdk.v3.codec.datatypes.generated.tuples.generated.Tuple2; import org.fisco.bcos.sdk.v3.codec.wrapper.ABIDefinition; import org.fisco.bcos.sdk.v3.codec.wrapper.ABIDefinitionFactory; import org.fisco.bcos.sdk.v3.codec.wrapper.ContractABIDefinition; +import org.fisco.bcos.sdk.v3.contract.precompiled.bfs.BFSPrecompiled; import org.fisco.bcos.sdk.v3.contract.precompiled.bfs.BFSService; import org.fisco.bcos.sdk.v3.crypto.keypair.CryptoKeyPair; import org.fisco.bcos.sdk.v3.model.CryptoType; @@ -568,9 +571,16 @@ public void call(String[] params, String pwd) throws Exception { if (!address.isEmpty() && !address.equals(Common.EMPTY_CONTRACT_ADDRESS)) { String abi = client.getABI(address).getABI(); if (abi.isEmpty()) { - System.out.println( - "Resource " + path + " doesnt have abi, maybe this is not a link."); - return; + Tuple2> list = + bfsService.list(fixedBfsParam, BigInteger.ZERO, BigInteger.TEN); + if (list.getValue2().isEmpty() + || list.getValue2().get(0).getExt().size() < 2 + || list.getValue2().get(0).getExt().get(1).isEmpty()) { + System.out.println( + "Resource " + path + " doesnt have abi, maybe this is not a link."); + return; + } + abi = list.getValue2().get(0).getExt().get(1); } AbiAndBin abiAndBin = new AbiAndBin(abi, "", ""); String functionName = params[2]; diff --git a/tools/download_console.sh b/tools/download_console.sh index 9eb5356d..72c81ea5 100755 --- a/tools/download_console.sh +++ b/tools/download_console.sh @@ -3,7 +3,7 @@ package_name="console.tar.gz" solcj_name="" solcj_default_version="solcJ-0.8.11.1.jar" only_solc_flag="" -default_version="3.4.0" +default_version="3.5.0" download_version="${default_version}" solc_download_version="3.0.0" specify_console=0 From 42e61842674a52871c3e5b07bdbf8ece322008c7 Mon Sep 17 00:00:00 2001 From: Kyon <32325790+kyonRay@users.noreply.github.com> Date: Wed, 6 Sep 2023 09:52:06 +0800 Subject: [PATCH 4/8] (command): add system feature display. (#794) --- src/main/java/console/auth/AuthImpl.java | 6 ++--- src/main/java/console/command/JlineUtils.java | 26 ++++++++++++++----- .../java/console/command/model/HelpInfo.java | 26 ++++++++++++++++--- src/main/java/console/common/Common.java | 18 +++++++++---- .../console/precompiled/PrecompiledImpl.java | 4 +-- 5 files changed, 59 insertions(+), 21 deletions(-) diff --git a/src/main/java/console/auth/AuthImpl.java b/src/main/java/console/auth/AuthImpl.java index 36902750..0ee66f14 100644 --- a/src/main/java/console/auth/AuthImpl.java +++ b/src/main/java/console/auth/AuthImpl.java @@ -1,7 +1,5 @@ package console.auth; -import static console.common.Common.COMPATIBILITY_VERSION; - import console.ConsoleInitializer; import console.common.ConsoleUtils; import java.math.BigInteger; @@ -16,6 +14,7 @@ import org.fisco.bcos.sdk.v3.contract.auth.po.CommitteeInfo; import org.fisco.bcos.sdk.v3.contract.auth.po.GovernorInfo; import org.fisco.bcos.sdk.v3.contract.auth.po.ProposalInfo; +import org.fisco.bcos.sdk.v3.contract.precompiled.sysconfig.SystemConfigService; import org.fisco.bcos.sdk.v3.crypto.keypair.CryptoKeyPair; import org.fisco.bcos.sdk.v3.model.PrecompiledRetCode; import org.fisco.bcos.sdk.v3.model.RetCode; @@ -227,7 +226,8 @@ public void createSetSysConfigProposal(ConsoleInitializer consoleInitializer, St BigInteger proposalId = authManager.createSetSysConfigProposal(key, value); System.out.println("Set system config proposal created, ID is: " + proposalId); showProposalInfo(proposalId); - if (key.equals(COMPATIBILITY_VERSION) && proposalId.compareTo(BigInteger.ZERO) > 0) { + if (key.equals(SystemConfigService.COMPATIBILITY_VERSION) + && proposalId.compareTo(BigInteger.ZERO) > 0) { String[] param = new String[2]; param[1] = consoleInitializer.getGroupID(); consoleInitializer.switchGroup(param); diff --git a/src/main/java/console/command/JlineUtils.java b/src/main/java/console/command/JlineUtils.java index 331aa658..0357a9b6 100644 --- a/src/main/java/console/command/JlineUtils.java +++ b/src/main/java/console/command/JlineUtils.java @@ -12,7 +12,6 @@ import console.command.completer.ContractMethodCompleter; import console.command.completer.CurrentPathCompleter; import console.command.completer.StringsCompleterIgnoreCase; -import console.common.Common; import console.contract.utils.ContractCompiler; import java.io.File; import java.io.IOException; @@ -20,6 +19,9 @@ import java.util.Arrays; import java.util.List; import org.fisco.bcos.sdk.v3.client.Client; +import org.fisco.bcos.sdk.v3.contract.precompiled.sysconfig.SystemConfigFeature; +import org.fisco.bcos.sdk.v3.contract.precompiled.sysconfig.SystemConfigService; +import org.fisco.bcos.sdk.v3.model.EnumNodeVersion; import org.jline.reader.Completer; import org.jline.reader.LineReader; import org.jline.reader.LineReaderBuilder; @@ -175,29 +177,41 @@ public static LineReader getLineReader(Client client) throws IOException { completers.add( new ArgumentCompleter( new StringsCompleter(command), - new StringsCompleter(Common.TX_COUNT_LIMIT), + new StringsCompleter(SystemConfigService.TX_COUNT_LIMIT), new StringsCompleterIgnoreCase())); completers.add( new ArgumentCompleter( new StringsCompleter(command), - new StringsCompleter(Common.TX_GAS_LIMIT), + new StringsCompleter(SystemConfigService.TX_GAS_LIMIT), new StringsCompleterIgnoreCase())); completers.add( new ArgumentCompleter( new StringsCompleter(command), - new StringsCompleter(Common.CONSENSUS_LEADER_PERIOD), + new StringsCompleter(SystemConfigService.CONSENSUS_PERIOD), new StringsCompleterIgnoreCase())); completers.add( new ArgumentCompleter( new StringsCompleter(command), - new StringsCompleter(Common.COMPATIBILITY_VERSION), + new StringsCompleter(SystemConfigService.COMPATIBILITY_VERSION), new StringsCompleterIgnoreCase())); completers.add( new ArgumentCompleter( new StringsCompleter(command), - new StringsCompleter(Common.AUTH_CHECK_STATUS), + new StringsCompleter(SystemConfigService.AUTH_STATUS), new StringsCompleterIgnoreCase())); + for (SystemConfigFeature.Features feature : SystemConfigFeature.Features.values()) { + if (client.getChainCompatibilityVersion() + .compareTo( + EnumNodeVersion.convertToVersion(feature.enableVersion())) + >= 0) { + completers.add( + new ArgumentCompleter( + new StringsCompleter(command), + new StringsCompleter(feature.toString()), + new StringsCompleterIgnoreCase())); + } + } } completers.add( new ArgumentCompleter( diff --git a/src/main/java/console/command/model/HelpInfo.java b/src/main/java/console/command/model/HelpInfo.java index 35209d8d..efeda40d 100644 --- a/src/main/java/console/command/model/HelpInfo.java +++ b/src/main/java/console/command/model/HelpInfo.java @@ -3,6 +3,9 @@ import console.command.SupportedCommand; import console.common.Common; import console.common.ConsoleUtils; +import org.fisco.bcos.sdk.v3.contract.precompiled.sysconfig.SystemConfigFeature; +import org.fisco.bcos.sdk.v3.contract.precompiled.sysconfig.SystemConfigService; +import org.fisco.bcos.sdk.v3.model.EnumNodeVersion; public class HelpInfo { public static void promptHelp(String command) { @@ -361,7 +364,7 @@ public static void systemConfigHelper() { System.out.println("* value -- The value of system config to be set."); System.out.println( " -- the value of " - + Common.COMPATIBILITY_VERSION + + SystemConfigService.COMPATIBILITY_VERSION + " " + Common.COMPATIBILITY_VERSION_DESC); System.out.println( @@ -374,19 +377,34 @@ public static void systemConfigHelper() { + "(default 3000000000)."); System.out.println( " -- the value of " - + Common.CONSENSUS_LEADER_PERIOD + + SystemConfigService.CONSENSUS_PERIOD + " " + Common.SYS_CONFIG_RANGE + "(default 1)."); System.out.println( - " -- the value of " + Common.AUTH_CHECK_STATUS + " " + Common.AUTH_CHECK_DESC); + " -- the value of " + + SystemConfigService.AUTH_STATUS + + " " + + Common.AUTH_CHECK_DESC); + for (SystemConfigFeature.Features feature : SystemConfigFeature.Features.values()) { + System.out.println( + " -- the feature of " + + feature.toString() + + " only enable when " + + SystemConfigService.COMPATIBILITY_VERSION + + " >= " + + EnumNodeVersion.convertToVersion(feature.enableVersion()) + .toVersionString() + + ", value can only set 1 or greater equal than 1."); + } } public static void getSystemConfigByKeyHelp() { System.out.println("Query a system config value by key."); System.out.println("Usage: \ngetSystemConfigByKey key"); + System.out.println("* key -- The name of system config."); System.out.println( - "* key -- The name of system config(tx_count_limit/tx_gas_limit/consensus_leader_period supported currently)."); + " -- supported keys: " + String.join(",", Common.SUPPORTED_SYSTEM_KEYS)); } public static void operateGroupHelp(String command, String operator) { diff --git a/src/main/java/console/common/Common.java b/src/main/java/console/common/Common.java index 4e9ce49c..717d3cb6 100644 --- a/src/main/java/console/common/Common.java +++ b/src/main/java/console/common/Common.java @@ -4,6 +4,8 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import org.fisco.bcos.sdk.v3.contract.precompiled.sysconfig.SystemConfigFeature; +import org.fisco.bcos.sdk.v3.contract.precompiled.sysconfig.SystemConfigService; public class Common { @@ -21,11 +23,17 @@ private Common() {} public static final List SUPPORTED_SYSTEM_KEYS = new ArrayList<>( Arrays.asList( - TX_COUNT_LIMIT, - TX_GAS_LIMIT, - CONSENSUS_LEADER_PERIOD, - COMPATIBILITY_VERSION, - AUTH_CHECK_STATUS)); + SystemConfigService.TX_COUNT_LIMIT, + SystemConfigService.TX_GAS_LIMIT, + SystemConfigService.CONSENSUS_PERIOD, + SystemConfigService.COMPATIBILITY_VERSION, + SystemConfigService.AUTH_STATUS)); + + static { + for (SystemConfigFeature.Features feature : SystemConfigFeature.Features.values()) { + SUPPORTED_SYSTEM_KEYS.add(feature.toString()); + } + } public static final int INVALID_RETURN_NUMBER = -100; public static final long INVALID_LONG_VALUE = Long.MAX_VALUE; diff --git a/src/main/java/console/precompiled/PrecompiledImpl.java b/src/main/java/console/precompiled/PrecompiledImpl.java index 35d6c17b..5c3a3b45 100644 --- a/src/main/java/console/precompiled/PrecompiledImpl.java +++ b/src/main/java/console/precompiled/PrecompiledImpl.java @@ -1,7 +1,5 @@ package console.precompiled; -import static console.common.Common.COMPATIBILITY_VERSION; - import console.ConsoleInitializer; import console.common.Common; import console.common.ConsoleUtils; @@ -121,7 +119,7 @@ public void setSystemConfigByKey(ConsoleInitializer consoleInitializer, String[] String value = params[2]; RetCode retCode = this.systemConfigService.setValueByKey(key, value); ConsoleUtils.printJson(retCode.toString()); - if (key.equals(COMPATIBILITY_VERSION) + if (key.equals(SystemConfigService.COMPATIBILITY_VERSION) && retCode.code == PrecompiledRetCode.CODE_SUCCESS.code) { String[] param = new String[2]; param[1] = consoleInitializer.getGroupID(); From e14099230f2c563c054fe79993eee4df5ecb4e1d Mon Sep 17 00:00:00 2001 From: wenlinli <1574249665@qq.com> Date: Fri, 8 Sep 2023 10:35:50 +0800 Subject: [PATCH 5/8] update openjdk version (#781) Co-authored-by: Kyon <32325790+kyonRay@users.noreply.github.com> --- .ci/ci_check.sh | 2 ++ .github/workflows/workflow.yml | 16 +++++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.ci/ci_check.sh b/.ci/ci_check.sh index 80fc3d24..b963339c 100755 --- a/.ci/ci_check.sh +++ b/.ci/ci_check.sh @@ -114,6 +114,8 @@ bash gradlew test bash gradlew integrationTest --info } +LOG_INFO "------ check java version --------" +java -version #cp src/integration-test/resources/config-example.toml src/integration-test/resources/config.toml download_tassl LOG_INFO "------ download_binary: v3.3.0---------" diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index c0060581..f226f62d 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -21,10 +21,15 @@ jobs: fetch-depth: 5 - name: install Ubuntu dependencies if: runner.os == 'Linux' - run: sudo apt update && sudo apt install -y git curl libssl-dev default-jdk build-essential openssl + run: sudo apt update && sudo apt install -y git curl libssl-dev build-essential openssl - name: install macOS dependencies if: runner.os == 'macOS' - run: brew install openssl@1.1 openjdk + run: brew install openssl@1.1 + - name: Set up JDK 1.8 + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: '8.0.345' - name: run build test if: runner.os == 'Windows' run: ./gradlew.bat build @@ -46,7 +51,12 @@ jobs: with: fetch-depth: 5 - name: install CentOS dependencies - run: yum install -y epel-release centos-release-scl which git openssl-devel openssl java java-devel wget + run: yum install -y epel-release centos-release-scl which git openssl-devel openssl wget + - name: Set up JDK 1.8 + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: '8.0.345' - name: run integration testing run: /bin/bash -x .ci/ci_check.sh - name: upload coverage From 1b83f6c4dade309f92c7060000cd2d6e9ff7badf Mon Sep 17 00:00:00 2001 From: Kyon <32325790+kyonRay@users.noreply.github.com> Date: Mon, 18 Sep 2023 14:07:33 +0800 Subject: [PATCH 6/8] (command,jline): add getCandidateList command, fix jline fresh bug. (#795) --- src/main/java/console/ConsoleInitializer.java | 3 +++ .../console/client/ConsoleClientFace.java | 2 ++ .../console/client/ConsoleClientImpl.java | 13 +++++++++++++ src/main/java/console/command/JlineUtils.java | 19 +++++++++++++++---- .../command/category/ConsensusOpCommand.java | 9 +++++++++ .../java/console/command/model/HelpInfo.java | 6 ++++++ 6 files changed, 48 insertions(+), 4 deletions(-) diff --git a/src/main/java/console/ConsoleInitializer.java b/src/main/java/console/ConsoleInitializer.java index a1ed779d..3a8920e3 100644 --- a/src/main/java/console/ConsoleInitializer.java +++ b/src/main/java/console/ConsoleInitializer.java @@ -6,6 +6,7 @@ import console.client.ConsoleClientImpl; import console.collaboration.CollaborationFace; import console.collaboration.CollaborationImpl; +import console.command.JlineUtils; import console.common.ConsoleUtils; import console.contract.ConsoleContractFace; import console.contract.ConsoleContractImpl; @@ -273,6 +274,8 @@ public void switchGroup(String[] params) { this.consoleContractFace = new ConsoleContractImpl(client); this.collaborationFace = new CollaborationImpl(client); this.authFace = new AuthImpl(client); + JlineUtils.switchGroup(client); + this.lineReader = JlineUtils.getLineReader(); System.out.println("Switched to group " + group + "."); System.out.println(); } catch (Exception e) { diff --git a/src/main/java/console/client/ConsoleClientFace.java b/src/main/java/console/client/ConsoleClientFace.java index dc190c41..b3bd673c 100644 --- a/src/main/java/console/client/ConsoleClientFace.java +++ b/src/main/java/console/client/ConsoleClientFace.java @@ -15,6 +15,8 @@ public interface ConsoleClientFace { void getSealerList(String[] params) throws IOException; + void getCandidateSealerList(String[] params) throws IOException; + void getSyncStatus(String[] params) throws IOException; void getConsensusStatus(String[] params) throws IOException; diff --git a/src/main/java/console/client/ConsoleClientImpl.java b/src/main/java/console/client/ConsoleClientImpl.java index 17c0120f..a4ad8425 100644 --- a/src/main/java/console/client/ConsoleClientImpl.java +++ b/src/main/java/console/client/ConsoleClientImpl.java @@ -76,6 +76,19 @@ public void getSealerList(String[] params) throws IOException { } } + @Override + public void getCandidateSealerList(String[] params) throws IOException { + String sealers = + client.getNodeListByType(nodeName, "consensus_candidate_sealer") + .getSealerList() + .toString(); + if ("[]".equals(sealers)) { + System.out.println("[]"); + } else { + ConsoleUtils.printJson(sealers); + } + } + @Override public void getSyncStatus(String[] params) throws IOException { ConsoleUtils.printJson(client.getSyncStatus(nodeName).getSyncStatus().toString()); diff --git a/src/main/java/console/command/JlineUtils.java b/src/main/java/console/command/JlineUtils.java index 0357a9b6..459d04f0 100644 --- a/src/main/java/console/command/JlineUtils.java +++ b/src/main/java/console/command/JlineUtils.java @@ -25,6 +25,7 @@ import org.jline.reader.Completer; import org.jline.reader.LineReader; import org.jline.reader.LineReaderBuilder; +import org.jline.reader.impl.LineReaderImpl; import org.jline.reader.impl.completer.AggregateCompleter; import org.jline.reader.impl.completer.ArgumentCompleter; import org.jline.reader.impl.completer.StringsCompleter; @@ -43,11 +44,13 @@ public class JlineUtils { private static AccountCompleter accountCompleter = null; private static CurrentPathCompleter currentPathCompleter = null; - public static LineReader getLineReader() throws IOException { - return createLineReader(new ArrayList()); + private static LineReader lineReader = null; + + public static LineReader getLineReader() { + return lineReader; } - public static void switchGroup(Client client) { + public static void switchGroup(Client client) throws IOException { if (contractAddressCompleter != null) { contractAddressCompleter.setClient(client); } @@ -60,6 +63,8 @@ public static void switchGroup(Client client) { if (currentPathCompleter != null) { currentPathCompleter.setClient(client); } + List completers = generateComplters(client); + ((LineReaderImpl) lineReader).setCompleter(new AggregateCompleter(completers)); } public static void switchPwd(String pwd) { @@ -68,6 +73,12 @@ public static void switchPwd(String pwd) { public static LineReader getLineReader(Client client) throws IOException { + List completers = generateComplters(client); + lineReader = createLineReader(completers); + return lineReader; + } + + private static List generateComplters(Client client) { List completers = new ArrayList<>(); List commands = @@ -233,7 +244,7 @@ public static LineReader getLineReader(Client client) throws IOException { currentPathCompleter, new StringsCompleterIgnoreCase())); } - return createLineReader(completers); + return completers; } public static LineReader createLineReader(List completers) throws IOException { diff --git a/src/main/java/console/command/category/ConsensusOpCommand.java b/src/main/java/console/command/category/ConsensusOpCommand.java index 05717414..200a76a1 100644 --- a/src/main/java/console/command/category/ConsensusOpCommand.java +++ b/src/main/java/console/command/category/ConsensusOpCommand.java @@ -68,6 +68,15 @@ public Map getAllCommandInfo(boolean isWasm) { (consoleInitializer, params, pwd) -> consoleInitializer.getConsoleClientFace().getObserverList(params)); + public static final CommandInfo GET_CANDIDATE_LIST = + new CommandInfo( + "getCandidateList", + "Query nodeId list for candidate sealer nodes.", + HelpInfo::getCandidateListHelp, + (consoleInitializer, params, pwd) -> + consoleInitializer + .getConsoleClientFace() + .getCandidateSealerList(params)); public static final CommandInfo GET_PBFT_VIEW = new CommandInfo( "getPbftView", diff --git a/src/main/java/console/command/model/HelpInfo.java b/src/main/java/console/command/model/HelpInfo.java index efeda40d..abb33fcc 100644 --- a/src/main/java/console/command/model/HelpInfo.java +++ b/src/main/java/console/command/model/HelpInfo.java @@ -93,6 +93,12 @@ public static void getObserverListHelp() { System.out.println("Usage: \ngetObserverList"); } + public static void getCandidateListHelp() { + System.out.println("Query nodeId list for candidate sealer nodes."); + System.out.println("NOTE: only for the consensus node of the rPBFT algorithm."); + System.out.println("Usage: \ngetCandidateList"); + } + public static void getSealerListHelp() { System.out.println("Query nodeId list for sealer nodes."); System.out.println("Usage: \ngetSealerList"); From 0962c095a13f6a54eb593ca8935db7fac053a019 Mon Sep 17 00:00:00 2001 From: Kyon <32325790+kyonRay@users.noreply.github.com> Date: Sat, 7 Oct 2023 17:00:49 +0800 Subject: [PATCH 7/8] (client): add default nodeName to send request. (#796) --- build.gradle | 2 +- .../java/console/ConsoleClientTest.java | 2 +- .../java/console/client/ConsoleClientFace.java | 7 ++++--- .../java/console/client/ConsoleClientImpl.java | 18 ++++++++++-------- .../console/command/category/BasicCommand.java | 12 +++++++++--- 5 files changed, 25 insertions(+), 16 deletions(-) diff --git a/build.gradle b/build.gradle index ee9a9edb..95ff6673 100644 --- a/build.gradle +++ b/build.gradle @@ -55,7 +55,7 @@ dependencies { exclude group: "org.fisco-bcos.java-sdk" exclude group: "org.slf4j" } - compile ('com.fasterxml.jackson.core:jackson-databind:2.14.2'){ + compile ('com.fasterxml.jackson.core:jackson-databind:2.14.3'){ force true } testCompile('com.github.stefanbirkner:system-rules:1.19.0') diff --git a/src/integration-test/java/console/ConsoleClientTest.java b/src/integration-test/java/console/ConsoleClientTest.java index 37f8dfe0..18298a3b 100644 --- a/src/integration-test/java/console/ConsoleClientTest.java +++ b/src/integration-test/java/console/ConsoleClientTest.java @@ -90,7 +90,7 @@ public void clientNotParamsTest() throws IOException { consoleClientFace.getGroupInfoList(emptyParams); assertTrue(log.getLog().startsWith("[")); log.clearLog(); - consoleClientFace.getNodeName(); + consoleClientFace.getNodeName(consoleInitializer); } @Test diff --git a/src/main/java/console/client/ConsoleClientFace.java b/src/main/java/console/client/ConsoleClientFace.java index b3bd673c..836a84fa 100644 --- a/src/main/java/console/client/ConsoleClientFace.java +++ b/src/main/java/console/client/ConsoleClientFace.java @@ -1,6 +1,7 @@ package console.client; import com.fasterxml.jackson.core.JsonProcessingException; +import console.ConsoleInitializer; import java.io.IOException; import org.fisco.bcos.sdk.v3.client.Client; @@ -63,9 +64,9 @@ public interface ConsoleClientFace { void getGroupNodeInfo(String[] params) throws JsonProcessingException; - void setNodeName(String[] params) throws IOException; + void setNodeName(ConsoleInitializer consoleInitializer, String[] params) throws IOException; - void clearNodeName(); + void clearNodeName(ConsoleInitializer consoleInitializer); - void getNodeName(); + void getNodeName(ConsoleInitializer consoleInitializer); } diff --git a/src/main/java/console/client/ConsoleClientImpl.java b/src/main/java/console/client/ConsoleClientImpl.java index a4ad8425..a6316f91 100644 --- a/src/main/java/console/client/ConsoleClientImpl.java +++ b/src/main/java/console/client/ConsoleClientImpl.java @@ -1,6 +1,7 @@ package console.client; import com.fasterxml.jackson.core.JsonProcessingException; +import console.ConsoleInitializer; import console.client.model.TotalTransactionCountResult; import console.common.Common; import console.common.ConsoleUtils; @@ -473,7 +474,7 @@ public void getGroupNodeInfo(String[] params) throws JsonProcessingException { } @Override - public void setNodeName(String[] params) { + public void setNodeName(ConsoleInitializer consoleInitializer, String[] params) { String newNodeName = params[1]; List nodeInfos = client.getGroupInfo().getResult().getNodeList(); @@ -491,23 +492,24 @@ public void setNodeName(String[] params) { + ", node not contains in node list, check command 'getGroupInfo'."); return; } - this.nodeName = newNodeName; - getNodeName(); + consoleInitializer.getClient().setNodeToSendRequest(newNodeName); + getNodeName(consoleInitializer); } @Override - public void clearNodeName() { + public void clearNodeName(ConsoleInitializer consoleInitializer) { System.out.println("Clear nodeName to empty."); - this.nodeName = ""; + consoleInitializer.getClient().setNodeToSendRequest(""); } @Override - public void getNodeName() { - if (this.nodeName.isEmpty()) { + public void getNodeName(ConsoleInitializer consoleInitializer) { + String nodeToSendRequest = consoleInitializer.getClient().getNodeToSendRequest(); + if (nodeToSendRequest.isEmpty()) { System.out.println( "Current default node name is empty, RPC will send request to node randomly."); return; } - System.out.println("Current default node name: " + this.nodeName); + System.out.println("Current default node name: " + nodeToSendRequest); } } diff --git a/src/main/java/console/command/category/BasicCommand.java b/src/main/java/console/command/category/BasicCommand.java index f2f9e7af..c74063a9 100644 --- a/src/main/java/console/command/category/BasicCommand.java +++ b/src/main/java/console/command/category/BasicCommand.java @@ -71,7 +71,9 @@ public Map getAllCommandInfo(boolean isWasm) { "Set default node name to send request.", HelpInfo::setNodeNameHelp, (consoleInitializer, params, pwd) -> - consoleInitializer.getConsoleClientFace().setNodeName(params), + consoleInitializer + .getConsoleClientFace() + .setNodeName(consoleInitializer, params), 1, 1); @@ -81,7 +83,9 @@ public Map getAllCommandInfo(boolean isWasm) { "Get default node name in this client.", HelpInfo::getNodeNameHelp, (consoleInitializer, params, pwd) -> - consoleInitializer.getConsoleClientFace().getNodeName(), + consoleInitializer + .getConsoleClientFace() + .getNodeName(consoleInitializer), 0, 0); @@ -91,7 +95,9 @@ public Map getAllCommandInfo(boolean isWasm) { "Clear default node name to empty.", HelpInfo::clearNodeNameHelp, (consoleInitializer, params, pwd) -> - consoleInitializer.getConsoleClientFace().clearNodeName(), + consoleInitializer + .getConsoleClientFace() + .clearNodeName(consoleInitializer), 0, 0); From 67a328eda6936644dabfd8653f68ee1fa61413ca Mon Sep 17 00:00:00 2001 From: Kyon <32325790+kyonRay@users.noreply.github.com> Date: Thu, 12 Oct 2023 02:06:50 -0500 Subject: [PATCH 8/8] (console): fix client rpc interface use sdk nodeName. (#797) --- .ci/ci_check.sh | 14 ++++-- .../console/client/ConsoleClientImpl.java | 48 ++++++++----------- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/.ci/ci_check.sh b/.ci/ci_check.sh index b963339c..a8d8fddc 100755 --- a/.ci/ci_check.sh +++ b/.ci/ci_check.sh @@ -118,9 +118,10 @@ LOG_INFO "------ check java version --------" java -version #cp src/integration-test/resources/config-example.toml src/integration-test/resources/config.toml download_tassl -LOG_INFO "------ download_binary: v3.3.0---------" -download_binary "v3.3.0" -download_build_chain "v3.3.0" + +LOG_INFO "------ download_binary: v3.4.0---------" +download_binary "v3.4.0" +download_build_chain "v3.4.0" LOG_INFO "------ check_standard_node---------" check_standard_node false LOG_INFO "------ check_sm_node---------" @@ -128,6 +129,13 @@ check_sm_node true LOG_INFO "------ check_basic---------" check_basic +LOG_INFO "------ download_binary: v3.3.0---------" +download_binary "v3.3.0" +download_build_chain "v3.3.0" +LOG_INFO "------ check_standard_node---------" +check_standard_node +rm -rf ./bin + LOG_INFO "------ download_binary: v3.2.0---------" download_binary "v3.2.0" download_build_chain "v3.2.0" diff --git a/src/main/java/console/client/ConsoleClientImpl.java b/src/main/java/console/client/ConsoleClientImpl.java index a6316f91..bca4e97b 100644 --- a/src/main/java/console/client/ConsoleClientImpl.java +++ b/src/main/java/console/client/ConsoleClientImpl.java @@ -34,7 +34,6 @@ public class ConsoleClientImpl implements ConsoleClientFace { private static final Logger logger = LoggerFactory.getLogger(ConsoleContractImpl.class); private Client client; - private String nodeName = ""; private static String EMPTY_HASH_HEX = "0x0000000000000000000000000000000000000000000000000000000000000000"; @@ -49,17 +48,17 @@ public void updateClient(Client client) { @Override public void getBlockNumber(String[] params) throws IOException { - System.out.println(client.getBlockNumber(nodeName).getBlockNumber()); + System.out.println(client.getBlockNumber().getBlockNumber()); } @Override public void getPbftView(String[] params) throws IOException { - System.out.println(client.getPbftView(nodeName).getPbftView()); + System.out.println(client.getPbftView().getPbftView()); } @Override public void getObserverList(String[] params) throws IOException { - String observers = client.getObserverList(nodeName).getObserverList().toString(); + String observers = client.getObserverList().getObserverList().toString(); if ("[]".equals(observers)) { System.out.println("[]"); } else { @@ -69,7 +68,7 @@ public void getObserverList(String[] params) throws IOException { @Override public void getSealerList(String[] params) throws IOException { - String sealers = client.getSealerList(nodeName).getSealerList().toString(); + String sealers = client.getSealerList().getSealerList().toString(); if ("[]".equals(sealers)) { System.out.println("[]"); } else { @@ -80,9 +79,7 @@ public void getSealerList(String[] params) throws IOException { @Override public void getCandidateSealerList(String[] params) throws IOException { String sealers = - client.getNodeListByType(nodeName, "consensus_candidate_sealer") - .getSealerList() - .toString(); + client.getNodeListByType("consensus_candidate_sealer").getSealerList().toString(); if ("[]".equals(sealers)) { System.out.println("[]"); } else { @@ -92,7 +89,7 @@ public void getCandidateSealerList(String[] params) throws IOException { @Override public void getSyncStatus(String[] params) throws IOException { - ConsoleUtils.printJson(client.getSyncStatus(nodeName).getSyncStatus().toString()); + ConsoleUtils.printJson(client.getSyncStatus().getSyncStatus().toString()); } @Override @@ -120,7 +117,7 @@ public void getBlockByHash(String[] params) throws IOException { return; } } - BcosBlock.Block block = client.getBlockByHash(nodeName, blockHash, false, flag).getBlock(); + BcosBlock.Block block = client.getBlockByHash(blockHash, false, flag).getBlock(); if (block == null) { System.out.println("Block can not ne found, please check hash: " + blockHash); return; @@ -147,12 +144,12 @@ public void getBlockByNumber(String[] params) throws IOException { } } BcosBlock blockByNumber = - client.getBlockByNumber(nodeName, BigInteger.valueOf(blockNumber), false, flag); + client.getBlockByNumber(BigInteger.valueOf(blockNumber), false, flag); if (blockByNumber.getBlock() == null) { System.out.println("Block not found, please check number: " + blockNumber); } else { ConsoleUtils.printJson( - client.getBlockByNumber(nodeName, BigInteger.valueOf(blockNumber), false, flag) + client.getBlockByNumber(BigInteger.valueOf(blockNumber), false, flag) .getBlock() .toString()); } @@ -162,8 +159,7 @@ public void getBlockByNumber(String[] params) throws IOException { public void getBlockHeaderByHash(String[] params) throws IOException { String blockHash = params[1]; if (ConsoleUtils.isInvalidHash(blockHash)) return; - ConsoleUtils.printJson( - client.getBlockByHash(nodeName, blockHash, true, false).getBlock().toString()); + ConsoleUtils.printJson(client.getBlockByHash(blockHash, true, false).getBlock().toString()); } @Override @@ -192,7 +188,7 @@ public void getBlockHeaderByNumber(String[] params) throws IOException { return; } ConsoleUtils.printJson( - client.getBlockByNumber(nodeName, BigInteger.valueOf(blockNumber), true, false) + client.getBlockByNumber(BigInteger.valueOf(blockNumber), true, false) .getBlock() .toString()); } @@ -202,7 +198,7 @@ public void getTransactionByHash(String[] params) { String transactionHash = params[1]; if (ConsoleUtils.isInvalidHash(transactionHash)) return; JsonTransactionResponse transaction = - client.getTransaction(nodeName, transactionHash, false).getTransaction().get(); + client.getTransaction(transactionHash, false).getTransaction().get(); if (transaction == null) { System.out.println("This transaction hash doesn't exist."); return; @@ -216,9 +212,7 @@ public void getTransactionReceipt(String[] params) throws Exception { if (ConsoleUtils.isInvalidHash(transactionHash)) return; TransactionReceipt receipt = null; try { - receipt = - client.getTransactionReceipt(nodeName, transactionHash, false) - .getTransactionReceipt(); + receipt = client.getTransactionReceipt(transactionHash, false).getTransactionReceipt(); } catch (ClientException e) { System.out.println( "This transaction hash doesn't exist, errorMsg:" + e.getErrorMessage()); @@ -237,7 +231,7 @@ public void getTransactionByHashWithProof(String[] params) throws Exception { String transactionHash = params[1]; if (ConsoleUtils.isInvalidHash(transactionHash)) return; String transactionWithProof = - client.getTransaction(nodeName, transactionHash, true).getResult().toString(); + client.getTransaction(transactionHash, true).getResult().toString(); if (Objects.isNull(transactionWithProof) || transactionWithProof.isEmpty()) { System.out.println("This transaction hash doesn't exist."); @@ -253,9 +247,7 @@ public void getTransactionReceiptByHashWithProof(String[] params) throws Excepti String transactionReceiptWithProof; try { transactionReceiptWithProof = - client.getTransactionReceipt(nodeName, transactionHash, true) - .getResult() - .toString(); + client.getTransactionReceipt(transactionHash, true).getResult().toString(); } catch (ClientException e) { System.out.println( "This transaction hash doesn't exist, errorMsg:" + e.getErrorMessage()); @@ -271,7 +263,7 @@ public void getTransactionReceiptByHashWithProof(String[] params) throws Excepti @Override public void getPendingTxSize(String[] params) throws IOException { - String size = client.getPendingTxSize(nodeName).getResult(); + String size = client.getPendingTxSize().getResult(); System.out.println(Numeric.decodeQuantity(size)); } @@ -291,7 +283,7 @@ public void getCode(String[] params, boolean isWasm, String pwd) throws IOExcept return; } } - String code = client.getCode(nodeName, address).getCode(); + String code = client.getCode(address).getCode(); if ("0x".equals(code) || code.isEmpty()) { System.out.println("This address doesn't exist."); return; @@ -303,7 +295,7 @@ public void getCode(String[] params, boolean isWasm, String pwd) throws IOExcept public void getTotalTransactionCount(String[] params) throws IOException { TotalTransactionCount.TransactionCountInfo transactionCount = - client.getTotalTransactionCount(nodeName).getTotalTransactionCount(); + client.getTotalTransactionCount().getTotalTransactionCount(); TotalTransactionCountResult innerTotalTransactionCountResult = new TotalTransactionCountResult(); @@ -325,11 +317,11 @@ public void getTotalTransactionCount(String[] params) throws IOException { @Override public void getSystemConfigByKey(String[] params) throws Exception { String key = params[1]; - SystemConfig systemConfigByKey = client.getSystemConfigByKey(nodeName, key); + SystemConfig systemConfigByKey = client.getSystemConfigByKey(key); if (systemConfigByKey.getSystemConfig() == null) { System.out.println("System config not found, please check key: " + key); } else { - String value = client.getSystemConfigByKey(nodeName, key).getSystemConfig().getValue(); + String value = client.getSystemConfigByKey(key).getSystemConfig().getValue(); System.out.println(value); } }