Remove commented code from SeedNode

This commit is contained in:
Chris Beams 2014-11-10 13:15:01 +01:00
parent 879ff57789
commit 519cfb8957
No known key found for this signature in database
GPG key ID: 3D214F8F5BC5ED73

View file

@ -98,63 +98,4 @@ public class SeedNode {
}
peer = null;
}
/*public static void main(String[] args) throws Exception {
ArgumentParser parser = new ArgumentParser();
Namespace namespace = parser.parseArgs(args);
Node defaultNode = BootstrapNodes.DIGITAL_OCEAN_1;
String id = defaultNode.getId();
int port = defaultNode.getPort();
// Passed program args will override the properties of the default bootstrapNode
// So you can use the same id but different ports (e.g. running several nodes on one server with
// different ports)
if (namespace.getString(ArgumentParser.SEED_ID_FLAG) != null)
id = namespace.getString(ArgumentParser.SEED_ID_FLAG);
if (namespace.getString(ArgumentParser.SEED_PORT_FLAG) != null)
port = Integer.valueOf(namespace.getString(ArgumentParser.SEED_PORT_FLAG));
log.info("This node use ID: [" + id + "] and port: [" + port + "]");
Peer peer = null;
try {
// Lets test with different settings
ChannelServerConfiguration csc = PeerBuilder.createDefaultChannelServerConfiguration();
csc.ports(new Ports(Node.DEFAULT_PORT, Node.DEFAULT_PORT));
csc.portsForwarding(new Ports(Node.DEFAULT_PORT, Node.DEFAULT_PORT));
csc.connectionTimeoutTCPMillis(10 * 1000);
csc.idleTCPSeconds(10);
csc.idleUDPSeconds(10);
Bindings bindings = new Bindings();
bindings.addProtocol(StandardProtocolFamily.INET);
peer = new PeerBuilder(Number160.createHash(id)).bindings(bindings)
.channelServerConfiguration(csc).ports(port).start();
peer.objectDataReply((sender, request) -> {
log.trace("received request: ", request.toString());
return "pong";
});
// Needed for DHT support
new PeerBuilderDHT(peer).start();
// Needed for NAT support
new PeerBuilderNAT(peer).start();
log.debug("SeedNode started.");
for (; ; ) {
for (PeerAddress pa : peer.peerBean().peerMap().all()) {
log.debug("peer online:" + pa);
}
Thread.sleep(2000);
}
} catch (Exception e) {
if (peer != null)
peer.shutdown().awaitUninterruptibly();
}
}*/
}