Browse Source

modify the log;

tags/1.1.10
zhaoguangwei 5 years ago
parent
commit
147d50a16a
2 changed files with 11 additions and 8 deletions
  1. +4
    -4
      source/consensus/consensus-bftsmart/src/main/java/com/jd/blockchain/consensus/bftsmart/service/BftsmartNodeServer.java
  2. +7
    -4
      source/tools/tools-initializer/src/main/java/com/jd/blockchain/tools/initializer/LedgerInitCommand.java

+ 4
- 4
source/consensus/consensus-bftsmart/src/main/java/com/jd/blockchain/consensus/bftsmart/service/BftsmartNodeServer.java View File

@@ -145,13 +145,13 @@ public class BftsmartNodeServer extends DefaultRecoverable implements NodeServer
String preHostPort = System.getProperty("hostPort"); String preHostPort = System.getProperty("hostPort");
if(!StringUtils.isEmpty(preHostPort)){ if(!StringUtils.isEmpty(preHostPort)){
port = NumberUtils.parseNumber(preHostPort, Integer.class); port = NumberUtils.parseNumber(preHostPort, Integer.class);
ConsoleUtils.info("###peer-startup.sh###,set up the -DhostPort="+port);
LOGGER.info("###peer-startup.sh###,set up the -DhostPort="+port);
} }


String preHostIp = System.getProperty("hostIp"); String preHostIp = System.getProperty("hostIp");
if(!StringUtils.isEmpty(preHostIp)){ if(!StringUtils.isEmpty(preHostIp)){
hostConfig.add(id, preHostIp, port); hostConfig.add(id, preHostIp, port);
ConsoleUtils.info("###peer-startup.sh###,set up the -DhostIp="+preHostIp);
LOGGER.info("###peer-startup.sh###,set up the -DhostIp="+preHostIp);
} }


this.tomConfig = new TOMConfiguration(id, systemsConfig, hostConfig); this.tomConfig = new TOMConfiguration(id, systemsConfig, hostConfig);
@@ -577,12 +577,12 @@ public class BftsmartNodeServer extends DefaultRecoverable implements NodeServer
for (int i = 0; i < processes.length; i++) { for (int i = 0; i < processes.length; i++) {
int pid = processes[i]; int pid = processes[i];
if (curProcessId == pid) { if (curProcessId == pid) {
System.out.printf("outerTomConfig in current node, my viewId = %s , my process id = %s, host = %s, port = %s \r\n", id, pid, this.outerTomConfig.getHost(pid), this.outerTomConfig.getPort(pid));
LOGGER.debug("outerTomConfig in current node, my viewId = {} , my process id = {}, host = {}, port = {} \r\n", id, pid, this.outerTomConfig.getHost(pid), this.outerTomConfig.getPort(pid));
addresses[i] = new InetSocketAddress(this.outerTomConfig.getHost(pid), this.outerTomConfig.getPort(pid)); addresses[i] = new InetSocketAddress(this.outerTomConfig.getHost(pid), this.outerTomConfig.getPort(pid));
} else { } else {
addresses[i] = currView.getAddress(pid); addresses[i] = currView.getAddress(pid);
} }
System.out.printf("list tomConfig, viewId = %s, process id = %s, address = %s \r\n", id, pid, addresses[i]);
LOGGER.debug("list tomConfig, viewId = {}, process id = {}, address = {} \r\n", id, pid, addresses[i]);
} }
View returnView = new View(id, processes, f, addresses); View returnView = new View(id, processes, f, addresses);
this.outerTopology = new BftsmartTopology(returnView); this.outerTopology = new BftsmartTopology(returnView);


+ 7
- 4
source/tools/tools-initializer/src/main/java/com/jd/blockchain/tools/initializer/LedgerInitCommand.java View File

@@ -4,6 +4,8 @@ import java.io.File;


import com.jd.blockchain.utils.ConsoleUtils; import com.jd.blockchain.utils.ConsoleUtils;
import com.jd.blockchain.utils.StringUtils; import com.jd.blockchain.utils.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
@@ -30,7 +32,7 @@ import org.springframework.util.NumberUtils;


/** /**
* 账本初始化器; * 账本初始化器;
*
*
* @author huanghaiquan * @author huanghaiquan
* *
*/ */
@@ -38,6 +40,7 @@ import org.springframework.util.NumberUtils;
@EnableAutoConfiguration @EnableAutoConfiguration
@EnableConfigurationProperties @EnableConfigurationProperties
public class LedgerInitCommand { public class LedgerInitCommand {
private Logger logger = LoggerFactory.getLogger(LedgerInitCommand.class);


private static final String LEDGER_BINDING_FILE_NAME = "ledger-binding.conf"; private static final String LEDGER_BINDING_FILE_NAME = "ledger-binding.conf";


@@ -60,7 +63,7 @@ public class LedgerInitCommand {


/** /**
* 入口; * 入口;
*
*
* @param args * @param args
*/ */
public static void main(String[] args) { public static void main(String[] args) {
@@ -214,12 +217,12 @@ public class LedgerInitCommand {
if(!StringUtils.isEmpty(preHostPort)){ if(!StringUtils.isEmpty(preHostPort)){
int port = NumberUtils.parseNumber(preHostPort, Integer.class); int port = NumberUtils.parseNumber(preHostPort, Integer.class);
serverAddress.setPort(port); serverAddress.setPort(port);
ConsoleUtils.info("###ledger-init.sh###,set up the -DhostPort="+port);
logger.info("###ledger-init.sh###,set up the -DhostPort="+port);
} }
String preHostIp = System.getProperty("hostIp"); String preHostIp = System.getProperty("hostIp");
if(!StringUtils.isEmpty(preHostIp)){ if(!StringUtils.isEmpty(preHostIp)){
serverAddress.setHost(preHostIp); serverAddress.setHost(preHostIp);
ConsoleUtils.info("###ledger-init.sh###,set up the -DhostIp="+preHostIp);
logger.info("###ledger-init.sh###,set up the -DhostIp="+preHostIp);
} }


String argServerAddress = String.format("--server.address=%s", serverAddress.getHost()); String argServerAddress = String.format("--server.address=%s", serverAddress.getHost());


Loading…
Cancel
Save