mirror of
https://github.com/corda/corda.git
synced 2025-05-04 09:43:05 +00:00
Merge commit 'a5f43110f01c1bb116bb13274f1046204ee76e5f' into christians/merge-CORDA-1710
This commit is contained in:
commit
13d7892ded
@ -1,8 +1,8 @@
|
|||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$(".codeset").each(function(index, el) {
|
$(".codeset").each(function(index, el) {
|
||||||
var c = $("<div class='codesnippet-widgets'><span class='current'>Kotlin</span><span>Java</span></div>");
|
var c = $("<div class='codesnippet-widgets'><span class='current'>Java</span><span>Kotlin</span></div>");
|
||||||
var kotlinButton = c.children()[0];
|
var javaButton = c.children()[0];
|
||||||
var javaButton = c.children()[1];
|
var kotlinButton = c.children()[1];
|
||||||
kotlinButton.onclick = function() {
|
kotlinButton.onclick = function() {
|
||||||
$(el).children(".highlight-java")[0].style.display = "none";
|
$(el).children(".highlight-java")[0].style.display = "none";
|
||||||
$(el).children(".highlight-kotlin")[0].style.display = "block";
|
$(el).children(".highlight-kotlin")[0].style.display = "block";
|
||||||
@ -19,6 +19,8 @@ $(document).ready(function() {
|
|||||||
if ($(el).children(".highlight-java").length == 0) {
|
if ($(el).children(".highlight-java").length == 0) {
|
||||||
// No Java for this example.
|
// No Java for this example.
|
||||||
javaButton.style.display = "none";
|
javaButton.style.display = "none";
|
||||||
|
// In this case, display Kotlin by default
|
||||||
|
$(el).children(".highlight-kotlin")[0].style.display = "block";
|
||||||
}
|
}
|
||||||
c.insertBefore(el);
|
c.insertBefore(el);
|
||||||
});
|
});
|
||||||
|
@ -129,7 +129,7 @@ a:visited {
|
|||||||
background: #263673;
|
background: #263673;
|
||||||
}
|
}
|
||||||
|
|
||||||
.codeset > .highlight-java {
|
.codeset > .highlight-kotlin {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,7 +75,7 @@ formats for accessing MBeans, and provides client libraries to work with that pr
|
|||||||
|
|
||||||
Here are a few ways to build dashboards and extract monitoring data for a node:
|
Here are a few ways to build dashboards and extract monitoring data for a node:
|
||||||
|
|
||||||
* `hawtio <https://hawt.io>`_ is a web based console that connects directly to JVM's that have been instrumented with a
|
* `hawtio <http://hawt.io>`_ is a web based console that connects directly to JVM's that have been instrumented with a
|
||||||
jolokia agent. This tool provides a nice JMX dashboard very similar to the traditional JVisualVM / JConsole MBbeans original.
|
jolokia agent. This tool provides a nice JMX dashboard very similar to the traditional JVisualVM / JConsole MBbeans original.
|
||||||
* `JMX2Graphite <https://github.com/logzio/jmx2graphite>`_ is a tool that can be pointed to /monitoring/json and will
|
* `JMX2Graphite <https://github.com/logzio/jmx2graphite>`_ is a tool that can be pointed to /monitoring/json and will
|
||||||
scrape the statistics found there, then insert them into the Graphite monitoring tool on a regular basis. It runs
|
scrape the statistics found there, then insert them into the Graphite monitoring tool on a regular basis. It runs
|
||||||
|
@ -143,7 +143,7 @@ open class NodeStartup(val args: Array<String>) {
|
|||||||
preNetworkRegistration(conf)
|
preNetworkRegistration(conf)
|
||||||
if (cmdlineOptions.nodeRegistrationOption != null) {
|
if (cmdlineOptions.nodeRegistrationOption != null) {
|
||||||
// Null checks for [compatibilityZoneURL], [rootTruststorePath] and [rootTruststorePassword] has been done in [CmdLineOptions.loadConfig]
|
// Null checks for [compatibilityZoneURL], [rootTruststorePath] and [rootTruststorePassword] has been done in [CmdLineOptions.loadConfig]
|
||||||
registerWithNetwork(conf, cmdlineOptions.nodeRegistrationOption)
|
registerWithNetwork(conf, versionInfo, cmdlineOptions.nodeRegistrationOption)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
logStartupInfo(versionInfo, cmdlineOptions, conf)
|
logStartupInfo(versionInfo, cmdlineOptions, conf)
|
||||||
@ -317,7 +317,7 @@ open class NodeStartup(val args: Array<String>) {
|
|||||||
logger.info("Starting as node on ${conf.p2pAddress}")
|
logger.info("Starting as node on ${conf.p2pAddress}")
|
||||||
}
|
}
|
||||||
|
|
||||||
protected open fun registerWithNetwork(conf: NodeConfiguration, nodeRegistrationConfig: NodeRegistrationOption) {
|
protected open fun registerWithNetwork(conf: NodeConfiguration, versionInfo: VersionInfo, nodeRegistrationConfig: NodeRegistrationOption) {
|
||||||
val compatibilityZoneURL = conf.networkServices?.doormanURL ?: throw RuntimeException(
|
val compatibilityZoneURL = conf.networkServices?.doormanURL ?: throw RuntimeException(
|
||||||
"compatibilityZoneURL or networkServices must be configured!")
|
"compatibilityZoneURL or networkServices must be configured!")
|
||||||
|
|
||||||
@ -327,7 +327,7 @@ open class NodeStartup(val args: Array<String>) {
|
|||||||
println("* Registering as a new participant with Corda network *")
|
println("* Registering as a new participant with Corda network *")
|
||||||
println("* *")
|
println("* *")
|
||||||
println("******************************************************************")
|
println("******************************************************************")
|
||||||
NodeRegistrationHelper(conf, HTTPNetworkRegistrationService(compatibilityZoneURL), nodeRegistrationConfig).buildKeystore()
|
NodeRegistrationHelper(conf, HTTPNetworkRegistrationService(compatibilityZoneURL, versionInfo), nodeRegistrationConfig).buildKeystore()
|
||||||
|
|
||||||
// Minimal changes to make registration tool create node identity.
|
// Minimal changes to make registration tool create node identity.
|
||||||
// TODO: Move node identity generation logic from node to registration helper.
|
// TODO: Move node identity generation logic from node to registration helper.
|
||||||
|
@ -15,6 +15,7 @@ import net.corda.core.internal.openHttpConnection
|
|||||||
import net.corda.core.internal.post
|
import net.corda.core.internal.post
|
||||||
import net.corda.core.utilities.OpaqueBytes
|
import net.corda.core.utilities.OpaqueBytes
|
||||||
import net.corda.core.utilities.seconds
|
import net.corda.core.utilities.seconds
|
||||||
|
import net.corda.node.VersionInfo
|
||||||
import net.corda.nodeapi.internal.crypto.X509CertificateFactory
|
import net.corda.nodeapi.internal.crypto.X509CertificateFactory
|
||||||
import okhttp3.CacheControl
|
import okhttp3.CacheControl
|
||||||
import okhttp3.Headers
|
import okhttp3.Headers
|
||||||
@ -28,12 +29,10 @@ import java.util.*
|
|||||||
import java.util.zip.ZipInputStream
|
import java.util.zip.ZipInputStream
|
||||||
import javax.naming.ServiceUnavailableException
|
import javax.naming.ServiceUnavailableException
|
||||||
|
|
||||||
class HTTPNetworkRegistrationService(compatibilityZoneURL: URL) : NetworkRegistrationService {
|
class HTTPNetworkRegistrationService(compatibilityZoneURL: URL, val versionInfo: VersionInfo) : NetworkRegistrationService {
|
||||||
private val registrationURL = URL("$compatibilityZoneURL/certificate")
|
private val registrationURL = URL("$compatibilityZoneURL/certificate")
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
// TODO: Propagate version information from gradle
|
|
||||||
const val CLIENT_VERSION = "1.0"
|
|
||||||
private val TRANSIENT_ERROR_STATUS_CODES = setOf(HTTP_BAD_GATEWAY, HTTP_UNAVAILABLE, HTTP_GATEWAY_TIMEOUT)
|
private val TRANSIENT_ERROR_STATUS_CODES = setOf(HTTP_BAD_GATEWAY, HTTP_UNAVAILABLE, HTTP_GATEWAY_TIMEOUT)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -63,7 +62,7 @@ class HTTPNetworkRegistrationService(compatibilityZoneURL: URL) : NetworkRegistr
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun submitRequest(request: PKCS10CertificationRequest): String {
|
override fun submitRequest(request: PKCS10CertificationRequest): String {
|
||||||
return String(registrationURL.post(OpaqueBytes(request.encoded), "Client-Version" to CLIENT_VERSION))
|
return String(registrationURL.post(OpaqueBytes(request.encoded), "Client-Version" to "${versionInfo.platformVersion}"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,6 +25,7 @@ import net.corda.core.internal.div
|
|||||||
import net.corda.core.internal.x500Name
|
import net.corda.core.internal.x500Name
|
||||||
import net.corda.core.utilities.seconds
|
import net.corda.core.utilities.seconds
|
||||||
import net.corda.node.NodeRegistrationOption
|
import net.corda.node.NodeRegistrationOption
|
||||||
|
import net.corda.node.VersionInfo
|
||||||
import net.corda.node.services.config.NodeConfiguration
|
import net.corda.node.services.config.NodeConfiguration
|
||||||
import net.corda.nodeapi.internal.DevIdentityGenerator
|
import net.corda.nodeapi.internal.DevIdentityGenerator
|
||||||
import net.corda.nodeapi.internal.crypto.CertificateAndKeyPair
|
import net.corda.nodeapi.internal.crypto.CertificateAndKeyPair
|
||||||
|
@ -33,6 +33,7 @@ import net.corda.core.utilities.contextLogger
|
|||||||
import net.corda.core.utilities.getOrThrow
|
import net.corda.core.utilities.getOrThrow
|
||||||
import net.corda.core.utilities.millis
|
import net.corda.core.utilities.millis
|
||||||
import net.corda.node.NodeRegistrationOption
|
import net.corda.node.NodeRegistrationOption
|
||||||
|
import net.corda.node.VersionInfo
|
||||||
import net.corda.node.internal.ConfigurationException
|
import net.corda.node.internal.ConfigurationException
|
||||||
import net.corda.node.internal.Node
|
import net.corda.node.internal.Node
|
||||||
import net.corda.node.internal.StartedNode
|
import net.corda.node.internal.StartedNode
|
||||||
@ -265,6 +266,7 @@ class DriverDSLImpl(
|
|||||||
"devMode" to false)
|
"devMode" to false)
|
||||||
))
|
))
|
||||||
|
|
||||||
|
val versionInfo = VersionInfo(1, "1", "1", "1")
|
||||||
config.corda.certificatesDirectory.createDirectories()
|
config.corda.certificatesDirectory.createDirectories()
|
||||||
// Create network root truststore.
|
// Create network root truststore.
|
||||||
val rootTruststorePath = config.corda.certificatesDirectory / "network-root-truststore.jks"
|
val rootTruststorePath = config.corda.certificatesDirectory / "network-root-truststore.jks"
|
||||||
@ -278,7 +280,7 @@ class DriverDSLImpl(
|
|||||||
executorService.fork {
|
executorService.fork {
|
||||||
NodeRegistrationHelper(
|
NodeRegistrationHelper(
|
||||||
config.corda,
|
config.corda,
|
||||||
HTTPNetworkRegistrationService(compatibilityZoneURL),
|
HTTPNetworkRegistrationService(compatibilityZoneURL, versionInfo),
|
||||||
NodeRegistrationOption(rootTruststorePath, rootTruststorePassword)
|
NodeRegistrationOption(rootTruststorePath, rootTruststorePassword)
|
||||||
).buildKeystore()
|
).buildKeystore()
|
||||||
config
|
config
|
||||||
|
Loading…
x
Reference in New Issue
Block a user