mirror of
https://github.com/corda/corda.git
synced 2025-01-29 15:43:55 +00:00
Minor: print org name at startup instead of full X.500 name.
This commit is contained in:
parent
1e1ebf1370
commit
a5be12a81b
@ -298,6 +298,7 @@ private fun X500Name.mutateCommonName(mutator: (ASN1Encodable) -> String): X500N
|
||||
}
|
||||
|
||||
val X500Name.commonName: String get() = getRDNs(BCStyle.CN).first().first.value.toString()
|
||||
val X500Name.orgName: String? get() = getRDNs(BCStyle.O).firstOrNull()?.first?.value?.toString()
|
||||
val X500Name.location: String get() = getRDNs(BCStyle.L).first().first.value.toString()
|
||||
|
||||
class CertificateStream(val input: InputStream) {
|
||||
|
@ -6,6 +6,8 @@ import com.jcabi.manifests.Manifests
|
||||
import com.typesafe.config.ConfigException
|
||||
import joptsimple.OptionException
|
||||
import net.corda.core.*
|
||||
import net.corda.core.crypto.commonName
|
||||
import net.corda.core.crypto.orgName
|
||||
import net.corda.core.node.VersionInfo
|
||||
import net.corda.core.utilities.Emoji
|
||||
import net.corda.core.utilities.LogHelper.withLevel
|
||||
@ -146,7 +148,9 @@ fun main(args: Array<String>) {
|
||||
|
||||
node.networkMapRegistrationFuture.success {
|
||||
val elapsed = (System.currentTimeMillis() - startTime) / 10 / 100.0
|
||||
printBasicNodeInfo("Node for \"${node.info.legalIdentity.name}\" started up and registered in $elapsed sec")
|
||||
// TODO: Replace this with a standard function to get an unambiguous rendering of the X.500 name.
|
||||
val name = node.info.legalIdentity.name.orgName ?: node.info.legalIdentity.name.commonName
|
||||
printBasicNodeInfo("Node for \"$name\" started up and registered in $elapsed sec")
|
||||
|
||||
// Don't start the shell if there's no console attached.
|
||||
val runShell = !cmdlineOptions.noLocalShell && System.console() != null
|
||||
|
Loading…
x
Reference in New Issue
Block a user