/** * @param bootstrapAddress the address to bootstrap to. If it is <code>null</code>, the peer is 'initial' * and does not bootstrap to any other peer. * @return this instance */ public NetworkConfiguration setBootstrap(InetAddress bootstrapAddress) { return setBootstrap(bootstrapAddress, H2HConstants.H2H_PORT); }
/** * Create network configuration for 'normal' peer. The bootstrapping happens at the default port * {@link H2HConstants#H2H_PORT}. * * @param nodeID defines the location of the peer in the DHT. Should not be null * @param bootstrapAddress the address to bootstrap to. This can be address of the initial peer or any * other peer connected to the DHT. * @return the network configuration */ public static NetworkConfiguration create(String nodeID, InetAddress bootstrapAddress) { return new NetworkConfiguration().setNodeId(nodeID).setPort(AUTO_PORT).setBootstrap(bootstrapAddress, H2HConstants.H2H_PORT); }
/** * Create network configuration for 'normal' peer. The bootstrapping happens to the specified address and * port * * @param nodeID defines the location of the peer in the DHT. Should not be null * @param bootstrapAddress the address to bootstrap to. This can be address of the initial peer or any * other peer connected to the DHT. * @param bootstrapPort the port to bootstrap * @return the network configuration */ public static NetworkConfiguration create(String nodeID, InetAddress bootstrapAddress, int bootstrapPort) { return new NetworkConfiguration().setNodeId(nodeID).setPort(AUTO_PORT).setBootstrap(bootstrapAddress, bootstrapPort); }