Skip to content

Commit

Permalink
Use custom overrides in DriverDSLImpl.startNodeRegistration (corda#4282)
Browse files Browse the repository at this point in the history
  • Loading branch information
florian-f authored and shamsasari committed Nov 26, 2018
1 parent 81905c6 commit b01f278
Showing 1 changed file with 14 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ class DriverDSLImpl(
}
}

override fun startNode(defaultParameters: NodeParameters,
override fun startNode(defaultParameters: NodeParameters,
providedName: CordaX500Name?,
rpcUsers: List<User>,
verifierType: VerifierType,
Expand Down Expand Up @@ -227,7 +227,7 @@ class DriverDSLImpl(

val registrationFuture = if (compatibilityZone?.rootCert != null) {
// 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 {
doneFuture(Unit)
}
Expand Down Expand Up @@ -287,21 +287,23 @@ class DriverDSLImpl(
private fun startNodeRegistration(
providedName: CordaX500Name,
rootCert: X509Certificate,
networkServicesConfig: NetworkServicesConfig
networkServicesConfig: NetworkServicesConfig,
customOverrides: Map<String, Any?> = mapOf()
): CordaFuture<NodeConfig> {
val baseDirectory = baseDirectory(providedName).createDirectories()
val overrides = configOf(
"p2pAddress" to portAllocation.nextHostAndPort().toString(),
"compatibilityZoneURL" to networkServicesConfig.doormanURL.toString(),
"myLegalName" to providedName.toString(),
"rpcSettings" to mapOf(
"address" to portAllocation.nextHostAndPort().toString(),
"adminAddress" to portAllocation.nextHostAndPort().toString()
),
"devMode" to false) + customOverrides
val config = NodeConfig(ConfigHelper.loadConfig(
baseDirectory = baseDirectory,
allowMissingConfig = true,
configOverrides = configOf(
"p2pAddress" to portAllocation.nextHostAndPort().toString(),
"compatibilityZoneURL" to networkServicesConfig.doormanURL.toString(),
"myLegalName" to providedName.toString(),
"rpcSettings" to mapOf(
"address" to portAllocation.nextHostAndPort().toString(),
"adminAddress" to portAllocation.nextHostAndPort().toString()
),
"devMode" to false)
configOverrides = overrides
)).checkAndOverrideForInMemoryDB()

val versionInfo = VersionInfo(PLATFORM_VERSION, "1", "1", "1")
Expand Down

0 comments on commit b01f278

Please sign in to comment.