contract client

This commit is contained in:
CaiHQ 2022-06-10 16:10:51 +08:00
parent 3db9180ceb
commit b251e7e603

View File

@ -262,7 +262,7 @@ public class ContractClient {
new ProcessBuilder(
"java",
"-Dfile.encoding=UTF-8",
darg,
darg, (isDebug ? "-Dlog4j.configurationFile=./log4j2.cp.properties" : ""),
"-jar",
classpath,
"-port=" + startPort,
@ -317,10 +317,16 @@ public class ContractClient {
get.syncGet("", "setDBInfo", ContractManager.dbPath);
String tagA = (ps == System.out ? "[Contract_" + port + "_out] " : "");
String tagB = (ps == System.out ? "[Contract_" + port + "_err] " : "");
outputTracer.track(process, sc, tagA, ps);
errorTracer.track(process, new Scanner(process.getErrorStream()), tagB, ps);
get.syncGet("", "registerMangerPort", String.valueOf(ContractManager.cPort.getCMPort()));
if (isDebug) {
LOGGER.debug("start as Debug, track err/out");
outputTracer.track(process, sc, tagA, ps);
errorTracer.track(process, new Scanner(process.getErrorStream()), tagB, ps);
} else {
LOGGER.debug("start, do not track err/out");
sc.close();
}
get.syncGet("", "registerMangerPort", String.valueOf(ContractManager.cPort.getCMPort()));
if (isBundlePath(contractMeta.contract.getScriptStr())) {
status =
get.syncGet(