}
Bindings bindings = new Bindings().addInterface("lo");
Peer[] peers = new Peer[nrOfPeers];
if (automaticFuture != null) {
Number160 peerId = new Number160(rnd);
PeerMap peerMap = new PeerMap(new PeerMapConfiguration(peerId));
peers[0] = new PeerBuilder(peerId)
.ports(port).enableMaintenance(maintenance)
.bindings(bindings).peerMap(peerMap).start().addAutomaticFuture(automaticFuture);
} else {
Number160 peerId = new Number160(rnd);
PeerMap peerMap = new PeerMap(new PeerMapConfiguration(peerId));
peers[0] = new PeerBuilder(peerId).enableMaintenance(maintenance).bindings(bindings)
.peerMap(peerMap).ports(port).start();
}
for (int i = 1; i < nrOfPeers; i++) {
if (automaticFuture != null) {
Number160 peerId = new Number160(rnd);
PeerMap peerMap = new PeerMap(new PeerMapConfiguration(peerId));
peers[i] = new PeerBuilder(peerId)
.masterPeer(peers[0])
.enableMaintenance(maintenance).enableMaintenance(maintenance).peerMap(peerMap).bindings(bindings).start().addAutomaticFuture(automaticFuture);
} else {
Number160 peerId = new Number160(rnd);
PeerMap peerMap = new PeerMap(new PeerMapConfiguration(peerId).peerNoVerification());
peers[i] = new PeerBuilder(peerId).enableMaintenance(maintenance)
.bindings(bindings).peerMap(peerMap).masterPeer(peers[0])
.start();
}
}