diff --git a/.travis.yml b/.travis.yml index c3774b42..d08f2502 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,9 +3,16 @@ branches: only: - /.*/ +matrix: + fast_finish: true + include: + - os: linux + dist: xenial + sudo: required + language: java jdk: - - oraclejdk8 + - openjdk8 before_cache: - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock @@ -20,12 +27,11 @@ before_install: - gradle wrapper script: | - sudo apt install -y openssl curl - curl -LO https://raw.githubusercontent.com/FISCO-BCOS/FISCO-BCOS/master/tools/build_chain.sh && chmod u+x build_chain.sh - bash <(curl -s https://raw.githubusercontent.com/FISCO-BCOS/FISCO-BCOS/master/tools/ci/download_bin.sh) + curl -LO https://raw.githubusercontent.com/FISCO-BCOS/FISCO-BCOS/release-2.0.0-rc2/tools/build_chain.sh && chmod u+x build_chain.sh + bash <(curl -s https://raw.githubusercontent.com/FISCO-BCOS/FISCO-BCOS/release-2.0.0-rc2/tools/ci/download_bin.sh) -b release-2.0.0-rc2 echo "127.0.0.1:4 agency1 1,2,3" > ipconf ./build_chain.sh -e bin/fisco-bcos -f ipconf -p 30300,20200,8545 - cd nodes/127.0.0.1 - ./start_all.sh + ./nodes/127.0.0.1/start_all.sh cp nodes/127.0.0.1/sdk/* src/main/resources/ + mv src/main/resources/applicationContext-sample.xml src/main/resources/applicationContext.xml ./gradlew build \ No newline at end of file diff --git a/Changelog.md b/Changelog.md index 13aa9ac3..04c6567b 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,3 +1,19 @@ +### v1.0.2 + +(2019-04-19) + +* Update + +1. `console/conf`目录下移除`applicationContext.xml`配置文件和`ca.crt`, `node.crt`,`node.key`文件。新增`applicationContext-sample.xml`配置文件。 +2. 一个控制台部署合约,另一个控制台可以直接调用合约。 +3. `callByCNS`支持在不传合约版本号时调用最新版本合约。传入版本号时,其合约名与版本号使用英文冒号分隔,例如`HelloWorld:1.0` +4. 重复创建用户表会提示表已存在的错误信息,无权限的账号对用户表进行增删改操作会提示无权限信息。(适配fisco bcos 2.0.0-rc2) +5. 调用合约时,传入错误合约地址会获取错误提示信息。(适配fisco bcos 2.0.0-rc2) +6. 部署合约后,显示的合约地址前面加字符串`contract address:`。 +7. 合约地址只能省略前缀0,不能省略`0x`。例如`0x000ac78`可以简写成`0xac78`。 +8. `help`命令显示的命令列表进行了字典排序。 + + ### v1.0.1 (2019-04-08) @@ -9,8 +25,9 @@ 3. `start.sh`脚本中增加对Java版本检测。 * Update + 1. 支持合约引入Solidity library库。 -2. 支持合约地址可以省略0x以及前缀0。例如,0x000ac78可以简写成0xac78或ac78。 +2. 支持合约地址可以省略前缀0。例如,`0x000ac78`可以简写成`0xac78`。 3. 优化命令的帮助信息。 ### v1.0.0 diff --git a/build.gradle b/build.gradle index ca2a66b5..d42879a2 100644 --- a/build.gradle +++ b/build.gradle @@ -11,7 +11,7 @@ targetCompatibility = 1.8 repositories { maven { url "http://maven.aliyun.com/nexus/content/groups/public/" } maven { url "https://dl.bintray.com/ethereum/maven/" } -// maven { url "https://oss.sonatype.org/content/repositories/snapshots" } + maven { url "https://oss.sonatype.org/content/repositories/snapshots" } mavenCentral() } @@ -39,16 +39,16 @@ dependencies { compile logger,spring runtime logger,spring -// compile group:"org.fisco-bcos", name:"web3sdk", version:"2.0-SNAPSHOT", changing: true - compile 'org.fisco-bcos:web3sdk:2.0.0-rc1' - compile 'org.jline:jline:3.9.0' + compile group:"org.fisco-bcos", name:"web3sdk", version:"2.0.3-SNAPSHOT", changing: true +// compile 'org.fisco-bcos:web3sdk:2.0.0-rc1' + compile 'org.jline:jline:3.10.0' compile 'io.bretty:console-table-builder:1.2' testCompile 'junit:junit:4.12' } -//configurations.all { -// resolutionStrategy.cacheChangingModulesFor 0, 'seconds' -//} +configurations.all { + resolutionStrategy.cacheChangingModulesFor 0, 'seconds' +} sourceSets { main { java { @@ -74,7 +74,9 @@ jar { into 'dist/lib' } copy { - from file('src/main/resources/') + from file('src/main/resources/applicationContext-sample.xml') + from file('src/main/resources/log4j.properties') + from file('src/main/resources/privateKey.properties') into 'dist/conf' } copy { @@ -87,14 +89,12 @@ jar { into 'dist/tools/' } copy { - from file('src/main/resources/contract/HelloWorld.sol') - from file('src/main/resources/contract/Table.sol') - from file('src/main/resources/contract/TableTest.sol') - into 'dist/solidity/contracts' + from file('src/main/resources/contract/') + into 'dist/solidity/contracts/' } copy { from file('src/main/resources/contract/Table.sol') - into 'dist/tools/contracts' + into 'dist/tools/contracts/' } } } diff --git a/release_note.txt b/release_note.txt index b18d4654..570c7965 100644 --- a/release_note.txt +++ b/release_note.txt @@ -1 +1 @@ -v1.0.1 +v1.0.2 diff --git a/src/main/java/console/ConsoleClient.java b/src/main/java/console/ConsoleClient.java index 1533edad..f192107b 100644 --- a/src/main/java/console/ConsoleClient.java +++ b/src/main/java/console/ConsoleClient.java @@ -2,9 +2,13 @@ import java.io.IOException; import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; import java.nio.file.FileSystems; import java.nio.file.Path; import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Iterator; import java.util.List; import org.fisco.bcos.web3j.protocol.ObjectMapperFactory; @@ -12,10 +16,13 @@ import org.fisco.bcos.web3j.protocol.core.Response; import org.fisco.bcos.web3j.protocol.exceptions.MessageDecodingException; import org.jline.builtins.Completers.FilesCompleter; +import org.jline.reader.Buffer; +import org.jline.reader.Candidate; import org.jline.reader.Completer; import org.jline.reader.EndOfFileException; import org.jline.reader.LineReader; import org.jline.reader.LineReaderBuilder; +import org.jline.reader.ParsedLine; import org.jline.reader.UserInterruptException; import org.jline.reader.impl.completer.AggregateCompleter; import org.jline.reader.impl.completer.ArgumentCompleter; @@ -24,89 +31,93 @@ import org.jline.terminal.Attributes.ControlChar; import org.jline.terminal.Terminal; import org.jline.terminal.TerminalBuilder; +import org.jline.utils.AttributedString; import console.common.Common; import console.common.ConsoleUtils; import console.common.HelpInfo; +class StringsCompleterIgnoreCase implements Completer { + protected final Collection candidates = new ArrayList<>(); + + public StringsCompleterIgnoreCase() { + } + + public StringsCompleterIgnoreCase(String... strings) { + this(Arrays.asList(strings)); + } + + public StringsCompleterIgnoreCase(Iterable strings) { + assert strings != null; + for (String string : strings) { + candidates.add(new Candidate(AttributedString.stripAnsi(string), string, null, null, null, null, true)); + } + } + + public void complete(LineReader reader, final ParsedLine commandLine, final List candidates) { + assert commandLine != null; + assert candidates != null; + + Buffer buffer = reader.getBuffer(); + String start = (buffer == null) ? "" : buffer.toString(); + int index = start.lastIndexOf(" "); + String tmp = start.substring(index + 1, start.length()).toLowerCase(); + + for (Iterator iter = this.candidates.iterator(); iter.hasNext();) { + Candidate candidate = iter.next(); + String candidateStr = candidate.value().toLowerCase(); + if (candidateStr.startsWith(tmp)) { + candidates.add(candidate); + } + } + } +} + public class ConsoleClient { @SuppressWarnings("resource") public static void main(String[] args) { - ConsoleFace console = null; - LineReader lineReader = null; - try { - - console = new ConsoleImpl(); - console.init(args); - console.welcome(); + ConsoleFace console = null; + LineReader lineReader = null; + try { + + console = new ConsoleImpl(); + console.init(args); + console.welcome(); List completers = new ArrayList(); - completers.add(new ArgumentCompleter(new StringsCompleter("help"))); - completers.add(new ArgumentCompleter(new StringsCompleter("switch"))); - completers.add(new ArgumentCompleter(new StringsCompleter("getBlockNumber"))); - completers.add(new ArgumentCompleter(new StringsCompleter("getPbftView"))); - completers.add(new ArgumentCompleter(new StringsCompleter("getSealerList"))); - completers.add(new ArgumentCompleter(new StringsCompleter("getObserverList"))); - completers.add(new ArgumentCompleter(new StringsCompleter("getConsensusStatus"))); - completers.add(new ArgumentCompleter(new StringsCompleter("getSyncStatus"))); - completers.add(new ArgumentCompleter(new StringsCompleter("getNodeVersion"))); - completers.add(new ArgumentCompleter(new StringsCompleter("getPeers"))); - completers.add(new ArgumentCompleter(new StringsCompleter("getNodeIDList"))); - completers.add(new ArgumentCompleter(new StringsCompleter("getGroupPeers"))); - completers.add(new ArgumentCompleter(new StringsCompleter("getGroupList"))); - completers.add(new ArgumentCompleter(new StringsCompleter("getBlockByHash"))); - completers.add(new ArgumentCompleter(new StringsCompleter("getBlockByNumber"))); - completers.add(new ArgumentCompleter(new StringsCompleter("getBlockHashByNumber"))); - completers.add(new ArgumentCompleter(new StringsCompleter("getTransactionByHash"))); - completers.add( - new ArgumentCompleter(new StringsCompleter("getTransactionByBlockHashAndIndex"))); - completers.add( - new ArgumentCompleter(new StringsCompleter("getTransactionByBlockNumberAndIndex"))); - completers.add(new ArgumentCompleter(new StringsCompleter("getTransactionReceipt"))); - completers.add(new ArgumentCompleter(new StringsCompleter("getPendingTransactions"))); - completers.add(new ArgumentCompleter(new StringsCompleter("getPendingTxSize"))); - completers.add(new ArgumentCompleter(new StringsCompleter("getCode"))); - completers.add(new ArgumentCompleter(new StringsCompleter("getTotalTransactionCount"))); + + List commands = Arrays.asList("help", "switch", "getBlockNumber", "getPbftView", "getSealerList", + "getObserverList", "getConsensusStatus", "getSyncStatus", "getNodeVersion", "getPeers", "getNodeIDList", + "getGroupPeers", "getGroupList", "getBlockByHash", "getBlockByNumber", "getBlockHashByNumber", + "getTransactionByHash", "getTransactionByBlockHashAndIndex", "getTransactionByBlockNumberAndIndex", + "getTransactionReceipt", "getPendingTransactions", "getPendingTxSize", "getCode", "getTotalTransactionCount", + "getDeployLog", "addSealer", "addObserver", "removeNode", "grantUserTableManager", "revokeUserTableManager", + "listUserTableManager", "grantDeployAndCreateManager", "revokeDeployAndCreateManager", + "listDeployAndCreateManager", "grantPermissionManager", "revokePermissionManager", "listPermissionManager", + "grantNodeManager", "revokeNodeManager", "listNodeManager", "grantCNSManager", "revokeCNSManager", + "listCNSManager", "grantSysConfigManager", "revokeSysConfigManager", "listSysConfigManager", "quit", "exit"); + + for (String command : commands) { + completers.add(new ArgumentCompleter(new StringsCompleterIgnoreCase(command), new StringsCompleterIgnoreCase())); + } + Path path = FileSystems.getDefault().getPath("solidity/contracts/", ""); - completers.add( - new ArgumentCompleter(new StringsCompleter("deploy"), new FilesCompleter(path))); - completers.add(new ArgumentCompleter(new StringsCompleter("call"), new FilesCompleter(path))); - completers.add( - new ArgumentCompleter(new StringsCompleter("deployByCNS"), new FilesCompleter(path))); - completers.add( - new ArgumentCompleter(new StringsCompleter("callByCNS"), new FilesCompleter(path))); - completers.add( - new ArgumentCompleter(new StringsCompleter("queryCNS"), new FilesCompleter(path))); - completers.add(new ArgumentCompleter(new StringsCompleter("getDeployLog"))); - completers.add(new ArgumentCompleter(new StringsCompleter("addSealer"))); - completers.add(new ArgumentCompleter(new StringsCompleter("addObserver"))); - completers.add(new ArgumentCompleter(new StringsCompleter("removeNode"))); - completers.add(new ArgumentCompleter(new StringsCompleter("grantUserTableManager"))); - completers.add(new ArgumentCompleter(new StringsCompleter("revokeUserTableManager"))); - completers.add(new ArgumentCompleter(new StringsCompleter("listUserTableManager"))); - completers.add(new ArgumentCompleter(new StringsCompleter("grantDeployAndCreateManager"))); - completers.add(new ArgumentCompleter(new StringsCompleter("revokeDeployAndCreateManager"))); - completers.add(new ArgumentCompleter(new StringsCompleter("listDeployAndCreateManager"))); - completers.add(new ArgumentCompleter(new StringsCompleter("grantPermissionManager"))); - completers.add(new ArgumentCompleter(new StringsCompleter("revokePermissionManager"))); - completers.add(new ArgumentCompleter(new StringsCompleter("listPermissionManager"))); - completers.add(new ArgumentCompleter(new StringsCompleter("grantNodeManager"))); - completers.add(new ArgumentCompleter(new StringsCompleter("revokeNodeManager"))); - completers.add(new ArgumentCompleter(new StringsCompleter("listNodeManager"))); - completers.add(new ArgumentCompleter(new StringsCompleter("grantCNSManager"))); - completers.add(new ArgumentCompleter(new StringsCompleter("revokeCNSManager"))); - completers.add(new ArgumentCompleter(new StringsCompleter("listCNSManager"))); - completers.add(new ArgumentCompleter(new StringsCompleter("grantSysConfigManager"))); - completers.add(new ArgumentCompleter(new StringsCompleter("revokeSysConfigManager"))); - completers.add(new ArgumentCompleter(new StringsCompleter("listSysConfigManager"))); - completers.add(new ArgumentCompleter(new StringsCompleter("setSystemConfigByKey"), new StringsCompleter(Common.TxCountLimit))); - completers.add(new ArgumentCompleter(new StringsCompleter("setSystemConfigByKey"), new StringsCompleter(Common.TxGasLimit))); - completers.add(new ArgumentCompleter(new StringsCompleter("getSystemConfigByKey"), new StringsCompleter(Common.TxCountLimit))); - completers.add(new ArgumentCompleter(new StringsCompleter("getSystemConfigByKey"), new StringsCompleter(Common.TxGasLimit))); - completers.add(new ArgumentCompleter(new StringsCompleter("quit"))); - completers.add(new ArgumentCompleter(new StringsCompleter("exit"))); + commands = Arrays.asList("deploy", "call", "deployByCNS", "callByCNS", "queryCNS"); - Terminal terminal = TerminalBuilder.builder() + for (String command : commands) { + completers.add(new ArgumentCompleter(new StringsCompleter(command), new FilesCompleter(path), new StringsCompleterIgnoreCase())); + } + + commands = Arrays.asList("setSystemConfigByKey", "getSystemConfigByKey"); + + for (String command : commands) { + completers.add(new ArgumentCompleter(new StringsCompleter(command), + new StringsCompleter(Common.TxCountLimit), new StringsCompleterIgnoreCase())); + completers.add(new ArgumentCompleter(new StringsCompleter(command), + new StringsCompleter(Common.TxGasLimit), new StringsCompleterIgnoreCase())); + } + + Terminal terminal = TerminalBuilder.builder() .nativeSignals(true) .signalHandler(Terminal.SignalHandler.SIG_IGN) .build(); @@ -116,271 +127,126 @@ public static void main(String[] args) { // enable CTRL+C shortcut termAttribs.setControlChar(ControlChar.VINTR, 4); terminal.setAttributes(termAttribs); - lineReader = - LineReaderBuilder.builder() - .terminal(terminal) - .completer(new AggregateCompleter(completers)) - .build(); - }catch (Exception e) { - System.out.println(e.getMessage()); - return; - } - - while (true) { - - try { - String request = lineReader.readLine("[group:"+ConsoleImpl.groupID+"]> "); - String[] params = null; - params = ConsoleUtils.tokenizeCommand(request); - if (params.length < 1) { - System.out.print(""); - continue; - } - if ("".equals(params[0].trim())) { - System.out.print(""); - continue; - } - if ("quit".equals(params[0]) || "q".equals(params[0]) || "exit".equals(params[0])) { - if (HelpInfo.promptNoParams(params, "q")) { - continue; - } else if (params.length > 2) { - HelpInfo.promptHelp("q"); - continue; - } - console.close(); - break; - } - switch (params[0]) { - case "help": - case "h": - console.help(params); - break; - case "switch": - case "s": + lineReader = LineReaderBuilder.builder().terminal(terminal). + completer(new AggregateCompleter(completers)). + build().option(LineReader.Option.HISTORY_IGNORE_SPACE, false) + .option(LineReader.Option.HISTORY_REDUCE_BLANKS, false); + } catch (Exception e) { + System.out.println(e.getMessage()); + return; + } + + while (true) { + + try { + String request = lineReader.readLine("[group:" + ConsoleImpl.groupID + "]> "); + String[] params = null; + params = ConsoleUtils.tokenizeCommand(request); + if (params.length < 1) { + System.out.print(""); + continue; + } + if ("".equals(params[0].trim())) { + System.out.print(""); + continue; + } + + String command = params[0].trim().toLowerCase(); + + if ("quit".equals(command) || "q".equals(command) || "exit".equals(command)) { + if (HelpInfo.promptNoParams(params, "q")) { + continue; + } else if (params.length > 2) { + HelpInfo.promptHelp("q"); + continue; + } + console.close(); + break; + } + + if ("h".equals(command) || "help".equals(command)) { + console.help(params); + } else { + if ("s".equals(command) || "switch".equals(command)) { console.switchGroupID(params); - break; - case "getBlockNumber": - console.getBlockNumber(params); - break; - case "getPbftView": - console.getPbftView(params); - break; - case "getSealerList": - console.getSealerList(params); - break; - case "getObserverList": - console.getObserverList(params); - break; - case "getConsensusStatus": - console.getConsensusStatus(params); - break; - case "getSyncStatus": - console.getSyncStatus(params); - break; - case "getNodeVersion": - console.getNodeVersion(params); - break; - case "getPeers": - console.getPeers(params); - break; - case "getNodeIDList": - console.getNodeIDList(params); - break; - case "getGroupPeers": - console.getGroupPeers(params); - break; - case "getGroupList": - console.getGroupList(params); - break; - case "getBlockByHash": - console.getBlockByHash(params); - break; - case "getBlockByNumber": - console.getBlockByNumber(params); - break; - case "getBlockHashByNumber": - console.getBlockHashByNumber(params); - break; - case "getTransactionByHash": - console.getTransactionByHash(params); - break; - case "getTransactionByBlockHashAndIndex": - console.getTransactionByBlockHashAndIndex(params); - break; - case "getTransactionByBlockNumberAndIndex": - console.getTransactionByBlockNumberAndIndex(params); - break; - case "getTransactionReceipt": - console.getTransactionReceipt(params); - break; - case "getPendingTransactions": - console.getPendingTransactions(params); - break; - case "getPendingTxSize": - console.getPendingTxSize(params); - break; - case "getCode": - console.getCode(params); - break; - case "getTotalTransactionCount": - console.getTotalTransactionCount(params); - break; - case "deploy": - console.deploy(params); - break; - case "getDeployLog": - console.getDeployLog(params); - break; - case "call": - console.call(params); - break; - case "deployByCNS": - console.deployByCNS(params); - break; - case "callByCNS": - console.callByCNS(params); - break; - case "queryCNS": - console.queryCNS(params); - break; - case "addSealer": - console.addSealer(params); - break; - case "addObserver": - console.addObserver(params); - break; - case "removeNode": - console.removeNode(params); - break; - case "setSystemConfigByKey": - console.setSystemConfigByKey(params); - break; - case "getSystemConfigByKey": - console.getSystemConfigByKey(params); - break; - case "grantUserTableManager": - console.grantUserTableManager(params); - break; - case "revokeUserTableManager": - console.revokeUserTableManager(params); - break; - case "listUserTableManager": - console.listUserTableManager(params); - break; - case "grantDeployAndCreateManager": - console.grantDeployAndCreateManager(params); - break; - case "revokeDeployAndCreateManager": - console.revokeDeployAndCreateManager(params); - break; - case "listDeployAndCreateManager": - console.listDeployAndCreateManager(params); - break; - case "grantPermissionManager": - console.grantPermissionManager(params); - break; - case "revokePermissionManager": - console.revokePermissionManager(params); - break; - case "listPermissionManager": - console.listPermissionManager(params); - break; - case "grantNodeManager": - console.grantNodeManager(params); - break; - case "revokeNodeManager": - console.revokeNodeManager(params); - break; - case "listNodeManager": - console.listNodeManager(params); - break; - case "grantCNSManager": - console.grantCNSManager(params); - break; - case "revokeCNSManager": - console.revokeCNSManager(params); - break; - case "listCNSManager": - console.listCNSManager(params); - break; - case "grantSysConfigManager": - console.grantSysConfigManager(params); - break; - case "revokeSysConfigManager": - console.revokeSysConfigManager(params); - break; - case "listSysConfigManager": - console.listSysConfigManager(params); - break; - default: - System.out.println("Undefined command: \"" + params[0] + "\". Try \"help\".\n"); - break; + } else { + Class consoleClass = console.getClass(); + try { + Method method = consoleClass.getDeclaredMethod(params[0].trim(), String[].class); + method.invoke(console, (Object) params); + } catch (NoSuchMethodException e) { + System.out.println("Undefined command: \"" + params[0] + "\". Try \"help\".\n"); + } + } } - - }catch (ResponseExcepiton e) { - ConsoleUtils.printJson( - "{\"code\":" + e.getCode() + ", \"msg\":" + "\"" + e.getMessage() + "\"}"); + } + catch (ResponseExcepiton e) { + ConsoleUtils.printJson("{\"code\":" + e.getCode() + ", \"msg\":" + "\"" + e.getMessage() + "\"}"); System.out.println(); } catch (ClassNotFoundException e) { System.out.println(e.getMessage() + " does not exist."); System.out.println(); } catch (MessageDecodingException e) { pringMessageDecodeingException(e); - }catch (IOException e) { + } catch (IOException e) { if (e.getMessage().startsWith("activeConnections")) { - System.out.println("Lost the connection to the node. " - + "Please check the connection between the console and the node."); - } else if (e.getMessage().startsWith("No value")) { System.out.println( - "The groupID is not configured in dist/conf/applicationContext.xml file."); + "Lost the connection to the node. " + "Please check the connection between the console and the node."); + } else if (e.getMessage().startsWith("No value")) { + System.out.println("The groupID is not configured in dist/conf/applicationContext.xml file."); } else { System.out.println(e.getMessage()); } System.out.println(); } catch (InvocationTargetException e) { - System.out.println("Contract call failed."); - System.out.println(); + Throwable targetException = e.getTargetException(); + if(targetException.getMessage().contains("\"status\":\"0x1a\"")) + { + System.out.println("The contract address is incorrect."); + } + else + { + System.out.println(targetException.getMessage()); + } + System.out.println(); } catch (UserInterruptException e) { console.close(); } catch (EndOfFileException e) { console.close(); - } - catch (Exception e) { - if(e.getMessage().contains("MessageDecodingException")) + } catch (Exception e) { + if (e.getMessage().contains("MessageDecodingException")) { + pringMessageDecodeingException( + new MessageDecodingException(e.getMessage().split("MessageDecodingException: ")[1])); + } + if(e.getMessage().contains("\"status\":\"0x1a\"")) { - pringMessageDecodeingException(new MessageDecodingException(e.getMessage().split("MessageDecodingException: ")[1])); + System.out.println("The contract address is incorrect."); } - else { - System.out.println(e.getMessage()); - System.out.println(); - } - } - } + else { + System.out.println(e.getMessage()); + } + System.out.println(); + } + } } - private static void pringMessageDecodeingException(MessageDecodingException e) { - String message = e.getMessage(); - Response t = null; - try { - t = ObjectMapperFactory.getObjectMapper(true).readValue( - message.substring(message.indexOf("{"), message.lastIndexOf("}") + 1), - Response.class); - if (t != null) { - ConsoleUtils.printJson( - "{\"code\":" - + t.getError().getCode() - + ", \"msg\":" - + "\"" - + t.getError().getMessage() - + "\"}"); - System.out.println(); - } - }catch (Exception e1) { - System.out.println(e1.getMessage()); - System.out.println(); + private static void pringMessageDecodeingException(MessageDecodingException e) { + String message = e.getMessage(); + Response t = null; + try { + t = ObjectMapperFactory.getObjectMapper(true) + .readValue(message.substring(message.indexOf("{"), message.lastIndexOf("}") + 1), Response.class); + if (t != null) { + ConsoleUtils + .printJson("{\"code\":" + t.getError().getCode() + ", \"msg\":" + "\"" + t.getError().getMessage() + "\"}"); + System.out.println(); + } + } catch (Exception e1) { + System.out.println(e1.getMessage()); + System.out.println(); } - } + } } diff --git a/src/main/java/console/ConsoleImpl.java b/src/main/java/console/ConsoleImpl.java index 03dfb8fe..1ccecc37 100644 --- a/src/main/java/console/ConsoleImpl.java +++ b/src/main/java/console/ConsoleImpl.java @@ -60,7 +60,6 @@ import console.common.ConsoleVersion; import console.common.ContractClassFactory; import console.common.HelpInfo; -import console.exception.CompileSolidityException; import console.exception.ConsoleMessageException; import io.bretty.console.table.Alignment; import io.bretty.console.table.ColumnFormatter; @@ -131,6 +130,11 @@ public void init(String[] args) { } try { credentials = GenCredential.create(privateKey); + if(credentials == null) + { + System.out.println("Please provide a valid private key."); + close(); + } } catch (NumberFormatException e) { System.out.println("Please provide private key by hex format."); close(); @@ -216,88 +220,61 @@ public void help(String[] params) { } ConsoleUtils.singleLine(); StringBuilder sb = new StringBuilder(); - sb.append("help(h) Provide help information.\n"); - sb.append("switch(s) Switch to a specific group by group ID.\n"); - sb.append("getBlockNumber Query the number of most recent block.\n"); - sb.append("getPbftView Query the pbft view of node.\n"); - sb.append("getSealerList Query nodeId list for sealer nodes.\n"); - sb.append("getObserverList Query nodeId list for observer nodes.\n"); - sb.append( - "getNodeIDList Query nodeId list for all connected nodes.\n"); - sb.append( - "getGroupPeers Query nodeId list for sealer and observer nodes.\n"); - sb.append( - "getPeers Query peers currently connected to the client.\n"); - sb.append("getConsensusStatus Query consensus status.\n"); - sb.append("getSyncStatus Query sync status.\n"); - sb.append("getNodeVersion Query the current node version.\n"); - sb.append("getGroupList Query group list.\n"); - sb.append( - "getBlockByHash Query information about a block by hash.\n"); - sb.append( - "getBlockByNumber Query information about a block by block number.\n"); - sb.append("getBlockHashByNumber Query block hash by block number.\n"); - sb.append( - "getTransactionByHash Query information about a transaction requested by transaction hash.\n"); - sb.append( - "getTransactionByBlockHashAndIndex Query information about a transaction by block hash and transaction index position.\n"); - sb.append( - "getTransactionByBlockNumberAndIndex Query information about a transaction by block number and transaction index position.\n"); - sb.append( - "getTransactionReceipt Query the receipt of a transaction by transaction hash.\n"); - sb.append("getPendingTransactions Query pending transactions.\n"); - sb.append("getPendingTxSize Query pending transactions size.\n"); - sb.append("getCode Query code at a given address.\n"); - sb.append("getTotalTransactionCount Query total transaction count.\n"); - sb.append("deploy Deploy a contract on blockchain.\n"); - sb.append("getDeployLog Query the log of deployed contracts.\n"); - sb.append( - "call Call a contract by a function and paramters.\n"); - sb.append("deployByCNS Deploy a contract on blockchain by CNS.\n"); - sb.append( - "queryCNS Query CNS information by contract name and contract version.\n"); - sb.append( - "callByCNS Call a contract by a function and paramters by CNS.\n"); - sb.append("addSealer Add a sealer node.\n"); - sb.append("addObserver Add an observer node.\n"); - sb.append("removeNode Remove a node.\n"); - sb.append("setSystemConfigByKey Set a system config.\n"); - sb.append("getSystemConfigByKey Query a system config value by key.\n"); - sb.append( - "grantPermissionManager Grant permission for permission configuration by address.\n"); - sb.append( - "revokePermissionManager Revoke permission for permission configuration by address.\n"); - sb.append( - "listPermissionManager Query permission information for permission configuration.\n"); - sb.append( - "grantUserTableManager Grant permission for user table by table name and address.\n"); - sb.append( - "revokeUserTableManager Revoke permission for user table by table name and address.\n"); - sb.append( - "listUserTableManager Query permission for user table information.\n"); - sb.append( - "grantDeployAndCreateManager Grant permission for deploy contract and create user table by address.\n"); - sb.append( - "revokeDeployAndCreateManager Revoke permission for deploy contract and create user table by address.\n"); - sb.append( - "listDeployAndCreateManager Query permission information for deploy contract and create user table.\n"); - sb.append( - "grantNodeManager Grant permission for node configuration by address.\n"); - sb.append( - "revokeNodeManager Revoke permission for node configuration by address.\n"); - sb.append( - "listNodeManager Query permission information for node configuration.\n"); - sb.append("grantCNSManager Grant permission for CNS by address.\n"); - sb.append("revokeCNSManager Revoke permission for CNS by address.\n"); - sb.append("listCNSManager Query permission information for CNS.\n"); - sb.append( - "grantSysConfigManager Grant permission for system configuration by address.\n"); - sb.append( - "revokeSysConfigManager Revoke permission for system configuration by address.\n"); - sb.append( - "listSysConfigManager Query permission information for system configuration.\n"); - sb.append("quit(q) Quit console.\n"); - sb.append("exit Quit console."); + sb.append("addObserver Add an observer node.\n"); + sb.append("addSealer Add a sealer node.\n"); + sb.append("call Call a contract by a function and paramters.\n"); + sb.append("callByCNS Call a contract by a function and paramters by CNS.\n"); + sb.append("deploy Deploy a contract on blockchain.\n"); + sb.append("deployByCNS Deploy a contract on blockchain by CNS.\n"); + sb.append("exit Quit console.\n"); + sb.append("getBlockByHash Query information about a block by hash.\n"); + sb.append("getBlockByNumber Query information about a block by block number.\n"); + sb.append("getBlockHashByNumber Query block hash by block number.\n"); + sb.append("getBlockNumber Query the number of most recent block.\n"); + sb.append("getCode Query code at a given address.\n"); + sb.append("getConsensusStatus Query consensus status.\n"); + sb.append("getDeployLog Query the log of deployed contracts.\n"); + sb.append("getGroupList Query group list.\n"); + sb.append("getGroupPeers Query nodeId list for sealer and observer nodes.\n"); + sb.append("getNodeIDList Query nodeId list for all connected nodes.\n"); + sb.append("getNodeVersion Query the current node version.\n"); + sb.append("getObserverList Query nodeId list for observer nodes.\n"); + sb.append("getPbftView Query the pbft view of node.\n"); + sb.append("getPeers Query peers currently connected to the client.\n"); + sb.append("getPendingTransactions Query pending transactions.\n"); + sb.append("getPendingTxSize Query pending transactions size.\n"); + sb.append("getSealerList Query nodeId list for sealer nodes.\n"); + sb.append("getSyncStatus Query sync status.\n"); + sb.append("getSystemConfigByKey Query a system config value by key.\n"); + sb.append("getTotalTransactionCount Query total transaction count.\n"); + sb.append("getTransactionByBlockHashAndIndex Query information about a transaction by block hash and transaction index position.\n"); + sb.append("getTransactionByBlockNumberAndIndex Query information about a transaction by block number and transaction index position.\n"); + sb.append("getTransactionByHash Query information about a transaction requested by transaction hash.\n"); + sb.append("getTransactionReceipt Query the receipt of a transaction by transaction hash.\n"); + sb.append("grantCNSManager Grant permission for CNS by address.\n"); + sb.append("grantDeployAndCreateManager Grant permission for deploy contract and create user table by address.\n"); + sb.append("grantNodeManager Grant permission for node configuration by address.\n"); + sb.append("grantPermissionManager Grant permission for permission configuration by address.\n"); + sb.append("grantSysConfigManager Grant permission for system configuration by address.\n"); + sb.append("grantUserTableManager Grant permission for user table by table name and address.\n"); + sb.append("help(h) Provide help information.\n"); + sb.append("listCNSManager Query permission information for CNS.\n"); + sb.append("listDeployAndCreateManager Query permission information for deploy contract and create user table.\n"); + sb.append("listNodeManager Query permission information for node configuration.\n"); + sb.append("listPermissionManager Query permission information for permission configuration.\n"); + sb.append("listSysConfigManager Query permission information for system configuration.\n"); + sb.append("listUserTableManager Query permission for user table information.\n"); + sb.append("queryCNS Query CNS information by contract name and contract version.\n"); + sb.append("quit(q) Quit console.\n"); + sb.append("removeNode Remove a node.\n"); + sb.append("revokeCNSManager Revoke permission for CNS by address.\n"); + sb.append("revokeDeployAndCreateManager Revoke permission for deploy contract and create user table by address.\n"); + sb.append("revokeNodeManager Revoke permission for node configuration by address.\n"); + sb.append("revokePermissionManager Revoke permission for permission configuration by address.\n"); + sb.append("revokeSysConfigManager Revoke permission for system configuration by address.\n"); + sb.append("revokeUserTableManager Revoke permission for user table by table name and address.\n"); + sb.append("setSystemConfigByKey Set a system config.\n"); + sb.append("switch(s) Switch to a specific group by group ID."); System.out.println(sb.toString()); ConsoleUtils.singleLine(); System.out.println(); @@ -820,25 +797,12 @@ public void deploy(String[] params) throws Exception { name = name.substring(0, name.length() - 4); } try { - ConsoleUtils.dynamicCompileSolFilesToJava(name); - }catch (CompileSolidityException e) { - System.out.println(e.getMessage()); - return; - }catch (IOException e) { - System.out.println(e.getMessage()); - System.out.println(); - return; - } - ConsoleUtils.dynamicCompileJavaToClass(name); - contractName = ConsoleUtils.PACKAGENAME + "." + name; - try { - contractClass = getContractClass(contractName); - } catch (Exception e) { - System.out.println( - "There is no " + name + ".class" + " in the directory of solidity/java/classes/org/fisco/bcos/temp/."); - System.out.println(); - return; - } + compileContract(name); + } catch (Exception e) { + System.out.println(e.getMessage()); + System.out.println(); + return; + } try { handleDeployParameters(params, 2); } catch (ConsoleMessageException e) { @@ -849,7 +813,7 @@ public void deploy(String[] params) throws Exception { try { Contract contract = (Contract) remoteCall.send(); contractAddress = contract.getContractAddress(); - System.out.println(contractAddress); + System.out.println("contract address:" + contractAddress); System.out.println(); contractAddress = contract.getContractAddress(); writeLog(); @@ -857,7 +821,8 @@ public void deploy(String[] params) throws Exception { if (e.getMessage().contains("0x19")) { ConsoleUtils.printJson(PrecompiledCommon.transferToJson(PrecompiledCommon.PermissionDenied)); } else { - throw e; + System.out.println(e.getMessage()); + System.out.println(); } } @@ -1016,18 +981,13 @@ public void call(String[] params) throws Exception { if (name.endsWith(".sol")) { name = name.substring(0, name.length() - 4); } - contractName = ConsoleUtils.PACKAGENAME + "." + name; try { - contractClass = getContractClass(contractName); - } catch (Exception e) { - System.out.println( - "There is no " - + name - + ".class" - + " in the directory of java/classes/org/fisco/bcos/temp"); - System.out.println(); - return; - } + compileContract(name); + } catch (Exception e) { + System.out.println(e.getMessage()); + System.out.println(); + return; + } Method load = contractClass.getMethod( "load", @@ -1049,7 +1009,7 @@ public void call(String[] params) throws Exception { Method[] methods = contractClass.getDeclaredMethods(); Method method = ContractClassFactory.getMethodByName(funcName, methods); if(method == null) { - System.out.println("Cannot find the method. Please checkout the method name."); + System.out.println("Cannot find the method " + funcName + ", please checkout the method name."); System.out.println(); return; } @@ -1082,12 +1042,34 @@ public void call(String[] params) throws Exception { if(result instanceof TransactionReceipt) { TransactionReceipt receipt = (TransactionReceipt)result; + if("0x1a".equals(receipt.getStatus())) + { + System.out.println("The contract address is incorrect."); + System.out.println(); + return; + } if(!"0x0".equals(receipt.getStatus())) { - System.out.println("Call failed."); + System.out.println(receipt.getStatus()); System.out.println(); return; } + String output = receipt.getOutput(); + if (!"0x".equals(output)) { + int code = new BigInteger(output.substring(2, output.length()), 16).intValue(); + if(code == PrecompiledCommon.TableExist) + { + System.out.println("The table already exist."); + System.out.println(); + return; + } + if(code == PrecompiledCommon.PermissionDenied) + { + System.out.println("Permission denied."); + System.out.println(); + return; + } + } } String returnObject = ContractClassFactory.getReturnObject(contractClass, funcName, parameterType, result); @@ -1145,25 +1127,12 @@ public void deployByCNS(String[] params) throws Exception { return; } try { - ConsoleUtils.dynamicCompileSolFilesToJava(name); - } catch (CompileSolidityException e) { - System.out.println(e.getMessage()); - return; - } catch (IOException e) { - System.out.println(e.getMessage()); - System.out.println(); - return; - } - contractName = ConsoleUtils.PACKAGENAME + "." + name; - ConsoleUtils.dynamicCompileJavaToClass(name); - try { - contractClass = getContractClass(contractName); - } catch (Exception e) { - System.out.println( - "There is no " + name + ".class" + " in the directory of solidity/java/classes/org/fisco/bcos/temp/."); - System.out.println(); - return; - } + compileContract(name); + } catch (Exception e) { + System.out.println(e.getMessage()); + System.out.println(); + return; + } try { handleDeployParameters(params, 3); } catch (ConsoleMessageException e) { @@ -1187,15 +1156,17 @@ public void deployByCNS(String[] params) throws Exception { contractAddress = contract.getContractAddress(); // register cns String result = cnsService.registerCns(name, contractVersion, contractAddress, ""); - System.out.println(contractAddress); + System.out.println("contract address:" + contractAddress); contractName = contractName+":"+contractVersion; writeLog(); System.out.println(); } catch (Exception e) { if (e.getMessage().contains("0x19")) { ConsoleUtils.printJson(PrecompiledCommon.transferToJson(PrecompiledCommon.PermissionDenied)); - } else { - throw e; + } + else { + System.out.println(e.getMessage()); + System.out.println(); } } @@ -1234,26 +1205,67 @@ public void callByCNS(String[] params) throws Exception { HelpInfo.callByCNSHelp(); return; } - if (params.length < 4) { + if (params.length < 3) { HelpInfo.promptHelp("callByCNS"); return; } + String contractNameAndVersion = params[1]; String name = params[1]; + String contractVersion = null; + if (contractNameAndVersion.contains(":")) { + String[] nameAndVersion = contractNameAndVersion.split(":"); + if(nameAndVersion.length == 2) + { + name = nameAndVersion[0].trim(); + contractVersion = nameAndVersion[1].trim(); + } + else + { + System.out.println("Contract name and version has incorrect format. For example, contractName:contractVersion"); + System.out.println(); + return; + } + } if (name.endsWith(".sol")) { name = name.substring(0, name.length() - 4); + if(contractVersion != null) + { + if (contractVersion.length() > CnsService.MAX_VERSION_LENGTH) { + ConsoleUtils.printJson(PrecompiledCommon.transferToJson(PrecompiledCommon.VersionExceeds)); + System.out.println(); + return; + } + if (!contractVersion.matches("^[A-Za-z0-9.]+$")) { + System.out.println("Contract version should only contains 'A-Z' or 'a-z' or '0-9' or dot mark."); + System.out.println(); + return; + } + contractNameAndVersion = name + ":" + contractVersion; + } + else + { + contractNameAndVersion = name; + } } - contractName = ConsoleUtils.PACKAGENAME + "." + name; + // get address from cns + String contractAddress = ""; + CnsService cnsResolver = new CnsService(web3j, credentials); try { - contractClass = getContractClass(contractName); + contractAddress = + cnsResolver.getAddressByContractNameAndVersion(contractNameAndVersion); } catch (Exception e) { System.out.println( - "There is no " - + name - + ".class" - + " in the directory of java/classes/org/fisco/bcos/temp"); + "The contract " + contractNameAndVersion + " doesn't exsit."); System.out.println(); return; } + try { + compileContract(name); + } catch (Exception e) { + System.out.println(e.getMessage()); + System.out.println(); + return; + } Method load = contractClass.getMethod( "load", @@ -1262,38 +1274,12 @@ public void callByCNS(String[] params) throws Exception { Credentials.class, BigInteger.class, BigInteger.class); - Object contractObject; - - // get address from cns - contractName = name; - contractVersion = params[2]; - if (contractVersion.length() > CnsService.MAX_VERSION_LENGTH) { - ConsoleUtils.printJson(PrecompiledCommon.transferToJson(PrecompiledCommon.VersionExceeds)); - System.out.println(); - return; - } - if (!contractVersion.matches("^[A-Za-z0-9.]+$")) { - System.out.println("Contract version should only contains 'A-Z' or 'a-z' or '0-9' or dot mark."); - System.out.println(); - return; - } - CnsService cnsResolver = new CnsService(web3j, credentials); - try { - contractAddress = - cnsResolver.getAddressByContractNameAndVersion(contractName + ":" + contractVersion); - } catch (Exception e) { - System.out.println( - "The contract " + contractName + " for version " + contractVersion + " doesn't exsit."); - System.out.println(); - return; - } - contractObject = load.invoke(null, contractAddress, web3j, credentials, gasPrice, gasLimit); - String funcName = params[3]; + Object contractObject = load.invoke(null, contractAddress, web3j, credentials, gasPrice, gasLimit); + String funcName = params[2]; Method[] methods = contractClass.getMethods(); - Class[] type = null; Method method = ContractClassFactory.getMethodByName(funcName, methods); if(method == null) { - System.out.println("Cannot find the method. Please checkout the method name."); + System.out.println("Cannot find the method " + funcName + ", please checkout the method name."); System.out.println(); return; } @@ -1309,14 +1295,14 @@ public void callByCNS(String[] params) throws Exception { classList[i] = clazz; } Class[] parameterType = - ContractClassFactory.getParameterType(contractClass, funcName, params.length - 4); + ContractClassFactory.getParameterType(contractClass, funcName, params.length - 3); if (parameterType == null) { - HelpInfo.promptNoFunc(params[1], funcName, params.length - 4); + HelpInfo.promptNoFunc(params[1], funcName, params.length - 3); return; } Method func = contractClass.getMethod(funcName, parameterType); - String[] newParams = new String[params.length - 4]; - System.arraycopy(params, 4, newParams, 0, params.length - 4); + String[] newParams = new String[params.length - 3]; + System.arraycopy(params, 3, newParams, 0, params.length - 3); Object[] argobj = ContractClassFactory.getPrametersObject(funcName, parameterType, newParams, generic); if (argobj == null) { return; @@ -1328,7 +1314,7 @@ public void callByCNS(String[] params) throws Exception { TransactionReceipt receipt = (TransactionReceipt)result; if(!"0x0".equals(receipt.getStatus())) { - System.out.println("Call failed."); + System.out.println(receipt.getStatus()); System.out.println(); return; } @@ -1336,13 +1322,35 @@ public void callByCNS(String[] params) throws Exception { String returnObject = ContractClassFactory.getReturnObject(contractClass, funcName, parameterType, result); if (returnObject == null) { - HelpInfo.promptNoFunc(params[1], funcName, params.length - 4); + HelpInfo.promptNoFunc(params[1], funcName, params.length - 3); return; } System.out.println(returnObject); System.out.println(); } + private void compileContract(String name) throws Exception { + try { + ConsoleUtils.dynamicCompileSolFilesToJava(name); + }catch (IOException e) { + throw new IOException(e.getMessage()); + } + try { + ConsoleUtils.dynamicCompileJavaToClass(name); + } catch (Exception e1) { + throw new Exception("Compile " + name + ".java failed."); + } + contractName = ConsoleUtils.PACKAGENAME + "." + name; + try { + contractClass = getContractClass(contractName); + } catch (Exception e) { + throw new Exception("There is no " + + name + + ".class" + + " in the directory of java/classes/org/fisco/bcos/temp"); + } + } + @SuppressWarnings("rawtypes") @Override public void queryCNS(String[] params) throws Exception { diff --git a/src/main/java/console/common/ConsoleUtils.java b/src/main/java/console/common/ConsoleUtils.java index fc0230af..8db50c4c 100644 --- a/src/main/java/console/common/ConsoleUtils.java +++ b/src/main/java/console/common/ConsoleUtils.java @@ -158,24 +158,8 @@ public static Address convertAddress(String addressStr) } }else { - if(!addressStr.matches("^[a-f0-9]+$")) - { address.setValid(false); address.setAddress(addressStr); - } - else - { - if(addressStr.length() > Address.ValidLen - 2 ) - { - address.setValid(false); - address.setAddress(addressStr); - } - else - { - getAddress(address, addressStr, Address.ValidLen - 2); - } - } - } } if(!address.isValid()) @@ -241,6 +225,10 @@ public static void dynamicCompileSolFilesToJava(String name) throws IOException if(!solFileList.exists()){ throw new IOException("Please checkout solidity/contracts/ is exist"); } + File solFile = new File("solidity/contracts/"+name); + if(!solFile.exists()){ + throw new IOException("There is no " + name + " in the directory of solidity/contracts"); + } String tempDirPath = new File("solidity/java").getAbsolutePath(); compileSolToJava(name, tempDirPath, PACKAGENAME, solFileList, "solidity/abi/", "solidity/bin/"); } diff --git a/src/main/java/console/common/ConsoleVersion.java b/src/main/java/console/common/ConsoleVersion.java index 34dd0530..ab5007ef 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 = "1.0.1"; + public static final String Version = "1.0.2"; public static void main(String[] args) { System.out.println("console version: " + Version); diff --git a/src/main/java/console/common/HelpInfo.java b/src/main/java/console/common/HelpInfo.java index 84082db7..511a31ab 100644 --- a/src/main/java/console/common/HelpInfo.java +++ b/src/main/java/console/common/HelpInfo.java @@ -300,9 +300,8 @@ public static void deployByCNSHelp() { public static void callByCNSHelp() { System.out.println("Call a contract by a function and paramters by CNS."); - System.out.println("Usage: callByCNS contractName contractVersion function parameters"); - System.out.println("contractName -- The name of a contract."); - System.out.println("contractVersion -- The version of a contract. The maximum length of the version hex string is " + CnsService.MAX_VERSION_LENGTH + "."); + System.out.println("Usage: callByCNS contractName:contractVersion function parameters"); + System.out.println("contractName:contractVersion -- The name and version of a contract. If contract version is not provided, then the latest version of contract will be called."); System.out.println("function -- The function of a contract."); System.out.println("parameters -- The parameters(splited by a space) of a function."); System.out.println(); diff --git a/src/main/resources/applicationContext.xml b/src/main/resources/applicationContext-sample.xml similarity index 100% rename from src/main/resources/applicationContext.xml rename to src/main/resources/applicationContext-sample.xml diff --git a/src/main/resources/ca.crt b/src/main/resources/ca.crt deleted file mode 100644 index fd7ea3a2..00000000 --- a/src/main/resources/ca.crt +++ /dev/null @@ -1,20 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDPTCCAiWgAwIBAgIJAMx/67YwJzUMMA0GCSqGSIb3DQEBCwUAMDUxDjAMBgNV -BAMMBWNoYWluMRMwEQYDVQQKDApmaXNjby1iY29zMQ4wDAYDVQQLDAVjaGFpbjAe -Fw0xOTAyMjMwNDAyMzFaFw0yOTAyMjAwNDAyMzFaMDUxDjAMBgNVBAMMBWNoYWlu -MRMwEQYDVQQKDApmaXNjby1iY29zMQ4wDAYDVQQLDAVjaGFpbjCCASIwDQYJKoZI -hvcNAQEBBQADggEPADCCAQoCggEBAMKvm0WeW7DAWD6haPoEYbE366rWoIeKO72j -j2bjpto7yq9PT/t4OyCLyc2oRLPiMQ2dspyCszRWMRfMchY5RfNT60yRzDpmdGIb -WgtUVw8B4MVy2GV5nXHyW6lOMRFENLzw1qOqcYrCPnwqx3dRoSnqaZ+L2sMzR0Mk -N5ApHvLl9fA/ZCh7pfaiTc5aHZVc84Z1cOMDI13pbWST2u9ZYn26efuLc0DnI1AH -iWuT1xEDp0KR3E78ggnhYmNspibRfYHYuDGc9iHiW8huae3oEZdmr1kve3l+qsYL -Vvn4/0//lC21YZAr6PA4/FmM4kP87I9XtjhrZB4tjE3tVk4ik3ECAwEAAaNQME4w -HQYDVR0OBBYEFHJPdL8m+za8flZ6wL+qNrXdhkC+MB8GA1UdIwQYMBaAFHJPdL8m -+za8flZ6wL+qNrXdhkC+MAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEB -AIDUdDXEI/DQa0nub1kDtwmK4Nv2K4GWtl2t7ojJnommUVm5V4ZDbR2aVZgYQ4+j -fxjl0+5hOI5XvkopI0XzpczPAysYb6MQUycERHDaOafvnDWiDdmIZRPIUaDMPEpd -qaLk0q+w5cIB/DWcjqt6BLgOo2A5mxj3aV12V56uTCdFyVxQtotYwrFKpRMD6e9N -NJj0fuc9M4MUH0XX/lN3/ZRfJX71uOsbYloxlzXEUdVUY1Nx8pM3sgFvLgnldNwk -/EDP1gtZrJ6NpbqSWyBlsn/wRJc107JkT+Q0ismuzJQxd04KgTVSqIpYVx8HhXpN -tvJgaFj91QmLNZpjfwVPyqo= ------END CERTIFICATE----- diff --git a/src/main/resources/contract.properties b/src/main/resources/contract.properties deleted file mode 100644 index e69de29b..00000000 diff --git a/src/main/resources/node.crt b/src/main/resources/node.crt deleted file mode 100644 index ab6d89b6..00000000 --- a/src/main/resources/node.crt +++ /dev/null @@ -1,33 +0,0 @@ ------BEGIN CERTIFICATE----- -MIICOTCCASGgAwIBAgIJAKiPm0OTwQBJMA0GCSqGSIb3DQEBCwUAMDgxEDAOBgNV -BAMMB2FnZW5jeTExEzARBgNVBAoMCmZpc2NvLWJjb3MxDzANBgNVBAsMBmFnZW5j -eTAeFw0xOTAyMjMwNDAyMzZaFw0yOTAyMjAwNDAyMzZaMDIxDDAKBgNVBAMMA3Nk -azETMBEGA1UECgwKZmlzY28tYmNvczENMAsGA1UECwwEbm9kZTBWMBAGByqGSM49 -AgEGBSuBBAAKA0IABIg2rpCx4X2uq7BG/rYBUY2LKThzjlEIFk6kbMP7CjShvE1Q -8M7KJKWWUFvLUbAMGSIdQj45aDwC/+q6KKGbqXujGjAYMAkGA1UdEwQCMAAwCwYD -VR0PBAQDAgXgMA0GCSqGSIb3DQEBCwUAA4IBAQA8YP+XUZenZzrdL99+2VIx7I5F -mgdESQHgem3v+3SMyj2Z6TbFpGO0FZjtBoPuYtM13sLCYFU+B8MMF540kUf3xfq2 -lFeg/aF9M7Nf7cOomDq49mhEh9wB38jOQW9RJo4qqWfpwNMdKMyiQPO4jZXbNQiR -bDN9cJabUgypFa0SqxqnKpZ4WkqQTPFvGAX+kM/HmG7ooVm70V2ZZiKQt4TZrSlL -Cglb8VOnFxG86K5jpVtA/p+boLmcYzB4Ub+3XHGqohKPp/AbdkNU9GXiRvXknrMk -e77IlteNXsr+qBjF5KSUkvJ8tRD6X2pZlWMC2c+NOo64CHFLS0FJQnYn6+sl ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDADCCAeigAwIBAgIJAKRumKk5VKp0MA0GCSqGSIb3DQEBCwUAMDUxDjAMBgNV -BAMMBWNoYWluMRMwEQYDVQQKDApmaXNjby1iY29zMQ4wDAYDVQQLDAVjaGFpbjAe -Fw0xOTAyMjMwNDAyMzFaFw0yOTAyMjAwNDAyMzFaMDgxEDAOBgNVBAMMB2FnZW5j -eTExEzARBgNVBAoMCmZpc2NvLWJjb3MxDzANBgNVBAsMBmFnZW5jeTCCASIwDQYJ -KoZIhvcNAQEBBQADggEPADCCAQoCggEBAMP6rNlcx7OyE6D85W7AP9na9S2S4GsC -5as/IcibkoXWb6ZfZF0hNpftpGQBSyqzKNGQQaHGJBEp2afBXuZGXXpQOj7FIu3R -VSirw7hx1c4Pyo/pO2khx1EAWembbl2kz35yvcn1qV71LkzotoUlfmFB5K9hu8Sm -sUV2bJfKNwtR5L8w6C4p4q7yeSTDDim/jXI+iDA+gdXQRP52iwoiHLu/rZQOha0z -FklgzUvGFyT9Rn4JcxkRnRkUt43l+6FDFBh99x+Vneu1vRfnMsMmA1Z6BkxNQuKG -qIXQ8L8Vitci5C+Wvrj3gHfFJ1Et1LtueNv5FzHugZmIiF9x8QsOZV8CAwEAAaMQ -MA4wDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEArnRa/bqYbcLDNXLy -PAh3C7CahPGXAOE6GCID0s9t0AYvwd/oZTBDeB3VEHPUdWWixxVxcs9s9AbwZs7x -txUWrgHPQHNVrlo4TaB7k76KoMKLniiBIz7LtmqodNxL5QjUBPTsqzvLg+OTf2qf -I+kK0jG51p72R5H7c2EmEEWAj9OTt0OZJrcF3CE+Dn12bOcNfDkRLIxhzgHLVI9J -gCxofp28LtKAH/FfiwV3tZFEbCxHZBX/Uajkmf1b9UmaqTRv4I5DlTjQbLCxmXED -fev/qkLmVwS/Nqa4XJbDITg4lIlIS1FIIkI25dBOqHxdnCVfe0TVb0kdl9p4Drla -1Nkzfg== ------END CERTIFICATE----- diff --git a/src/main/resources/node.key b/src/main/resources/node.key deleted file mode 100644 index acc41e56..00000000 --- a/src/main/resources/node.key +++ /dev/null @@ -1,5 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIGEAgEAMBAGByqGSM49AgEGBSuBBAAKBG0wawIBAQQg9pmRYB2oPMacoE8e/Xg1 -Dzk46/hokJa+r1dBZUjv2YOhRANCAASINq6QseF9rquwRv62AVGNiyk4c45RCBZO -pGzD+wo0obxNUPDOyiSlllBby1GwDBkiHUI+OWg8Av/quiihm6l7 ------END PRIVATE KEY-----