Rename BootstrapNodes#{DEFAULT_BOOTSTRAP_NODE=>DEFAULT}

Also, reorganize and comment other Node fields exposed by
BootstrapNodes.
This commit is contained in:
Chris Beams 2014-11-10 13:43:57 +01:00
parent 56409c0177
commit 50e27014fb
No known key found for this signature in database
GPG key ID: 3D214F8F5BC5ED73
2 changed files with 19 additions and 7 deletions

View file

@ -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(

View file

@ -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<Node> all() {
return Arrays.asList(
LOCALHOST, DIGITAL_OCEAN_1
DIGITAL_OCEAN_1
);
}
}