mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-24 07:07:43 +01:00
move libs to resources, add missing jars
This commit is contained in:
parent
0b7e45ca55
commit
3f42e5305a
8 changed files with 51 additions and 29 deletions
|
@ -23,20 +23,7 @@
|
|||
<artifactId>universal</artifactId>
|
||||
<version>0.0.3-SNAPSHOT</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${basedir}/libs/universal-0.0.3-SNAPSHOT.jar</systemPath>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-simple</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.msopentech.thali</groupId>
|
||||
<artifactId>java</artifactId>
|
||||
<version>0.0.3-SNAPSHOT</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${basedir}/libs/java-0.0.3-SNAPSHOT.jar</systemPath>
|
||||
<systemPath>${basedir}/src/main/resources/jars/universal-0.0.3-SNAPSHOT.jar</systemPath>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.slf4j</groupId>
|
||||
|
@ -45,5 +32,35 @@
|
|||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.msopentech.thali</groupId>
|
||||
<artifactId>java</artifactId>
|
||||
<version>0.0.3-SNAPSHOT</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${basedir}/src/main/resources/jars/java-0.0.3-SNAPSHOT.jar</systemPath>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-simple</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.github.ravn.jsocks</groupId>
|
||||
<artifactId>jsocks</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${basedir}/src/main/resources/jars/jsocks-0.0.1-SNAPSHOT.jar</systemPath>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>net.freehaven</groupId>
|
||||
<artifactId>jtorctl</artifactId>
|
||||
<version>2015-09</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${basedir}/src/main/resources/jars/jtorctl-2015-09.jar</systemPath>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
</project>
|
|
@ -124,7 +124,7 @@ public class P2PService {
|
|||
|
||||
// routing layer
|
||||
routing = new Routing(networkNode, seedNodeAddresses);
|
||||
|
||||
if (useLocalhost) Routing.setSimulateAuthTorNode(2 * 1000);
|
||||
|
||||
// storage layer
|
||||
dataStorage = new ProtectedExpirableDataStorage(routing, storageDir);
|
||||
|
|
|
@ -3,8 +3,8 @@ package io.bitsquare.p2p.network;
|
|||
import com.google.common.util.concurrent.*;
|
||||
import com.msopentech.thali.java.toronionproxy.JavaOnionProxyContext;
|
||||
import com.msopentech.thali.java.toronionproxy.JavaOnionProxyManager;
|
||||
import com.runjva.sourceforge.jsocks.protocol.Socks5Proxy;
|
||||
import io.bitsquare.p2p.Address;
|
||||
import io.bitsquare.p2p.Message;
|
||||
import io.bitsquare.p2p.Utils;
|
||||
import io.bitsquare.p2p.network.messages.SelfTestMessage;
|
||||
import io.nucleo.net.HiddenServiceDescriptor;
|
||||
|
@ -16,6 +16,7 @@ import org.slf4j.LoggerFactory;
|
|||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.Socket;
|
||||
import java.net.UnknownHostException;
|
||||
import java.util.Random;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
@ -51,6 +52,12 @@ public class TorNetworkNode extends NetworkNode {
|
|||
private Runnable shutDownCompleteHandler;
|
||||
private boolean torShutDownComplete, networkNodeShutDownDoneComplete;
|
||||
|
||||
static {
|
||||
try {
|
||||
new Socks5Proxy("", 0);
|
||||
} catch (UnknownHostException e) {
|
||||
}
|
||||
}
|
||||
|
||||
// /////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Constructor
|
||||
|
@ -121,9 +128,7 @@ public class TorNetworkNode extends NetworkNode {
|
|||
}
|
||||
};
|
||||
|
||||
addMessageListener(new MessageListener() {
|
||||
@Override
|
||||
public void onMessage(Message message, Connection connection) {
|
||||
addMessageListener((message, connection) -> {
|
||||
if (message instanceof SelfTestMessage) {
|
||||
if (((SelfTestMessage) message).nonce == nonce) {
|
||||
runSelfTest();
|
||||
|
@ -132,7 +137,6 @@ public class TorNetworkNode extends NetworkNode {
|
|||
selfTestFailed();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -143,7 +147,8 @@ public class TorNetworkNode extends NetworkNode {
|
|||
|
||||
@Override
|
||||
public void start(@Nullable SetupListener setupListener) {
|
||||
if (setupListener != null) addSetupListener(setupListener);
|
||||
if (setupListener != null)
|
||||
addSetupListener(setupListener);
|
||||
|
||||
// executorService might have been shutdown before a restart, so we create a new one
|
||||
executorService = MoreExecutors.listeningDecorator(Executors.newCachedThreadPool());
|
||||
|
@ -300,7 +305,7 @@ public class TorNetworkNode extends NetworkNode {
|
|||
}
|
||||
|
||||
public void onFailure(Throwable throwable) {
|
||||
log.error("TorNode creation failed");
|
||||
log.error("TorNode creation failed with exception: " + throwable.getMessage());
|
||||
restartTor();
|
||||
}
|
||||
});
|
||||
|
|
|
@ -19,7 +19,7 @@ import java.util.stream.Collectors;
|
|||
public class Routing {
|
||||
private static final Logger log = LoggerFactory.getLogger(Routing.class);
|
||||
|
||||
private static int simulateAuthTorNode = 2 * 1000;
|
||||
private static int simulateAuthTorNode = 0;
|
||||
|
||||
public static void setSimulateAuthTorNode(int simulateAuthTorNode) {
|
||||
Routing.simulateAuthTorNode = simulateAuthTorNode;
|
||||
|
|
BIN
network/src/main/resources/jars/jsocks-0.0.1-SNAPSHOT.jar
Normal file
BIN
network/src/main/resources/jars/jsocks-0.0.1-SNAPSHOT.jar
Normal file
Binary file not shown.
BIN
network/src/main/resources/jars/jtorctl-2015-09.jar
Normal file
BIN
network/src/main/resources/jars/jtorctl-2015-09.jar
Normal file
Binary file not shown.
Loading…
Add table
Reference in a new issue