peers[0] = new PeerBuilderDHT(pm.start()).start();
if(automaticFuture!=null) {
peers[0].peer().addAutomaticFuture(automaticFuture);
}
if(replication) {
IndirectReplication rep = new IndirectReplication(peers[0]);
if(rsync) {
rep.rsync().blockSize(32);
}
rep.nRoot().start();
}
for (int i = 1; i < nrOfPeers; i++) {
pm = new PeerBuilder(new Number160(rnd)).enableMaintenance(maintenance)
.bindings(bindings).masterPeer(peers[0].peer());
peers[i] = new PeerBuilderDHT(pm.start()).start();
if(automaticFuture!=null) {
peers[i].peer().addAutomaticFuture(automaticFuture);
}
if(replication) {
IndirectReplication rep = new IndirectReplication(peers[i]);
if(rsync) {
rep.rsync().blockSize(32);
}
rep.nRoot().start();
}
}
System.err.println("peers created.");
return peers;
}