mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-06-06 06:10:08 -04:00
Rename BootstrapNodes#{DEFAULT_BOOTSTRAP_NODE=>DEFAULT}
Also, reorganize and comment other Node fields exposed by BootstrapNodes.
This commit is contained in:
parent
56409c0177
commit
50e27014fb
2 changed files with 19 additions and 7 deletions
|
@ -19,6 +19,7 @@ package io.bitsquare.msg.tomp2p;
|
||||||
|
|
||||||
import io.bitsquare.msg.MessageFacade;
|
import io.bitsquare.msg.MessageFacade;
|
||||||
import io.bitsquare.msg.MessageModule;
|
import io.bitsquare.msg.MessageModule;
|
||||||
|
import io.bitsquare.network.BootstrapNodes;
|
||||||
import io.bitsquare.network.Node;
|
import io.bitsquare.network.Node;
|
||||||
|
|
||||||
import com.google.inject.name.Names;
|
import com.google.inject.name.Names;
|
||||||
|
@ -26,7 +27,6 @@ import com.google.inject.name.Names;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
|
||||||
import static io.bitsquare.msg.tomp2p.BootstrappedPeerFactory.*;
|
import static io.bitsquare.msg.tomp2p.BootstrappedPeerFactory.*;
|
||||||
import static io.bitsquare.network.BootstrapNodes.DEFAULT_BOOTSTRAP_NODE;
|
|
||||||
|
|
||||||
public class TomP2PMessageModule extends MessageModule {
|
public class TomP2PMessageModule extends MessageModule {
|
||||||
|
|
||||||
|
@ -47,9 +47,9 @@ public class TomP2PMessageModule extends MessageModule {
|
||||||
|
|
||||||
bind(Node.class).annotatedWith(Names.named(BOOTSTRAP_NODE_KEY)).toInstance(
|
bind(Node.class).annotatedWith(Names.named(BOOTSTRAP_NODE_KEY)).toInstance(
|
||||||
Node.at(
|
Node.at(
|
||||||
properties.getProperty(BOOTSTRAP_NODE_NAME_KEY, DEFAULT_BOOTSTRAP_NODE.getName()),
|
properties.getProperty(BOOTSTRAP_NODE_NAME_KEY, BootstrapNodes.DEFAULT.getName()),
|
||||||
properties.getProperty(BOOTSTRAP_NODE_IP_KEY, DEFAULT_BOOTSTRAP_NODE.getIp()),
|
properties.getProperty(BOOTSTRAP_NODE_IP_KEY, BootstrapNodes.DEFAULT.getIp()),
|
||||||
properties.getProperty(BOOTSTRAP_NODE_PORT_KEY, DEFAULT_BOOTSTRAP_NODE.getPortAsString())
|
properties.getProperty(BOOTSTRAP_NODE_PORT_KEY, BootstrapNodes.DEFAULT.getPortAsString())
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
bindConstant().annotatedWith(Names.named(NETWORK_INTERFACE_KEY)).to(
|
bindConstant().annotatedWith(Names.named(NETWORK_INTERFACE_KEY)).to(
|
||||||
|
|
|
@ -25,15 +25,27 @@ import java.util.List;
|
||||||
// Lets use ports in that range 7366-7390
|
// Lets use ports in that range 7366-7390
|
||||||
// 7366 will be used as default port
|
// 7366 will be used as default port
|
||||||
public interface BootstrapNodes {
|
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 = 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 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() {
|
static List<Node> all() {
|
||||||
return Arrays.asList(
|
return Arrays.asList(
|
||||||
LOCALHOST, DIGITAL_OCEAN_1
|
DIGITAL_OCEAN_1
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue