From 815fb41e006f134428ffb6e0ec98b0f9a739e406 Mon Sep 17 00:00:00 2001 From: CaiHQ Date: Thu, 30 Jun 2022 10:58:59 +0800 Subject: [PATCH] sync --- .gitignore | 3 ++- build.gradle | 4 ++-- .../bdware/ypkdeploy/SmartContractClientExt.java | 7 +++++++ src/test/java/EntryTest.java | 5 +++++ testinput/debugconf-shanxiproxy.json | 16 ++++++++++++++++ 5 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 testinput/debugconf-shanxiproxy.json diff --git a/.gitignore b/.gitignore index 4297b46..db8dff7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ deployconfig.json .DS_Store -/build/ \ No newline at end of file +/build/ +testinput \ No newline at end of file diff --git a/build.gradle b/build.gradle index 9bf7282..907ba89 100755 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ plugins { id 'signing' } group "org.bdware.bdcontract" -version "0.5.5" +version "0.6.0" sourceCompatibility = 1.8 repositories { mavenCentral() @@ -32,7 +32,7 @@ task copyScript(type: Copy) { from "./docker/docker-compose/deployentry.json" into "./build/output/" } -task copyJar(type: Copy, dependsOn: [":ypk-deploy-tool:copyLibs",":ypk-deploy-tool:copyScript"]) { +task copyJar(type: Copy, dependsOn: [":ypk-deploy-tool:copyLibs", ":ypk-deploy-tool:copyScript"]) { from "./build/libs/$project.name-${project.version}.jar" into "./build/output" rename { String fileName -> "${project.name}.jar" } diff --git a/src/main/java/org/bdware/ypkdeploy/SmartContractClientExt.java b/src/main/java/org/bdware/ypkdeploy/SmartContractClientExt.java index 13be930..cd18ce6 100644 --- a/src/main/java/org/bdware/ypkdeploy/SmartContractClientExt.java +++ b/src/main/java/org/bdware/ypkdeploy/SmartContractClientExt.java @@ -92,6 +92,7 @@ public class SmartContractClientExt extends SmartContractClient { } this.sendMsg(new Gson().toJson(ret)); } + public void startContractAsDebug(String project, JsonElement createParam, ResultCallback rc) { String reqID = System.currentTimeMillis() + ""; Map ret = new HashMap<>(); @@ -291,6 +292,11 @@ public class SmartContractClientExt extends SmartContractClient { if (cb != null) cb.onResult(jo); } + @Action + public void onStartContractAsDebug(JsonObject obj) { + invokeCallback(obj); + } + public void listProjects(boolean isPrivate, ResultCallback resultCallback) { JsonObject request = new JsonObject(); request.addProperty("action", "listProjects"); @@ -308,6 +314,7 @@ public class SmartContractClientExt extends SmartContractClient { if (cb != null) cb.onResult(jo); } + @Action public void onKillContractProcess(JsonObject jo) { if (!jo.has("responseID")) { diff --git a/src/test/java/EntryTest.java b/src/test/java/EntryTest.java index 6cf605f..c18a398 100644 --- a/src/test/java/EntryTest.java +++ b/src/test/java/EntryTest.java @@ -27,4 +27,9 @@ public class EntryTest { public void deployBDTest() { HTTPTool.deploy("./testinput/deploy/router/GlobalRouter-023.json"); } + @Test + public void deployShanxiProxy() { + HTTPTool.deploy("./testinput/debugconf-shanxiproxy.json"); + } + } diff --git a/testinput/debugconf-shanxiproxy.json b/testinput/debugconf-shanxiproxy.json new file mode 100644 index 0000000..21e0042 --- /dev/null +++ b/testinput/debugconf-shanxiproxy.json @@ -0,0 +1,16 @@ +{ + "agentAddress": "39.104.208.223:18010", + "ypkPath": "/Users/huaqiancai/BDWare/datanet/shanxiproxy/backend/build/ShanxiProxy-1.5.5.ypk", + "publicKey": "04303718771b9323c204e607639f14469f9a94e55b0964a408ad3b3864b0493b645d7070da0d550f0c54b934275a8e88dedc3024467b0566db5c1108b1baeaae27", + "privateKey": "d675782acf011dbc01a73c7967ccff9564486f7c3a9f5d5de151caffaa18936", + "killBeforeStart": "ShanxiProxy", + "cpHost": "192.168.0.3", + "asDebug": true, + "createParam": { + "routerURI": "tcp://39.104.208.223:18041", + "repoId": "shanxi.taiyuan.xiaodian/XDMK", + "repoName": "XD煤矿", + "privateKey": "42b21cdc001943c74e78dc3af2d66f4c857ab682fcd31c802d57d98e31670d95", + "publicKey": "040548bba7741e091129400ce355c4d706d0072fa51e414b05302a9a93fbcae78fd1d2d15b9e0ab1239b14b7ab9c1178991f8597e515cd0c41faaed5d017be1be8" + } +} \ No newline at end of file