diff --git a/src/main/java/io/bitsquare/msg/tomp2p/TomP2PMessageModule.java b/src/main/java/io/bitsquare/msg/tomp2p/TomP2PMessageModule.java index 5f6197dd9b..d1c1e7ca45 100644 --- a/src/main/java/io/bitsquare/msg/tomp2p/TomP2PMessageModule.java +++ b/src/main/java/io/bitsquare/msg/tomp2p/TomP2PMessageModule.java @@ -19,6 +19,7 @@ package io.bitsquare.msg.tomp2p; import io.bitsquare.msg.MessageFacade; import io.bitsquare.msg.MessageModule; +import io.bitsquare.network.BootstrapNodes; import io.bitsquare.network.Node; import com.google.inject.name.Names; @@ -26,7 +27,6 @@ import com.google.inject.name.Names; import java.util.Properties; import static io.bitsquare.msg.tomp2p.BootstrappedPeerFactory.*; -import static io.bitsquare.network.BootstrapNodes.DEFAULT_BOOTSTRAP_NODE; public class TomP2PMessageModule extends MessageModule { @@ -47,9 +47,9 @@ public class TomP2PMessageModule extends MessageModule { bind(Node.class).annotatedWith(Names.named(BOOTSTRAP_NODE_KEY)).toInstance( Node.at( - properties.getProperty(BOOTSTRAP_NODE_NAME_KEY, DEFAULT_BOOTSTRAP_NODE.getName()), - properties.getProperty(BOOTSTRAP_NODE_IP_KEY, DEFAULT_BOOTSTRAP_NODE.getIp()), - properties.getProperty(BOOTSTRAP_NODE_PORT_KEY, DEFAULT_BOOTSTRAP_NODE.getPortAsString()) + properties.getProperty(BOOTSTRAP_NODE_NAME_KEY, BootstrapNodes.DEFAULT.getName()), + properties.getProperty(BOOTSTRAP_NODE_IP_KEY, BootstrapNodes.DEFAULT.getIp()), + properties.getProperty(BOOTSTRAP_NODE_PORT_KEY, BootstrapNodes.DEFAULT.getPortAsString()) ) ); bindConstant().annotatedWith(Names.named(NETWORK_INTERFACE_KEY)).to( diff --git a/src/main/java/io/bitsquare/network/BootstrapNodes.java b/src/main/java/io/bitsquare/network/BootstrapNodes.java index cc12bf90d9..b15684c270 100644 --- a/src/main/java/io/bitsquare/network/BootstrapNodes.java +++ b/src/main/java/io/bitsquare/network/BootstrapNodes.java @@ -25,15 +25,27 @@ import java.util.List; // Lets use ports in that range 7366-7390 // 7366 will be used as default port public interface BootstrapNodes { - Node LOCALHOST = Node.at("localhost", "127.0.0.1"); + Node DIGITAL_OCEAN_1 = Node.at("digitalocean1.bitsquare.io", "188.226.179.109"); Node DIGITAL_OCEAN_1_DEV = Node.at("digitalocean1.bitsquare.io", "188.226.179.109", 7367); - Node DEFAULT_BOOTSTRAP_NODE = DIGITAL_OCEAN_1; + /** + * Alias to the default bootstrap node. + */ + Node DEFAULT = DIGITAL_OCEAN_1; + /** + * A locally-running {@link io.bitsquare.app.cli.BootstrapNode} instance. + * Typically used only for testing. Not included in results from {@link #all()}. + */ + Node LOCALHOST = Node.at("localhost", "127.0.0.1"); + + /** + * All known public bootstrap nodes. + */ static List all() { return Arrays.asList( - LOCALHOST, DIGITAL_OCEAN_1 + DIGITAL_OCEAN_1 ); } }