Added autoreplication

This commit is contained in:
ChronosX88 2019-04-12 15:22:33 +04:00
parent 8d1f531160
commit 10872a53c9

View File

@ -8,6 +8,7 @@ import net.tomp2p.p2p.PeerBuilder;
import net.tomp2p.peers.Number160; import net.tomp2p.peers.Number160;
import net.tomp2p.relay.RelayType; import net.tomp2p.relay.RelayType;
import net.tomp2p.relay.tcp.TCPRelayServerConfig; import net.tomp2p.relay.tcp.TCPRelayServerConfig;
import net.tomp2p.replication.AutoReplication;
import net.tomp2p.storage.StorageDisk; import net.tomp2p.storage.StorageDisk;
import java.io.*; import java.io.*;
@ -58,6 +59,7 @@ public class Main {
new PeerBuilderNAT(peerDHT.peer()) new PeerBuilderNAT(peerDHT.peer())
.addRelayServerConfiguration(RelayType.OPENTCP, new TCPRelayServerConfig()) .addRelayServerConfiguration(RelayType.OPENTCP, new TCPRelayServerConfig())
.start(); .start();
new AutoReplication(peerDHT.peer()).start();
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }