mirror of
https://github.com/corda/corda.git
synced 2024-12-28 16:58: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 webPort: Int,
|
||||||
val h2Port: Int,
|
val h2Port: Int,
|
||||||
val extraServices: List<String>,
|
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) {
|
) : NetworkMapConfig(legalName, artemisPort) {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
@ -38,8 +39,6 @@ class NodeConfig(
|
|||||||
override val keyStorePassword: String = "cordacadevpass"
|
override val keyStorePassword: String = "cordacadevpass"
|
||||||
}
|
}
|
||||||
|
|
||||||
var networkMap: NetworkMapConfig? = null
|
|
||||||
|
|
||||||
var state: NodeState = NodeState.STARTING
|
var state: NodeState = NodeState.STARTING
|
||||||
|
|
||||||
val isCashIssuer: Boolean = extraServices.any {
|
val isCashIssuer: Boolean = extraServices.any {
|
||||||
@ -69,7 +68,7 @@ class NodeConfig(
|
|||||||
fun toText(): String = toFileConfig().root().render(renderOptions)
|
fun toText(): String = toFileConfig().root().render(renderOptions)
|
||||||
|
|
||||||
fun moveTo(baseDir: Path) = NodeConfig(
|
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")) {
|
if (config.hasPath("networkMapService")) {
|
||||||
val nmap = config.getConfig("networkMapService")
|
val nmap = config.getConfig("networkMapService")
|
||||||
nodeConfig.networkMap = NetworkMapConfig(nmap.getString("legalName"), nmap.parsePort("address"))
|
nodeConfig.networkMap = NetworkMapConfig(nmap.getString("legalName"), nmap.parsePort("address"))
|
||||||
|
} else {
|
||||||
|
log.info("Node '${nodeConfig.legalName}' is the network map")
|
||||||
}
|
}
|
||||||
|
|
||||||
return nodeConfig
|
return nodeConfig
|
||||||
|
Loading…
Reference in New Issue
Block a user