Rename i.b.network.{BootstrapNode=>BootstrapNodes}

This commit is contained in:
Chris Beams 2014-11-06 14:00:36 +01:00
parent 36b3b82e52
commit e201bf88ce
No known key found for this signature in database
GPG Key ID: 3D214F8F5BC5ED73
5 changed files with 12 additions and 12 deletions

View File

@ -17,7 +17,7 @@
package io.bitsquare.app;
import io.bitsquare.network.BootstrapNode;
import io.bitsquare.network.BootstrapNodes;
import io.bitsquare.network.Node;
import net.sourceforge.argparse4j.ArgumentParsers;
@ -30,7 +30,7 @@ public class ArgumentParser {
public static final String PORT_FLAG = "port";
public static final String INTERFACE_HINT_FLAG = "interface";
public static final String NAME_FLAG = "name";
public static final String PEER_ID_DEFAULT = BootstrapNode.DIGITAL_OCEAN1.getId();
public static final String PEER_ID_DEFAULT = BootstrapNodes.DIGITAL_OCEAN_1.getId();
private final net.sourceforge.argparse4j.inf.ArgumentParser parser;

View File

@ -21,7 +21,7 @@ import io.bitsquare.app.ArgumentParser;
import io.bitsquare.msg.actor.DHTManager;
import io.bitsquare.msg.actor.command.InitializePeer;
import io.bitsquare.msg.actor.event.PeerInitialized;
import io.bitsquare.network.BootstrapNode;
import io.bitsquare.network.BootstrapNodes;
import io.bitsquare.network.Node;
import java.net.UnknownHostException;
@ -56,13 +56,13 @@ public class SeedNode {
interfaceHint = namespace.getString(ArgumentParser.INTERFACE_HINT_FLAG);
int serverPort = Integer.valueOf(namespace.getString(ArgumentParser.PORT_FLAG));
String seedID = BootstrapNode.LOCALHOST.getId();
String seedID = BootstrapNodes.LOCALHOST.getId();
if (namespace.getString(ArgumentParser.PEER_ID_FLAG) != null) {
seedID = namespace.getString(ArgumentParser.PEER_ID_FLAG);
}
final Set<PeerAddress> peerAddresses = new HashSet<>();
for (Node node : BootstrapNode.all()) {
for (Node node : BootstrapNodes.all()) {
if (!node.getId().equals(seedID)) {
try {
peerAddresses.add(new PeerAddress(Number160.createHash(node.getId()), node.getIp(),

View File

@ -18,7 +18,7 @@
package io.bitsquare.msg;
import io.bitsquare.AbstractBitsquareModule;
import io.bitsquare.network.BootstrapNode;
import io.bitsquare.network.BootstrapNodes;
import io.bitsquare.network.Node;
import com.google.inject.Injector;
@ -44,7 +44,7 @@ public class DefaultMessageModule extends AbstractBitsquareModule implements Mes
bind(Node.class)
.annotatedWith(Names.named("bootstrapNode"))
.toInstance(BootstrapNode.LOCALHOST);
.toInstance(BootstrapNodes.LOCALHOST);
}
@Override

View File

@ -20,13 +20,13 @@ package io.bitsquare.network;
import java.util.Arrays;
import java.util.List;
public interface BootstrapNode {
public interface BootstrapNodes {
Node LOCALHOST = Node.at("localhost", "127.0.0.1");
Node DIGITAL_OCEAN1 = Node.at("digitalocean1.bitsquare.io", "188.226.179.109");
Node DIGITAL_OCEAN_1 = Node.at("digitalocean1.bitsquare.io", "188.226.179.109");
static List<Node> all() {
return Arrays.asList(
LOCALHOST, DIGITAL_OCEAN1
LOCALHOST, DIGITAL_OCEAN_1
);
}
}

View File

@ -17,7 +17,7 @@
package io.bitsquare.msg;
import io.bitsquare.network.BootstrapNode;
import io.bitsquare.network.BootstrapNodes;
import io.bitsquare.network.Node;
import io.bitsquare.util.Repeat;
@ -83,7 +83,7 @@ public class TomP2PTests {
// Typically you run the seed node in localhost to test direct connection.
// If you have a setup where you are not behind a router you can also use a WAN side seed node.
private static final Node BOOTSTRAP_NODE =
(FORCED_CONNECTION_TYPE == ConnectionType.DIRECT) ? BootstrapNode.LOCALHOST : BootstrapNode.DIGITAL_OCEAN1;
(FORCED_CONNECTION_TYPE == ConnectionType.DIRECT) ? BootstrapNodes.LOCALHOST : BootstrapNodes.DIGITAL_OCEAN_1;
private static final PeerAddress BOOTSTRAP_NODE_ADDRESS;