mirror of
https://github.com/corda/corda.git
synced 2024-12-28 00:38:55 +00:00
CORPRIV-661: Ensure that nodes loaded from a profile have the correct network map service.
This commit is contained in:
parent
963d015c4d
commit
5a13d0355d
@ -13,7 +13,8 @@ class NodeConfig(
|
||||
val webPort: Int,
|
||||
val h2Port: Int,
|
||||
val extraServices: List<String>,
|
||||
val users: List<Map<String, Any>> = listOf(defaultUser)
|
||||
val users: List<Map<String, Any>> = listOf(defaultUser),
|
||||
var networkMap: NetworkMapConfig? = null
|
||||
) : NetworkMapConfig(legalName, artemisPort) {
|
||||
|
||||
companion object {
|
||||
@ -38,8 +39,6 @@ class NodeConfig(
|
||||
override val keyStorePassword: String = "cordacadevpass"
|
||||
}
|
||||
|
||||
var networkMap: NetworkMapConfig? = null
|
||||
|
||||
var state: NodeState = NodeState.STARTING
|
||||
|
||||
val isCashIssuer: Boolean = extraServices.any {
|
||||
@ -69,7 +68,7 @@ class NodeConfig(
|
||||
fun toText(): String = toFileConfig().root().render(renderOptions)
|
||||
|
||||
fun moveTo(baseDir: Path) = NodeConfig(
|
||||
baseDir, legalName, artemisPort, nearestCity, webPort, h2Port, extraServices, users
|
||||
baseDir, legalName, artemisPort, nearestCity, webPort, h2Port, extraServices, users, networkMap
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -104,6 +104,8 @@ class ProfileController : Controller() {
|
||||
if (config.hasPath("networkMapService")) {
|
||||
val nmap = config.getConfig("networkMapService")
|
||||
nodeConfig.networkMap = NetworkMapConfig(nmap.getString("legalName"), nmap.parsePort("address"))
|
||||
} else {
|
||||
log.info("Node '${nodeConfig.legalName}' is the network map")
|
||||
}
|
||||
|
||||
return nodeConfig
|
||||
|
Loading…
Reference in New Issue
Block a user