From 8d1f53116007ff56e75e379963cfeb276e30bc11 Mon Sep 17 00:00:00 2001 From: ChronosX88 Date: Fri, 15 Mar 2019 20:46:57 +0400 Subject: [PATCH] Fixed jar building and add relay node start. --- {src/main/resources/META-INF => META-INF}/MANIFEST.MF | 0 src/main/java/io/github/chronosx88/dhtBootstrap/Main.java | 6 ++++++ 2 files changed, 6 insertions(+) rename {src/main/resources/META-INF => META-INF}/MANIFEST.MF (100%) diff --git a/src/main/resources/META-INF/MANIFEST.MF b/META-INF/MANIFEST.MF similarity index 100% rename from src/main/resources/META-INF/MANIFEST.MF rename to META-INF/MANIFEST.MF diff --git a/src/main/java/io/github/chronosx88/dhtBootstrap/Main.java b/src/main/java/io/github/chronosx88/dhtBootstrap/Main.java index 212be40..e75732f 100644 --- a/src/main/java/io/github/chronosx88/dhtBootstrap/Main.java +++ b/src/main/java/io/github/chronosx88/dhtBootstrap/Main.java @@ -3,8 +3,11 @@ package io.github.chronosx88.dhtBootstrap; import net.tomp2p.connection.RSASignatureFactory; import net.tomp2p.dht.PeerBuilderDHT; import net.tomp2p.dht.PeerDHT; +import net.tomp2p.nat.PeerBuilderNAT; import net.tomp2p.p2p.PeerBuilder; import net.tomp2p.peers.Number160; +import net.tomp2p.relay.RelayType; +import net.tomp2p.relay.tcp.TCPRelayServerConfig; import net.tomp2p.storage.StorageDisk; import java.io.*; @@ -52,6 +55,9 @@ public class Main { new RSASignatureFactory() ) ).start(); + new PeerBuilderNAT(peerDHT.peer()) + .addRelayServerConfiguration(RelayType.OPENTCP, new TCPRelayServerConfig()) + .start(); } catch (IOException e) { e.printStackTrace(); }