mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-06-24 23:00:36 -04: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>
|
<artifactId>universal</artifactId>
|
||||||
<version>0.0.3-SNAPSHOT</version>
|
<version>0.0.3-SNAPSHOT</version>
|
||||||
<scope>system</scope>
|
<scope>system</scope>
|
||||||
<systemPath>${basedir}/libs/universal-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>
|
|
||||||
<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>
|
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<groupId>org.slf4j</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
|
@ -45,5 +32,35 @@
|
||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</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>
|
</dependencies>
|
||||||
</project>
|
</project>
|
|
@ -124,7 +124,7 @@ public class P2PService {
|
||||||
|
|
||||||
// routing layer
|
// routing layer
|
||||||
routing = new Routing(networkNode, seedNodeAddresses);
|
routing = new Routing(networkNode, seedNodeAddresses);
|
||||||
|
if (useLocalhost) Routing.setSimulateAuthTorNode(2 * 1000);
|
||||||
|
|
||||||
// storage layer
|
// storage layer
|
||||||
dataStorage = new ProtectedExpirableDataStorage(routing, storageDir);
|
dataStorage = new ProtectedExpirableDataStorage(routing, storageDir);
|
||||||
|
|
|
@ -3,8 +3,8 @@ package io.bitsquare.p2p.network;
|
||||||
import com.google.common.util.concurrent.*;
|
import com.google.common.util.concurrent.*;
|
||||||
import com.msopentech.thali.java.toronionproxy.JavaOnionProxyContext;
|
import com.msopentech.thali.java.toronionproxy.JavaOnionProxyContext;
|
||||||
import com.msopentech.thali.java.toronionproxy.JavaOnionProxyManager;
|
import com.msopentech.thali.java.toronionproxy.JavaOnionProxyManager;
|
||||||
|
import com.runjva.sourceforge.jsocks.protocol.Socks5Proxy;
|
||||||
import io.bitsquare.p2p.Address;
|
import io.bitsquare.p2p.Address;
|
||||||
import io.bitsquare.p2p.Message;
|
|
||||||
import io.bitsquare.p2p.Utils;
|
import io.bitsquare.p2p.Utils;
|
||||||
import io.bitsquare.p2p.network.messages.SelfTestMessage;
|
import io.bitsquare.p2p.network.messages.SelfTestMessage;
|
||||||
import io.nucleo.net.HiddenServiceDescriptor;
|
import io.nucleo.net.HiddenServiceDescriptor;
|
||||||
|
@ -16,6 +16,7 @@ import org.slf4j.LoggerFactory;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.Socket;
|
import java.net.Socket;
|
||||||
|
import java.net.UnknownHostException;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
import java.util.Timer;
|
import java.util.Timer;
|
||||||
import java.util.TimerTask;
|
import java.util.TimerTask;
|
||||||
|
@ -51,6 +52,12 @@ public class TorNetworkNode extends NetworkNode {
|
||||||
private Runnable shutDownCompleteHandler;
|
private Runnable shutDownCompleteHandler;
|
||||||
private boolean torShutDownComplete, networkNodeShutDownDoneComplete;
|
private boolean torShutDownComplete, networkNodeShutDownDoneComplete;
|
||||||
|
|
||||||
|
static {
|
||||||
|
try {
|
||||||
|
new Socks5Proxy("", 0);
|
||||||
|
} catch (UnknownHostException e) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// /////////////////////////////////////////////////////////////////////////////////////////
|
// /////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Constructor
|
// Constructor
|
||||||
|
@ -121,16 +128,13 @@ public class TorNetworkNode extends NetworkNode {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
addMessageListener(new MessageListener() {
|
addMessageListener((message, connection) -> {
|
||||||
@Override
|
if (message instanceof SelfTestMessage) {
|
||||||
public void onMessage(Message message, Connection connection) {
|
if (((SelfTestMessage) message).nonce == nonce) {
|
||||||
if (message instanceof SelfTestMessage) {
|
runSelfTest();
|
||||||
if (((SelfTestMessage) message).nonce == nonce) {
|
} else {
|
||||||
runSelfTest();
|
log.error("Nonce not matching our challenge. That should never happen.");
|
||||||
} else {
|
selfTestFailed();
|
||||||
log.error("Nonce not matching our challenge. That should never happen.");
|
|
||||||
selfTestFailed();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -143,7 +147,8 @@ public class TorNetworkNode extends NetworkNode {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void start(@Nullable SetupListener setupListener) {
|
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 might have been shutdown before a restart, so we create a new one
|
||||||
executorService = MoreExecutors.listeningDecorator(Executors.newCachedThreadPool());
|
executorService = MoreExecutors.listeningDecorator(Executors.newCachedThreadPool());
|
||||||
|
@ -300,7 +305,7 @@ public class TorNetworkNode extends NetworkNode {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onFailure(Throwable throwable) {
|
public void onFailure(Throwable throwable) {
|
||||||
log.error("TorNode creation failed");
|
log.error("TorNode creation failed with exception: " + throwable.getMessage());
|
||||||
restartTor();
|
restartTor();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -19,7 +19,7 @@ import java.util.stream.Collectors;
|
||||||
public class Routing {
|
public class Routing {
|
||||||
private static final Logger log = LoggerFactory.getLogger(Routing.class);
|
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) {
|
public static void setSimulateAuthTorNode(int simulateAuthTorNode) {
|
||||||
Routing.simulateAuthTorNode = 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
Add a link
Reference in a new issue