mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-06-20 21:04:28 -04:00
packed into mac app
This commit is contained in:
parent
65d97819ac
commit
5a04af595b
7 changed files with 50 additions and 44 deletions
|
@ -146,10 +146,6 @@
|
||||||
<pathelement location="${path.variable.maven_repository}/com/lambdaworks/scrypt/1.3.3/scrypt-1.3.3.jar"/>
|
<pathelement location="${path.variable.maven_repository}/com/lambdaworks/scrypt/1.3.3/scrypt-1.3.3.jar"/>
|
||||||
</path>
|
</path>
|
||||||
|
|
||||||
<path id="library.maven:_com.madgag.spongycastle:core:1.50.0.0.classpath">
|
|
||||||
<pathelement location="${path.variable.maven_repository}/com/madgag/spongycastle/core/1.50.0.0/core-1.50.0.0.jar"/>
|
|
||||||
</path>
|
|
||||||
|
|
||||||
<path id="library.maven:_com.madgag:sc-light-jdk15on:1.47.0.2.classpath">
|
<path id="library.maven:_com.madgag:sc-light-jdk15on:1.47.0.2.classpath">
|
||||||
<pathelement location="${path.variable.maven_repository}/com/madgag/sc-light-jdk15on/1.47.0.2/sc-light-jdk15on-1.47.0.2.jar"/>
|
<pathelement location="${path.variable.maven_repository}/com/madgag/sc-light-jdk15on/1.47.0.2/sc-light-jdk15on-1.47.0.2.jar"/>
|
||||||
</path>
|
</path>
|
||||||
|
@ -259,7 +255,6 @@
|
||||||
<path refid="library.maven:_net.glxn:qrgen:1.3.classpath"/>
|
<path refid="library.maven:_net.glxn:qrgen:1.3.classpath"/>
|
||||||
<path refid="library.maven:_com.google.zxing:javase:2.0.classpath"/>
|
<path refid="library.maven:_com.google.zxing:javase:2.0.classpath"/>
|
||||||
<path refid="library.maven:_com.google.zxing:core:2.0.classpath"/>
|
<path refid="library.maven:_com.google.zxing:core:2.0.classpath"/>
|
||||||
<path refid="library.maven:_com.madgag.spongycastle:core:1.50.0.0.classpath"/>
|
|
||||||
<path refid="library.maven:_org.jetbrains:annotations:13.0.classpath"/>
|
<path refid="library.maven:_org.jetbrains:annotations:13.0.classpath"/>
|
||||||
</path>
|
</path>
|
||||||
|
|
||||||
|
@ -287,7 +282,6 @@
|
||||||
<path refid="library.maven:_net.glxn:qrgen:1.3.classpath"/>
|
<path refid="library.maven:_net.glxn:qrgen:1.3.classpath"/>
|
||||||
<path refid="library.maven:_com.google.zxing:javase:2.0.classpath"/>
|
<path refid="library.maven:_com.google.zxing:javase:2.0.classpath"/>
|
||||||
<path refid="library.maven:_com.google.zxing:core:2.0.classpath"/>
|
<path refid="library.maven:_com.google.zxing:core:2.0.classpath"/>
|
||||||
<path refid="library.maven:_com.madgag.spongycastle:core:1.50.0.0.classpath"/>
|
|
||||||
<path refid="library.maven:_org.jetbrains:annotations:13.0.classpath"/>
|
<path refid="library.maven:_org.jetbrains:annotations:13.0.classpath"/>
|
||||||
</path>
|
</path>
|
||||||
|
|
||||||
|
@ -318,7 +312,6 @@
|
||||||
<path refid="library.maven:_net.glxn:qrgen:1.3.classpath"/>
|
<path refid="library.maven:_net.glxn:qrgen:1.3.classpath"/>
|
||||||
<path refid="library.maven:_com.google.zxing:javase:2.0.classpath"/>
|
<path refid="library.maven:_com.google.zxing:javase:2.0.classpath"/>
|
||||||
<path refid="library.maven:_com.google.zxing:core:2.0.classpath"/>
|
<path refid="library.maven:_com.google.zxing:core:2.0.classpath"/>
|
||||||
<path refid="library.maven:_com.madgag.spongycastle:core:1.50.0.0.classpath"/>
|
|
||||||
<path refid="library.maven:_org.jetbrains:annotations:13.0.classpath"/>
|
<path refid="library.maven:_org.jetbrains:annotations:13.0.classpath"/>
|
||||||
</path>
|
</path>
|
||||||
|
|
||||||
|
@ -349,7 +342,6 @@
|
||||||
<path refid="library.maven:_net.glxn:qrgen:1.3.classpath"/>
|
<path refid="library.maven:_net.glxn:qrgen:1.3.classpath"/>
|
||||||
<path refid="library.maven:_com.google.zxing:javase:2.0.classpath"/>
|
<path refid="library.maven:_com.google.zxing:javase:2.0.classpath"/>
|
||||||
<path refid="library.maven:_com.google.zxing:core:2.0.classpath"/>
|
<path refid="library.maven:_com.google.zxing:core:2.0.classpath"/>
|
||||||
<path refid="library.maven:_com.madgag.spongycastle:core:1.50.0.0.classpath"/>
|
|
||||||
<path refid="library.maven:_org.jetbrains:annotations:13.0.classpath"/>
|
<path refid="library.maven:_org.jetbrains:annotations:13.0.classpath"/>
|
||||||
</path>
|
</path>
|
||||||
|
|
||||||
|
|
11
pom.xml
11
pom.xml
|
@ -108,11 +108,6 @@
|
||||||
<artifactId>bitcoinj</artifactId>
|
<artifactId>bitcoinj</artifactId>
|
||||||
<version>0.11.3</version>
|
<version>0.11.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>com.madgag</groupId>
|
|
||||||
<artifactId>sc-light-jdk15on</artifactId>
|
|
||||||
<version>1.47.0.2</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.tomp2p</groupId>
|
<groupId>net.tomp2p</groupId>
|
||||||
|
@ -189,12 +184,6 @@
|
||||||
<version>1.3</version>
|
<version>1.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.madgag.spongycastle</groupId>
|
|
||||||
<artifactId>core</artifactId>
|
|
||||||
<version>1.50.0.0</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.google.code.findbugs</groupId>
|
<groupId>com.google.code.findbugs</groupId>
|
||||||
<artifactId>jsr305</artifactId>
|
<artifactId>jsr305</artifactId>
|
||||||
|
|
|
@ -35,6 +35,7 @@ import org.slf4j.LoggerFactory;
|
||||||
public class BitSquare extends Application
|
public class BitSquare extends Application
|
||||||
{
|
{
|
||||||
private static final Logger log = LoggerFactory.getLogger(BitSquare.class);
|
private static final Logger log = LoggerFactory.getLogger(BitSquare.class);
|
||||||
|
|
||||||
public static String ID = "bitsquare";
|
public static String ID = "bitsquare";
|
||||||
private static Stage primaryStage;
|
private static Stage primaryStage;
|
||||||
private WalletFacade walletFacade;
|
private WalletFacade walletFacade;
|
||||||
|
@ -59,11 +60,12 @@ public class BitSquare extends Application
|
||||||
log.trace("Startup: start");
|
log.trace("Startup: start");
|
||||||
BitSquare.primaryStage = primaryStage;
|
BitSquare.primaryStage = primaryStage;
|
||||||
|
|
||||||
|
Thread.currentThread().setUncaughtExceptionHandler((thread, throwable) -> Popups.handleUncaughtExceptions(Throwables.getRootCause(throwable)));
|
||||||
|
|
||||||
// use a local data dir as default storage dir (can be overwritten in the settings)
|
// use a local data dir as default storage dir (can be overwritten in the settings)
|
||||||
// TODO save root preferences always in app dir top get preferred storage location
|
// TODO save root preferences always in app dir top get preferred storage location
|
||||||
StorageDirectory.setStorageDirectory(new File(StorageDirectory.getApplicationDirectory().getAbsolutePath() + "/data"));
|
StorageDirectory.setStorageDirectory(new File(StorageDirectory.getApplicationDirectory().getAbsolutePath() + "/data"));
|
||||||
|
|
||||||
Thread.currentThread().setUncaughtExceptionHandler((thread, throwable) -> Popups.handleUncaughtExceptions(Throwables.getRootCause(throwable)));
|
|
||||||
|
|
||||||
// currently there is not SystemTray support for java fx (planned for version 3) so we use the old AWT
|
// currently there is not SystemTray support for java fx (planned for version 3) so we use the old AWT
|
||||||
AWTSystemTray.createSystemTray(primaryStage);
|
AWTSystemTray.createSystemTray(primaryStage);
|
||||||
|
|
|
@ -3,12 +3,17 @@ package io.bitsquare;
|
||||||
import net.tomp2p.p2p.Peer;
|
import net.tomp2p.p2p.Peer;
|
||||||
import net.tomp2p.p2p.PeerMaker;
|
import net.tomp2p.p2p.PeerMaker;
|
||||||
import net.tomp2p.peers.Number160;
|
import net.tomp2p.peers.Number160;
|
||||||
|
import net.tomp2p.peers.PeerAddress;
|
||||||
|
import net.tomp2p.peers.PeerMapChangeListener;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Network node for relaying p2p msg
|
* Network node for relaying p2p msg
|
||||||
*/
|
*/
|
||||||
class RelayNode
|
class RelayNode
|
||||||
{
|
{
|
||||||
|
private static final Logger log = LoggerFactory.getLogger(RelayNode.class);
|
||||||
private static final Number160 ID = Number160.createHash(1);
|
private static final Number160 ID = Number160.createHash(1);
|
||||||
|
|
||||||
private static Peer masterPeer = null;
|
private static Peer masterPeer = null;
|
||||||
|
@ -32,6 +37,26 @@ class RelayNode
|
||||||
masterPeer = new PeerMaker(ID).setPorts(port).makeAndListen();
|
masterPeer = new PeerMaker(ID).setPorts(port).makeAndListen();
|
||||||
// masterPeer = new PeerMaker(ID).setPorts(port).setBagSize(100).makeAndListen(); // setBagSize cause sync problems...
|
// masterPeer = new PeerMaker(ID).setPorts(port).setBagSize(100).makeAndListen(); // setBagSize cause sync problems...
|
||||||
masterPeer.getBroadcastRPC().getConnectionBean().getConnectionReservation().reserve(3).awaitUninterruptibly();
|
masterPeer.getBroadcastRPC().getConnectionBean().getConnectionReservation().reserve(3).awaitUninterruptibly();
|
||||||
|
masterPeer.getConnectionHandler().getPeerBean().getPeerMap().addPeerMapChangeListener(new PeerMapChangeListener()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void peerInserted(PeerAddress peerAddress)
|
||||||
|
{
|
||||||
|
log.info("peerInserted " + peerAddress);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void peerRemoved(PeerAddress peerAddress)
|
||||||
|
{
|
||||||
|
log.info("peerRemoved " + peerAddress);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void peerUpdated(PeerAddress peerAddress)
|
||||||
|
{
|
||||||
|
log.info("peerUpdated " + peerAddress);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@ public class BitSquareWalletAppKit extends WalletAppKit
|
||||||
{
|
{
|
||||||
if (!directory.mkdir())
|
if (!directory.mkdir())
|
||||||
{
|
{
|
||||||
throw new IOException("Could not create named directory.");
|
throw new IOException("Could not create named directory " + directory.getAbsolutePath());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FileInputStream walletStream = null;
|
FileInputStream walletStream = null;
|
||||||
|
|
|
@ -41,28 +41,17 @@ public class StorageDirectory
|
||||||
|
|
||||||
public static File getApplicationDirectory()
|
public static File getApplicationDirectory()
|
||||||
{
|
{
|
||||||
File propertiesFile = new File(USER_PROPERTIES_FILE_NAME);
|
File executionRoot = new File(StorageDirectory.class.getProtectionDomain().getCodeSource().getLocation().getFile());
|
||||||
if (propertiesFile.exists())
|
log.trace("executionRoot " + executionRoot.getAbsolutePath());
|
||||||
{
|
// check if it is packed into a mac app (e.g.: "/Users/mk/Desktop/bitsquare.app/Contents/Java/bitsquare.jar")
|
||||||
return new File("");
|
if (executionRoot.getAbsolutePath().endsWith("/bitsquare.app/Contents/Java/bitsquare.jar") && System.getProperty("os.name").startsWith("Mac"))
|
||||||
}
|
return executionRoot.getParentFile().getParentFile().getParentFile().getParentFile();
|
||||||
|
else if (executionRoot.getAbsolutePath().endsWith("/target/classes"))
|
||||||
|
return executionRoot.getParentFile(); // dev e.g.: /Users/mk/Documents/_intellij/bitsquare/target/classes -> use target as root
|
||||||
|
else if (executionRoot.getAbsolutePath().endsWith("/bitsquare.jar"))
|
||||||
|
return executionRoot.getParentFile(); // dev with jar e.g.: Users/mk/Documents/_intellij/bitsquare/out/artifacts/bitsquare2/bitsquare.jar -> use target as root
|
||||||
else
|
else
|
||||||
{
|
return executionRoot;
|
||||||
// when running form a packed app the file structure is different on mac
|
|
||||||
String operatingSystemName = System.getProperty("os.name");
|
|
||||||
if (operatingSystemName != null && operatingSystemName.startsWith("Mac"))
|
|
||||||
{
|
|
||||||
if (new File("../../../../" + USER_PROPERTIES_FILE_NAME).exists())
|
|
||||||
{
|
|
||||||
return new File("../../../..");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static File getSystemApplicationDataDirectory()
|
public static File getSystemApplicationDataDirectory()
|
||||||
|
@ -82,7 +71,7 @@ public class StorageDirectory
|
||||||
{
|
{
|
||||||
boolean created = storageDirectory.mkdir();
|
boolean created = storageDirectory.mkdir();
|
||||||
if (!created)
|
if (!created)
|
||||||
log.error("Could not create the application data directory of '" + storageDirectory + "'");
|
throw new RuntimeException("Could not create the application data directory of '" + storageDirectory + "'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,14 +9,23 @@
|
||||||
</encoder>
|
</encoder>
|
||||||
</appender>
|
</appender>
|
||||||
|
|
||||||
|
<appender name="FILE" class="ch.qos.logback.core.FileAppender">
|
||||||
|
<file>bitsquare_out.log</file>
|
||||||
|
<append>false</append>
|
||||||
|
<encoder>
|
||||||
|
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg %xEx%n</pattern>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
<root level="DEBUG">
|
<root level="DEBUG">
|
||||||
<appender-ref ref="CONSOLE_APPENDER"/>
|
<appender-ref ref="CONSOLE_APPENDER"/>
|
||||||
|
<appender-ref ref="FILE"/>
|
||||||
</root>
|
</root>
|
||||||
|
|
||||||
<logger name="io.bitsquare" level="TRACE"/>
|
<logger name="io.bitsquare" level="TRACE"/>
|
||||||
|
|
||||||
<logger name="com.google.bitcoin" level="INFO"/>
|
<logger name="com.google.bitcoin" level="INFO"/>
|
||||||
<logger name="net.tomp2p" level="WARN"/>
|
<logger name="net.tomp2p" level="INFO"/>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
-->
|
-->
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue