Browse Source

add the -DhostPort in the peer-startup.sh;

tags/1.1.5
zhaoguangwei 5 years ago
parent
commit
8d248027c6
1 changed files with 7 additions and 0 deletions
  1. +7
    -0
      source/consensus/consensus-bftsmart/src/main/java/com/jd/blockchain/consensus/bftsmart/service/BftsmartNodeServer.java

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

@@ -28,6 +28,7 @@ import com.jd.blockchain.utils.io.BytesUtils;
import bftsmart.reconfiguration.util.HostsConfig;
import bftsmart.reconfiguration.util.TOMConfiguration;
import bftsmart.tom.server.defaultservices.DefaultRecoverable;
import org.springframework.util.NumberUtils;

public class BftsmartNodeServer extends DefaultRecoverable implements NodeServer {

@@ -135,6 +136,12 @@ public class BftsmartNodeServer extends DefaultRecoverable implements NodeServer
// hostConfig.add(id, DEFAULT_BINDING_HOST, port);

//if ledger-init.sh set up the -DhostIp=xxx, then get it;
String preHostPort = System.getProperty("hostPort");
if(preHostPort != null && preHostPort.length()>0){
port = NumberUtils.parseNumber(preHostPort, Integer.class);
System.out.println("###ledger-init.sh###,set up the -DhostPort="+port);
}

String preHostIp = System.getProperty("hostIp");
if(preHostIp != null && preHostIp.length()>0){
hostConfig.add(id, preHostIp, port);


Loading…
Cancel
Save