mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-09-26 11:31:37 -04:00
Remove commented code from SeedNode
This commit is contained in:
parent
879ff57789
commit
519cfb8957
1 changed files with 0 additions and 59 deletions
|
@ -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();
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue