mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 09:52:23 +01:00
Rename app.cli.{SeedNode => BootstrapNode}
With this commit we're now using the naming "bootstrap node" everywhere as opposed to the more fuzzy notion of "seed node" (which was originally borrowed from Bitcoin Core, but doesn't really describe what we're up to very well. As it turns out, Kademlia also uses the terminology "bootstrap node" [1], so we're in good company with this change. [1]: https://en.wikipedia.org/wiki/Kademlia#Joining_the_network
This commit is contained in:
parent
117b4ce5dc
commit
56409c0177
@ -13,13 +13,10 @@
|
||||
|
||||
# Mac OSX:
|
||||
# $HOME/Library/Application Support/Bitcoin/
|
||||
# /Users/username/Library/Application Support/Bitcoin/bitcoin.conf
|
||||
# /Users/username/Library/Application Support/Bitcoin/bitcoin.conf
|
||||
|
||||
|
||||
# Supported properties:
|
||||
# networkType=regtest | testnet | mainnet
|
||||
|
||||
# defaultSeedNode=localhost | server
|
||||
# networkType=regtest | testnet | mainnet
|
||||
|
||||
networkType=regtest
|
||||
defaultSeedNode=localhost
|
@ -37,17 +37,17 @@ public class ArgumentParser {
|
||||
|
||||
// Args for local node config
|
||||
parser.addArgument("--" + Node.NAME_KEY)
|
||||
.help("Local node ID");
|
||||
.help("Local node name");
|
||||
parser.addArgument("--" + Node.PORT_KEY)
|
||||
.help("Local port to listen on");
|
||||
.help("Local node port");
|
||||
|
||||
// Args for seed node config
|
||||
// Args for bootstrap node config
|
||||
parser.addArgument("--" + BOOTSTRAP_NODE_NAME_KEY)
|
||||
.help("Seed node ID");
|
||||
.help("Bootstrap node name");
|
||||
parser.addArgument("--" + BOOTSTRAP_NODE_IP_KEY)
|
||||
.help("Seed node IP");
|
||||
.help("Bootstrap node IP address");
|
||||
parser.addArgument("--" + BOOTSTRAP_NODE_PORT_KEY)
|
||||
.help("Seed node port");
|
||||
.help("Bootstrap node port");
|
||||
|
||||
// A custom network interface (needed at the moment for windows, but might be useful also later)
|
||||
parser.addArgument("--" + NETWORK_INTERFACE_KEY)
|
||||
|
@ -35,8 +35,8 @@ import org.slf4j.LoggerFactory;
|
||||
|
||||
import net.sourceforge.argparse4j.inf.Namespace;
|
||||
|
||||
public class SeedNode {
|
||||
private static final Logger log = LoggerFactory.getLogger(SeedNode.class);
|
||||
public class BootstrapNode {
|
||||
private static final Logger log = LoggerFactory.getLogger(BootstrapNode.class);
|
||||
|
||||
private static Peer peer = null;
|
||||
private static boolean running = true;
|
||||
@ -68,7 +68,7 @@ public class SeedNode {
|
||||
new PeerBuilderDHT(peer).start();
|
||||
new PeerBuilderNAT(peer).start();
|
||||
|
||||
log.debug("SeedNode started.");
|
||||
log.debug("started");
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
@ -104,7 +104,7 @@ class MainModel extends UIModel {
|
||||
|
||||
void initBackend() {
|
||||
|
||||
// For testing with the serverside seednode we need the BootstrappedPeerFactory which gets started form
|
||||
// For testing with the bootstrap node we need the BootstrappedPeerFactory which gets started from
|
||||
// messageFacade.init
|
||||
|
||||
messageFacade.init(new BootstrapListener() {
|
||||
|
@ -70,7 +70,7 @@ import org.slf4j.LoggerFactory;
|
||||
|
||||
|
||||
/**
|
||||
* Creates a DHT peer and bootstrap to the network via a seed node
|
||||
* Creates a DHT peer and bootstraps to the network via a bootstrap node
|
||||
*/
|
||||
class BootstrappedPeerFactory {
|
||||
private static final Logger log = LoggerFactory.getLogger(BootstrappedPeerFactory.class);
|
||||
@ -201,7 +201,7 @@ class BootstrappedPeerFactory {
|
||||
|
||||
// 1. Attempt: Try to discover our outside visible address
|
||||
private void discover() {
|
||||
setState(BootstrapState.DIRECT_INIT, "We are starting to bootstrap to a seed node.");
|
||||
setState(BootstrapState.DIRECT_INIT, "We are starting discovery against a bootstrap node.");
|
||||
FutureDiscover futureDiscover = peer.discover().peerAddress(getBootstrapAddress()).start();
|
||||
futureDiscover.addListener(new BaseFutureListener<BaseFuture>() {
|
||||
@Override
|
||||
|
@ -1,11 +1 @@
|
||||
seed.0.id=digitalocean1.bitsquare.io
|
||||
seed.0.address=188.226.179.109
|
||||
seed.0.port=5000
|
||||
|
||||
seed.1.id=digitalocean2.bitsquare.io
|
||||
seed.1.address=128.199.251.106
|
||||
seed.1.port=5000
|
||||
|
||||
seed.2.id=localhost
|
||||
seed.2.address=127.0.0.1
|
||||
seed.2.port=5001
|
||||
# Empty for now; see ConfigLoader
|
@ -70,7 +70,7 @@ import static org.junit.Assert.*;
|
||||
* Test bootstrapping, DHT operations like put/get/add/remove and sendDirect in both LAN and WAN environment
|
||||
* Test scenarios in direct connection, auto port forwarding or relay mode.
|
||||
* <p>
|
||||
* To start a seed node code use the {@link io.bitsquare.app.cli.SeedNode} class.
|
||||
* To start a bootstrap node code use the {@link io.bitsquare.app.cli.BootstrapNode} class.
|
||||
* <p>
|
||||
* To configure your test environment edit the static fields for id, IP and port.
|
||||
* In the configure method and the connectionType you can define your test scenario.
|
||||
@ -86,11 +86,10 @@ public class TomP2PTests {
|
||||
// If you want to test in one specific connection mode define it directly, otherwise use UNKNOWN
|
||||
private static final ConnectionType FORCED_CONNECTION_TYPE = ConnectionType.NAT;
|
||||
|
||||
// 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) ? BootstrapNodes.LOCALHOST : BootstrapNodes
|
||||
.DIGITAL_OCEAN_1_DEV;
|
||||
// Typically you run the bootstrap node on localhost to test direct connection.
|
||||
// If you have a setup where you are not behind a router you can also use a WAN bootstrap node.
|
||||
private static final Node BOOTSTRAP_NODE = (FORCED_CONNECTION_TYPE == ConnectionType.DIRECT) ?
|
||||
BootstrapNodes.LOCALHOST : BootstrapNodes.DIGITAL_OCEAN_1_DEV;
|
||||
|
||||
private static final PeerAddress BOOTSTRAP_NODE_ADDRESS;
|
||||
|
||||
@ -290,11 +289,11 @@ public class TomP2PTests {
|
||||
}
|
||||
}
|
||||
|
||||
// That test should always succeed as we use the server seed node as receiver.
|
||||
// This test should always succeed as we use the bootstrap node as receiver.
|
||||
// A node can send a message to another peer which is not in the same LAN.
|
||||
@Test
|
||||
@Repeat(STRESS_TEST_COUNT)
|
||||
public void testSendDirectToSeedNode() throws Exception {
|
||||
public void testSendDirectToBootstrapNode() throws Exception {
|
||||
peer1DHT = getDHTPeer("node_1", client1Port);
|
||||
FuturePeerConnection futurePeerConnection =
|
||||
peer1DHT.peer().createPeerConnection(BOOTSTRAP_NODE_ADDRESS, 500);
|
||||
|
Loading…
Reference in New Issue
Block a user