mirror of
https://github.com/corda/corda.git
synced 2025-01-29 15:43:55 +00:00
Add a config option to toggle auto IP discovery
This commit is contained in:
parent
bf9e2c6f54
commit
7804c68401
@ -134,5 +134,9 @@ path to the node's base directory.
|
||||
does not exist, a developer keystore will be used if ``devMode`` is true. The node will exit if ``devMode`` is false
|
||||
and keystore does not exist.
|
||||
|
||||
:detectPublicIp: This flag toggles the auto IP detection behaviour, it is enabled by default. On startup the node will
|
||||
attempt to discover its externally visible IP address first by looking for any public addresses on its network
|
||||
interfaces, and then by sending an IP discovery request to the network map service. Set to ``false`` to disable.
|
||||
|
||||
:certificateSigningService: Certificate Signing Server address. It is used by the certificate signing request utility to
|
||||
obtain SSL certificate. (See :doc:`permissioning` for more information.)
|
||||
|
@ -169,8 +169,11 @@ open class Node(override val configuration: FullNodeConfiguration,
|
||||
|
||||
private fun getAdvertisedAddress(): HostAndPort {
|
||||
return with(configuration) {
|
||||
val publicHost = tryDetectIfNotPublicHost(p2pAddress.host)
|
||||
val useHost = publicHost ?: p2pAddress.host
|
||||
val useHost = if (detectPublicIp) {
|
||||
tryDetectIfNotPublicHost(p2pAddress.host) ?: p2pAddress.host
|
||||
} else {
|
||||
p2pAddress.host
|
||||
}
|
||||
HostAndPort.fromParts(useHost, p2pAddress.port)
|
||||
}
|
||||
}
|
||||
|
@ -58,7 +58,8 @@ data class FullNodeConfiguration(
|
||||
val notaryClusterAddresses: List<HostAndPort>,
|
||||
override val certificateChainCheckPolicies: List<CertChainPolicyConfig>,
|
||||
override val devMode: Boolean = false,
|
||||
val useTestClock: Boolean = false
|
||||
val useTestClock: Boolean = false,
|
||||
val detectPublicIp: Boolean = true
|
||||
) : NodeConfiguration {
|
||||
/** This is not retrieved from the config file but rather from a command line argument. */
|
||||
@Suppress("DEPRECATION")
|
||||
|
Loading…
x
Reference in New Issue
Block a user