From 03023d6338ee6cec18d0ad65a8f287399b3643ac Mon Sep 17 00:00:00 2001 From: Manfred Karrer Date: Fri, 8 Mar 2019 10:58:53 -0500 Subject: [PATCH] Remove myAddress from docs and scripts as it is not used/needed anymore --- core/src/main/resources/bisq.policy | 2 -- core/src/test/resources/regtest.seednodes | 2 +- docs/autosetup-regtest-dao/bisq/seed_node | 2 +- docs/dev-setup.md | 3 +-- .../bisq/network/p2p/peers/getdata/RequestDataManager.java | 7 ------- p2p/src/test/java/bisq/network/p2p/DummySeedNode.java | 6 +++--- seednode/docker/startSeedNode.sh | 5 ----- 7 files changed, 6 insertions(+), 21 deletions(-) diff --git a/core/src/main/resources/bisq.policy b/core/src/main/resources/bisq.policy index 18e48705bb..71c75aa4cd 100644 --- a/core/src/main/resources/bisq.policy +++ b/core/src/main/resources/bisq.policy @@ -15,7 +15,6 @@ grant { permission "java.util.PropertyPermission" "torDir", "read"; permission "java.util.PropertyPermission" "maxConnections", "read"; permission "java.util.PropertyPermission" "networkId", "read"; - permission "java.util.PropertyPermission" "myAddress", "read"; permission "java.util.PropertyPermission" "banList", "read"; permission "java.util.PropertyPermission" "socks5ProxyBtcAddress", "read"; permission "java.util.PropertyPermission" "socks5ProxyHttpAddress", "read"; @@ -63,7 +62,6 @@ grant { permission "java.lang.RuntimePermission" "getenv.dumpStatistics"; permission "java.lang.RuntimePermission" "getenv.torDir"; permission "java.lang.RuntimePermission" "getenv.maxConnections"; - permission "java.lang.RuntimePermission" "getenv.myAddress"; permission "java.lang.RuntimePermission" "getenv.networkId"; permission "java.lang.RuntimePermission" "getenv.banList"; permission "java.lang.RuntimePermission" "getenv.socks5ProxyBtcAddress"; diff --git a/core/src/test/resources/regtest.seednodes b/core/src/test/resources/regtest.seednodes index fb71abcae3..58f66ba9cc 100644 --- a/core/src/test/resources/regtest.seednodes +++ b/core/src/test/resources/regtest.seednodes @@ -1,5 +1,5 @@ # For development you need to change that to your local onion addresses -# 1. Run a seed node with prog args: --bitcoinNetwork=regtest --nodePort=8002 --myAddress=rxdkppp3vicnbgqt:8002 --appName=bisq_seed_node_rxdkppp3vicnbgqt.onion_8002 +# 1. Run a seed node with prog args: --bitcoinNetwork=regtest --nodePort=8002 --appName=bisq_seed_node_rxdkppp3vicnbgqt.onion_8002 # 2. Find your local onion address in bisq_seed_node_rxdkppp3vicnbgqt.onion_8002/regtest/tor/hiddenservice/hostname # 3. Shut down the seed node # 4. Rename the directory with your local onion address diff --git a/docs/autosetup-regtest-dao/bisq/seed_node b/docs/autosetup-regtest-dao/bisq/seed_node index 2cd2dccd13..a9d88416d2 100755 --- a/docs/autosetup-regtest-dao/bisq/seed_node +++ b/docs/autosetup-regtest-dao/bisq/seed_node @@ -1,4 +1,4 @@ #!/bin/bash . ./config.sh -~/bin/bisq/bisq-seednode --baseCurrencyNetwork=BTC_REGTEST --useLocalhostForP2P=true --useDevPrivilegeKeys=true --nodePort=2002 --myAddress=localhost:2002 --appName=bisq-BTC_REGTEST_Seed_2002 --daoActivated=true --genesisBlockHeight=$genesis_height --genesisTxId=$genesis_tx --fullDaoNode=$dao --rpcUser=$rpcuser --rpcPassword=$rpcpassword --rpcPort=$rpcport --rpcBlockNotificationPort=$blocknotifyport +~/bin/bisq/bisq-seednode --baseCurrencyNetwork=BTC_REGTEST --useLocalhostForP2P=true --useDevPrivilegeKeys=true --nodePort=2002 --appName=bisq-BTC_REGTEST_Seed_2002 --daoActivated=true --genesisBlockHeight=$genesis_height --genesisTxId=$genesis_tx --fullDaoNode=$dao --rpcUser=$rpcuser --rpcPassword=$rpcpassword --rpcPort=$rpcport --rpcBlockNotificationPort=$blocknotifyport diff --git a/docs/dev-setup.md b/docs/dev-setup.md index 638b93bedf..9911c22e2b 100644 --- a/docs/dev-setup.md +++ b/docs/dev-setup.md @@ -54,7 +54,6 @@ Here is an overview: - `--baseCurrencyNetwork`: The BTC network to use. Possible values are: `BTC_REGTEST`, `BTC_TESTNET`, `BTC_MAINNET` (default) - `--useLocalhostForP2P`: Uses localhost instead of Tor for Bisq P2P network - `--nodePort`: Port number for localhost mode. For seed nodes there is a convention with the last digit is marking the network type and there is a list of hard coded seed nodes addresses (see: `DefaultSeedNodeAddresses.java`). For regtest: 2002 and 3002. For testnet 2001, 3001 and 4001 and for mainnet: 2000, 3000 and 4000. For normal nodes the port can be chosen freely. - - `--myAddress`: Needed for seed nodes only (e.g.: `localhost:3002`) - `--useDevPrivilegeKeys`: Important for dev testing to allow the developer key for arbitration registration - `--appName`: Custom application name which is used for the data directory. It is important to separate your nodes to not interfere. If not set, it uses the default `Bisq` directory. @@ -63,7 +62,7 @@ Here is an overview: For localhost/regtest mode run the `SeedNodeMain` class or `./bisq-seednode` script in the root project dir with following program arguments: - --baseCurrencyNetwork=BTC_REGTEST --useLocalhostForP2P=true --useDevPrivilegeKeys=true --nodePort=2002 --myAddress=localhost:2002 --appName=bisq-BTC_REGTEST_Seed_2002 + --baseCurrencyNetwork=BTC_REGTEST --useLocalhostForP2P=true --useDevPrivilegeKeys=true --nodePort=2002 --appName=bisq-BTC_REGTEST_Seed_2002 ### Run Bisq arbitrator instance diff --git a/p2p/src/main/java/bisq/network/p2p/peers/getdata/RequestDataManager.java b/p2p/src/main/java/bisq/network/p2p/peers/getdata/RequestDataManager.java index 644f65ca9a..cddb7f45fd 100644 --- a/p2p/src/main/java/bisq/network/p2p/peers/getdata/RequestDataManager.java +++ b/p2p/src/main/java/bisq/network/p2p/peers/getdata/RequestDataManager.java @@ -17,7 +17,6 @@ package bisq.network.p2p.peers.getdata; -import bisq.network.NetworkOptionKeys; import bisq.network.p2p.NodeAddress; import bisq.network.p2p.network.CloseConnectionReason; import bisq.network.p2p.network.Connection; @@ -34,8 +33,6 @@ import bisq.common.Timer; import bisq.common.UserThread; import bisq.common.proto.network.NetworkEnvelope; -import com.google.inject.name.Named; - import javax.inject.Inject; import javafx.beans.property.SimpleObjectProperty; @@ -128,10 +125,6 @@ public class RequestDataManager implements MessageListener, ConnectionListener, seedNodeAddresses.remove(myAddress); - // If we are a seed node we use more redundancy at startup to be sure we get all data. - // We cannot use networkNode.getNodeAddress() as nodeAddress as that is null at this point, so we use - // new NodeAddress(myAddress) for checking if we are a seed node. - // seedNodeAddresses do not contain my own address as that gets filtered out if (myAddress != null && seedNodeRepository.isSeedNode(myAddress)) { NUM_SEEDS_FOR_PRELIMINARY_REQUEST = 3; NUM_ADDITIONAL_SEEDS_FOR_UPDATE_REQUEST = 2; diff --git a/p2p/src/test/java/bisq/network/p2p/DummySeedNode.java b/p2p/src/test/java/bisq/network/p2p/DummySeedNode.java index ab9e6740f9..814aad5787 100644 --- a/p2p/src/test/java/bisq/network/p2p/DummySeedNode.java +++ b/p2p/src/test/java/bisq/network/p2p/DummySeedNode.java @@ -73,15 +73,15 @@ public class DummySeedNode { // API /////////////////////////////////////////////////////////////////////////////////////////// - // args: myAddress (incl. port) bitcoinNetworkId maxConnections useLocalhostForP2P seedNodes (separated with |) + // args: bitcoinNetworkId maxConnections useLocalhostForP2P seedNodes (separated with |) // 2. and 3. args are optional // eg. lmvdenjkyvx2ovga.onion:8001 0 20 false eo5ay2lyzrfvx2nr.onion:8002|si3uu56adkyqkldl.onion:8003 // or when using localhost: localhost:8001 2 20 true localhost:8002|localhost:8003 // BitcoinNetworkId: The id for the bitcoin network (Mainnet = 0, TestNet = 1, Regtest = 2) // localhost:3002 2 50 true // localhost:3002 2 50 localhost:4442|localhost:4443 true - // Usage: -myAddress= -networkId= -maxConnections= -useLocalhostForP2P=false -seedNodes=si3uu56adkyqkldl.onion:8002|eo5ay2lyzrfvx2nr.onion:8002 -ignore=4543y2lyzrfvx2nr.onion:8002|876572lyzrfvx2nr.onion:8002 - // Example usage: -myAddress=lmvdenjkyvx2ovga.onion:8001 -networkId=0 -maxConnections=20 -useLocalhostForP2P=false -seedNodes=si3uu56adkyqkldl.onion:8002|eo5ay2lyzrfvx2nr.onion:8002 -ignore=4543y2lyzrfvx2nr.onion:8002|876572lyzrfvx2nr.onion:8002 + // Usage: -networkId= -maxConnections= -useLocalhostForP2P=false -seedNodes=si3uu56adkyqkldl.onion:8002|eo5ay2lyzrfvx2nr.onion:8002 -ignore=4543y2lyzrfvx2nr.onion:8002|876572lyzrfvx2nr.onion:8002 + // Example usage: -networkId=0 -maxConnections=20 -useLocalhostForP2P=false -seedNodes=si3uu56adkyqkldl.onion:8002|eo5ay2lyzrfvx2nr.onion:8002 -ignore=4543y2lyzrfvx2nr.onion:8002|876572lyzrfvx2nr.onion:8002 public static final String USAGE = "Usage:\n" + "--networkId=[0|1|2] (Mainnet = 0, TestNet = 1, Regtest = 2)\n" + diff --git a/seednode/docker/startSeedNode.sh b/seednode/docker/startSeedNode.sh index fc6278c767..14ae376496 100755 --- a/seednode/docker/startSeedNode.sh +++ b/seednode/docker/startSeedNode.sh @@ -27,10 +27,5 @@ fi if [ ! -z "$USE_LOCALHOST_FOR_P2P" ]; then ARGS="$ARGS --useLocalhostForP2P=$USE_LOCALHOST_FOR_P2P" fi -if [ ! -z "$MY_ADDRESS" ]; then - ARGS="$ARGS --myAddress=${MY_ADDRESS}" -elif [ ! -z "$ONION_ADDRESS" ]; then - ARGS="$ARGS --myAddress=${ONION_ADDRESS}.onion:$NODE_PORT" -fi JAVA_OPTS='-Xms1800m -Xmx1800m' ./build/app/bin/bisq-seednode $ARGS