Use custom overrides in DriverDSLImpl.startNodeRegistration (#4282)

This commit is contained in:
Florian Friemel 2018-11-26 09:40:45 +00:00 committed by Shams Asari
parent 81905c67ea
commit b01f278eb3

View File

@ -227,7 +227,7 @@ class DriverDSLImpl(
val registrationFuture = if (compatibilityZone?.rootCert != null) { val registrationFuture = if (compatibilityZone?.rootCert != null) {
// We don't need the network map to be available to be able to register the node // We don't need the network map to be available to be able to register the node
startNodeRegistration(name, compatibilityZone.rootCert, compatibilityZone.config()) startNodeRegistration(name, compatibilityZone.rootCert, compatibilityZone.config(), customOverrides)
} else { } else {
doneFuture(Unit) doneFuture(Unit)
} }
@ -287,13 +287,11 @@ class DriverDSLImpl(
private fun startNodeRegistration( private fun startNodeRegistration(
providedName: CordaX500Name, providedName: CordaX500Name,
rootCert: X509Certificate, rootCert: X509Certificate,
networkServicesConfig: NetworkServicesConfig networkServicesConfig: NetworkServicesConfig,
customOverrides: Map<String, Any?> = mapOf()
): CordaFuture<NodeConfig> { ): CordaFuture<NodeConfig> {
val baseDirectory = baseDirectory(providedName).createDirectories() val baseDirectory = baseDirectory(providedName).createDirectories()
val config = NodeConfig(ConfigHelper.loadConfig( val overrides = configOf(
baseDirectory = baseDirectory,
allowMissingConfig = true,
configOverrides = configOf(
"p2pAddress" to portAllocation.nextHostAndPort().toString(), "p2pAddress" to portAllocation.nextHostAndPort().toString(),
"compatibilityZoneURL" to networkServicesConfig.doormanURL.toString(), "compatibilityZoneURL" to networkServicesConfig.doormanURL.toString(),
"myLegalName" to providedName.toString(), "myLegalName" to providedName.toString(),
@ -301,7 +299,11 @@ class DriverDSLImpl(
"address" to portAllocation.nextHostAndPort().toString(), "address" to portAllocation.nextHostAndPort().toString(),
"adminAddress" to portAllocation.nextHostAndPort().toString() "adminAddress" to portAllocation.nextHostAndPort().toString()
), ),
"devMode" to false) "devMode" to false) + customOverrides
val config = NodeConfig(ConfigHelper.loadConfig(
baseDirectory = baseDirectory,
allowMissingConfig = true,
configOverrides = overrides
)).checkAndOverrideForInMemoryDB() )).checkAndOverrideForInMemoryDB()
val versionInfo = VersionInfo(PLATFORM_VERSION, "1", "1", "1") val versionInfo = VersionInfo(PLATFORM_VERSION, "1", "1", "1")