diff --git a/src/main/java/org/tron/consensus/client/Client.java b/src/main/java/org/tron/consensus/client/Client.java index 8c7d82bc86e..6e0752de11f 100644 --- a/src/main/java/org/tron/consensus/client/Client.java +++ b/src/main/java/org/tron/consensus/client/Client.java @@ -21,6 +21,8 @@ import org.tron.consensus.common.GetQuery; import org.tron.consensus.common.PutCommand; +import java.net.InetAddress; +import java.net.UnknownHostException; import java.util.Arrays; import java.util.Collection; import java.util.concurrent.CompletableFuture; @@ -40,13 +42,18 @@ public class Client { client.serializer().register(PutCommand.class); client.serializer().register(GetQuery.class); - Collection
cluster = Arrays.asList( - new Address("192.168.0.108", 5000) + InetAddress localhost = null; + try { + localhost = InetAddress.getLocalHost(); + Collection cluster = Arrays.asList( + new Address(localhost.getHostAddress(), 5000) + ); - ); - - CompletableFuture