Remove nearestCity from node configuration. (#721)

* Fix bug in demobench. Explorer didn't show correctly location of a node.
There was no nearestCity override in config.

* Remove nearestCity from node configuration. Now information about the location is always taken from
node's legal name. If not present - exception on node startup.

* Add X500Name.locationOrNull that soft fails when location is not in X500 name. Address PR comments.

* Remove unused imports.
This commit is contained in:
Katarzyna Streich
2017-05-31 16:07:13 +01:00
committed by GitHub
parent f210370885
commit 39fdb353ad
30 changed files with 18 additions and 71 deletions

View File

@ -154,7 +154,9 @@ abstract class AbstractNode(open val configuration: NodeConfiguration,
}
}
open fun findMyLocation(): PhysicalLocation? = CityDatabase[configuration.nearestCity]
open fun findMyLocation(): PhysicalLocation? {
return configuration.myLegalName.locationOrNull?.let { CityDatabase[it] }
}
lateinit var info: NodeInfo
lateinit var storage: TxWritableStorageService

View File

@ -21,7 +21,6 @@ interface NodeConfiguration : NodeSSLConfiguration {
val myLegalName: X500Name
val networkMapService: NetworkMapInfo?
val minimumPlatformVersion: Int
val nearestCity: String
val emailAddress: String
val exportJMXto: String
val dataSourceProperties: Properties
@ -40,7 +39,6 @@ data class FullNodeConfiguration(
ReplaceWith("baseDirectory"))
val basedir: Path,
override val myLegalName: X500Name,
override val nearestCity: String,
override val emailAddress: String,
override val keyStorePassword: String,
override val trustStorePassword: String,

View File

@ -123,7 +123,6 @@ class NetworkRegistrationHelper(val config: NodeConfiguration, val certService:
println("Certificate signing request with the following information will be submitted to the Corda certificate signing server.")
println()
println("Legal Name: ${config.myLegalName}")
println("Nearest City: ${config.nearestCity}")
println("Email: ${config.emailAddress}")
println()
println("Public Key: ${keyPair.public}")

View File

@ -1,5 +1,4 @@
myLegalName = "Vast Global MegaCorp, Ltd"
nearestCity = "London"
emailAddress = "admin@company.com"
exportJMXto = "http"
keyStorePassword = "cordacadevpass"