() {
- protected String call() throws Exception {
-
- while (!isCancelled()) {
- if (inbox != null) {
- try {
- Object result = inbox.receive(FiniteDuration.create(1l, "minute"));
- if (result != null) {
- System.out.println(result.toString());
- if (handler != null) {
- Application.invokeLater(() -> handler.handle(result));
- }
- }
- } catch (Exception e) {
- //System.out.println(e.toString());
- }
- }
- }
- return null;
- }
- };
- }
-}
diff --git a/src/main/java/io/bitsquare/msg/DHTSeedService.java b/src/main/java/io/bitsquare/msg/DHTSeedService.java
deleted file mode 100644
index 7ee0b10999..0000000000
--- a/src/main/java/io/bitsquare/msg/DHTSeedService.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * This file is part of Bitsquare.
- *
- * Bitsquare is free software: you can redistribute it and/or modify it
- * under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or (at
- * your option) any later version.
- *
- * Bitsquare is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with Bitsquare. If not, see .
- */
-
-package io.bitsquare.msg;
-
-import io.bitsquare.msg.actor.DHTManager;
-import io.bitsquare.msg.actor.command.InitializePeer;
-
-import com.google.inject.Inject;
-
-import net.tomp2p.peers.Number160;
-
-import akka.actor.ActorSystem;
-
-public class DHTSeedService extends ActorService {
-
- @Inject
- public DHTSeedService(ActorSystem system) {
- super(system, "/user/" + DHTManager.SEED_NODE);
- }
-
- public void initializePeer(String id, Integer port) {
-
- // TODO hard coded seed peer config for now, should read from config properties file
- send(new InitializePeer(Number160.createHash(id), port, null, null));
- }
-}
diff --git a/src/main/java/io/bitsquare/msg/MessageModule.java b/src/main/java/io/bitsquare/msg/MessageModule.java
index d86e448d6c..8fb8b26d55 100644
--- a/src/main/java/io/bitsquare/msg/MessageModule.java
+++ b/src/main/java/io/bitsquare/msg/MessageModule.java
@@ -18,8 +18,6 @@
package io.bitsquare.msg;
import io.bitsquare.BitsquareModule;
-import io.bitsquare.app.ArgumentParser;
-import io.bitsquare.network.BootstrapNodes;
import io.bitsquare.network.Node;
import com.google.inject.Injector;
@@ -39,7 +37,6 @@ public abstract class MessageModule extends BitsquareModule {
@Override
protected final void configure() {
bind(MessageFacade.class).to(messageFacade()).asEagerSingleton();
- bind(DHTSeedService.class);
// we will probably later use disk storage instead of memory storage for TomP2P
bind(Boolean.class).annotatedWith(Names.named("useDiskStorage")).toInstance(false);
diff --git a/src/main/java/io/bitsquare/msg/actor/DHTManager.java b/src/main/java/io/bitsquare/msg/actor/DHTManager.java
deleted file mode 100644
index ad7355677d..0000000000
--- a/src/main/java/io/bitsquare/msg/actor/DHTManager.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * This file is part of Bitsquare.
- *
- * Bitsquare is free software: you can redistribute it and/or modify it
- * under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or (at
- * your option) any later version.
- *
- * Bitsquare is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with Bitsquare. If not, see .
- */
-
-package io.bitsquare.msg.actor;
-
-import io.bitsquare.msg.actor.command.InitializePeer;
-import io.bitsquare.msg.actor.event.PeerInitialized;
-
-import net.tomp2p.connection.Bindings;
-import net.tomp2p.connection.StandardProtocolFamily;
-import net.tomp2p.dht.PeerBuilderDHT;
-import net.tomp2p.dht.PeerDHT;
-import net.tomp2p.nat.PeerBuilderNAT;
-import net.tomp2p.nat.PeerNAT;
-import net.tomp2p.p2p.Peer;
-import net.tomp2p.p2p.PeerBuilder;
-import net.tomp2p.peers.PeerAddress;
-import net.tomp2p.peers.PeerMapChangeListener;
-import net.tomp2p.peers.PeerStatistic;
-
-import akka.actor.AbstractActor;
-import akka.actor.Props;
-import akka.event.Logging;
-import akka.event.LoggingAdapter;
-import akka.japi.pf.ReceiveBuilder;
-
-public class DHTManager extends AbstractActor {
-
- public static final String MY_NODE = "myNodeDhtManager";
- public static final String SEED_NODE = "seedNodeDhtManager";
-
- private final LoggingAdapter log = Logging.getLogger(context().system(), this);
-
- // TODO move into app setup
- // timeout in ms
- private final Long bootstrapTimeout = 10000L;
-
- public static Props getProps() {
- return Props.create(DHTManager.class);
- }
-
- private PeerDHT peerDHT;
- private PeerNAT peerNAT;
-
- public DHTManager() {
- receive(ReceiveBuilder
- .match(InitializePeer.class, this::doInitializePeer)
- .matchAny(o -> log.info("received unknown message")).build()
- );
- }
-
- private void doInitializePeer(InitializePeer initializePeer) {
- log.debug("Received message: {}", initializePeer);
-
- try {
- Bindings bindings = new Bindings();
- bindings.addProtocol(StandardProtocolFamily.INET);
-
- if (initializePeer.getInterfaceHint() != null) {
- bindings.addInterface(initializePeer.getInterfaceHint());
- }
-
- Peer peer = new PeerBuilder(initializePeer.getPeerId()).ports(initializePeer.getPort()).bindings(bindings)
- .start();
- peer.objectDataReply((sender, request) -> {
- log.debug("received request: ", request.toString());
- return "pong";
- });
-
- // For the moment we want not to bootstrap to other seed nodes to keep test scenarios
- // simple
- /* if (ip.getBootstrapPeers() != null && ip.getBootstrapPeers().size() > 0) {
- peer.bootstrap().bootstrapTo(ip.getBootstrapPeers()).start();
- }*/
-
- // Needed for DHT support
- peerDHT = new PeerBuilderDHT(peer).start();
- // Needed for NAT support
- peerNAT = new PeerBuilderNAT(peer).start();
-
- new PeerBuilderNAT(peer).start();
- peer.peerBean().peerMap().addPeerMapChangeListener(new PeerMapChangeListener() {
- @Override
- public void peerInserted(PeerAddress peerAddress, boolean verified) {
- log.debug("Peer inserted: peerAddress=" + peerAddress + ", " +
- "verified=" + verified);
- }
-
- @Override
- public void peerRemoved(PeerAddress peerAddress, PeerStatistic peerStatistics) {
- log.debug("Peer removed: peerAddress=" + peerAddress + ", " +
- "peerStatistics=" + peerStatistics);
- }
-
- @Override
- public void peerUpdated(PeerAddress peerAddress, PeerStatistic peerStatistics) {
- // log.debug("Peer updated: peerAddress=" + peerAddress + ",
- // peerStatistics=" + peerStatistics);
- }
- });
-
- sender().tell(new PeerInitialized(peer.peerID(), initializePeer.getPort()), self());
- } catch (Throwable t) {
- log.error(t.getMessage());
- }
- }
-
-
- @Override
- public void postStop() throws Exception {
- log.debug("postStop");
- if (peerDHT != null)
- peerDHT.shutdown();
-
- if (peerNAT != null)
- peerNAT.natUtils().shutdown();
-
- super.postStop();
- }
-}
-
diff --git a/src/main/java/io/bitsquare/msg/actor/command/InitializePeer.java b/src/main/java/io/bitsquare/msg/actor/command/InitializePeer.java
deleted file mode 100644
index 38f70ac393..0000000000
--- a/src/main/java/io/bitsquare/msg/actor/command/InitializePeer.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * This file is part of Bitsquare.
- *
- * Bitsquare is free software: you can redistribute it and/or modify it
- * under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or (at
- * your option) any later version.
- *
- * Bitsquare is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with Bitsquare. If not, see .
- */
-
-package io.bitsquare.msg.actor.command;
-
-
-import java.util.Collection;
-
-import net.tomp2p.peers.Number160;
-import net.tomp2p.peers.PeerAddress;
-
-/**
- * Command to initialize TomP2P Peer.
- */
-public class InitializePeer {
-
- private final Number160 peerId;
- private final Integer port;
- private final String interfaceHint;
-
- private final Collection bootstrapPeers;
-
- public InitializePeer(Number160 peerId, Integer port, String interfaceHint,
- Collection bootstrapPeers) {
- this.peerId = peerId;
- this.port = port;
- this.interfaceHint = interfaceHint;
- this.bootstrapPeers = bootstrapPeers;
- }
-
- public Number160 getPeerId() {
- return peerId;
- }
-
- public Integer getPort() {
- return port;
- }
-
- public String getInterfaceHint() {
- return interfaceHint;
- }
-
- public Collection getBootstrapPeers() {
- return bootstrapPeers;
- }
-}
diff --git a/src/main/java/io/bitsquare/msg/actor/event/PeerInitialized.java b/src/main/java/io/bitsquare/msg/actor/event/PeerInitialized.java
deleted file mode 100644
index 82c4dd0cd0..0000000000
--- a/src/main/java/io/bitsquare/msg/actor/event/PeerInitialized.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * This file is part of Bitsquare.
- *
- * Bitsquare is free software: you can redistribute it and/or modify it
- * under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or (at
- * your option) any later version.
- *
- * Bitsquare is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with Bitsquare. If not, see .
- */
-
-package io.bitsquare.msg.actor.event;
-
-
-import net.tomp2p.peers.Number160;
-
-/**
- * TomP2P Peer Initialized event.
- */
-public class PeerInitialized {
-
- private final Number160 peerId;
- private final Integer port;
-
- public PeerInitialized(Number160 peerId, Integer port) {
- this.peerId = peerId;
- this.port = port;
- }
-
- public Number160 getPeerId() {
- return peerId;
- }
-
- public Integer getPort() {
- return port;
- }
-}
diff --git a/src/main/java/io/bitsquare/trade/protocol/trade/taker/SellerTakesOfferProtocol.java b/src/main/java/io/bitsquare/trade/protocol/trade/taker/SellerTakesOfferProtocol.java
index 431cf2415a..0bb005a9e9 100644
--- a/src/main/java/io/bitsquare/trade/protocol/trade/taker/SellerTakesOfferProtocol.java
+++ b/src/main/java/io/bitsquare/trade/protocol/trade/taker/SellerTakesOfferProtocol.java
@@ -319,7 +319,7 @@ public class SellerTakesOfferProtocol {
log.debug("state " + state);
checkState(state.ordinal() >= State.SendSignedTakerDepositTxAsHex.ordinal());
checkArgument(tradeId.equals(message.getTradeId()));
- //TODO takerCommitDepositTx should be in task as well, but will be probably changed anyway when akka is used...
+ //TODO takerCommitDepositTx should be in task as well
Transaction tx = walletFacade.takerCommitDepositTx(message.getDepositTxAsHex());
listener.onDepositTxPublished(tx);
}
diff --git a/src/main/resources/application.conf b/src/main/resources/application.conf
deleted file mode 100644
index ce3f33cf7c..0000000000
--- a/src/main/resources/application.conf
+++ /dev/null
@@ -1,17 +0,0 @@
-akka {
-
- # Loggers to register at boot time (akka.event.Logging$DefaultLogger logs
- # to STDOUT)
- #loggers = ["akka.event.slf4j.Slf4jLogger"]
-
- # Log level used by the configured loggers (see "loggers") as soon
- # as they have been started; before that, see "stdout-loglevel"
- # Options: OFF, ERROR, WARNING, INFO, DEBUG
- loglevel = "DEBUG"
-
- # Log level for the very basic logger activated during ActorSystem startup.
- # This logger prints the log messages to stdout (System.out).
- # Options: OFF, ERROR, WARNING, INFO, DEBUG
- stdout-loglevel = "DEBUG"
-
-}
\ No newline at end of file