Merge commit 'a5f43110f01c1bb116bb13274f1046204ee76e5f' into christians/merge-CORDA-1710

This commit is contained in:
Christian Sailer 2018-07-03 13:05:39 +01:00
commit 13d7892ded
7 changed files with 18 additions and 14 deletions

View File

@ -1,8 +1,8 @@
$(document).ready(function() {
$(".codeset").each(function(index, el) {
var c = $("<div class='codesnippet-widgets'><span class='current'>Kotlin</span><span>Java</span></div>");
var kotlinButton = c.children()[0];
var javaButton = c.children()[1];
var c = $("<div class='codesnippet-widgets'><span class='current'>Java</span><span>Kotlin</span></div>");
var javaButton = c.children()[0];
var kotlinButton = c.children()[1];
kotlinButton.onclick = function() {
$(el).children(".highlight-java")[0].style.display = "none";
$(el).children(".highlight-kotlin")[0].style.display = "block";
@ -19,6 +19,8 @@ $(document).ready(function() {
if ($(el).children(".highlight-java").length == 0) {
// No Java for this example.
javaButton.style.display = "none";
// In this case, display Kotlin by default
$(el).children(".highlight-kotlin")[0].style.display = "block";
}
c.insertBefore(el);
});

View File

@ -129,7 +129,7 @@ a:visited {
background: #263673;
}
.codeset > .highlight-java {
.codeset > .highlight-kotlin {
display: none;
}

View File

@ -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:
* `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.
* `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
@ -180,4 +180,4 @@ If the above holds, Corda components will benefit from the following:
* Guaranteed eventual processing of acknowledged client messages, provided that the backlog of persistent queues is not lost irremediably.
* A timely recovery from deletion or corruption of configuration files (e.g., ``node.conf``, ``node-info`` files, etc.), database drivers, CorDapps binaries and configuration, and certificate directories, provided backups are available to restore from.
.. warning:: Private keys used to sign transactions should be preserved with the utmost care. The recommendation is to keep at least two separate copies on a storage not connected to the Internet.
.. warning:: Private keys used to sign transactions should be preserved with the utmost care. The recommendation is to keep at least two separate copies on a storage not connected to the Internet.

View File

@ -143,7 +143,7 @@ open class NodeStartup(val args: Array<String>) {
preNetworkRegistration(conf)
if (cmdlineOptions.nodeRegistrationOption != null) {
// Null checks for [compatibilityZoneURL], [rootTruststorePath] and [rootTruststorePassword] has been done in [CmdLineOptions.loadConfig]
registerWithNetwork(conf, cmdlineOptions.nodeRegistrationOption)
registerWithNetwork(conf, versionInfo, cmdlineOptions.nodeRegistrationOption)
return true
}
logStartupInfo(versionInfo, cmdlineOptions, conf)
@ -317,7 +317,7 @@ open class NodeStartup(val args: Array<String>) {
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(
"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("* *")
println("******************************************************************")
NodeRegistrationHelper(conf, HTTPNetworkRegistrationService(compatibilityZoneURL), nodeRegistrationConfig).buildKeystore()
NodeRegistrationHelper(conf, HTTPNetworkRegistrationService(compatibilityZoneURL, versionInfo), nodeRegistrationConfig).buildKeystore()
// Minimal changes to make registration tool create node identity.
// TODO: Move node identity generation logic from node to registration helper.

View File

@ -15,6 +15,7 @@ import net.corda.core.internal.openHttpConnection
import net.corda.core.internal.post
import net.corda.core.utilities.OpaqueBytes
import net.corda.core.utilities.seconds
import net.corda.node.VersionInfo
import net.corda.nodeapi.internal.crypto.X509CertificateFactory
import okhttp3.CacheControl
import okhttp3.Headers
@ -28,12 +29,10 @@ import java.util.*
import java.util.zip.ZipInputStream
import javax.naming.ServiceUnavailableException
class HTTPNetworkRegistrationService(compatibilityZoneURL: URL) : NetworkRegistrationService {
class HTTPNetworkRegistrationService(compatibilityZoneURL: URL, val versionInfo: VersionInfo) : NetworkRegistrationService {
private val registrationURL = URL("$compatibilityZoneURL/certificate")
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)
}
@ -63,7 +62,7 @@ class HTTPNetworkRegistrationService(compatibilityZoneURL: URL) : NetworkRegistr
}
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}"))
}
}

View File

@ -25,6 +25,7 @@ import net.corda.core.internal.div
import net.corda.core.internal.x500Name
import net.corda.core.utilities.seconds
import net.corda.node.NodeRegistrationOption
import net.corda.node.VersionInfo
import net.corda.node.services.config.NodeConfiguration
import net.corda.nodeapi.internal.DevIdentityGenerator
import net.corda.nodeapi.internal.crypto.CertificateAndKeyPair

View File

@ -33,6 +33,7 @@ import net.corda.core.utilities.contextLogger
import net.corda.core.utilities.getOrThrow
import net.corda.core.utilities.millis
import net.corda.node.NodeRegistrationOption
import net.corda.node.VersionInfo
import net.corda.node.internal.ConfigurationException
import net.corda.node.internal.Node
import net.corda.node.internal.StartedNode
@ -265,6 +266,7 @@ class DriverDSLImpl(
"devMode" to false)
))
val versionInfo = VersionInfo(1, "1", "1", "1")
config.corda.certificatesDirectory.createDirectories()
// Create network root truststore.
val rootTruststorePath = config.corda.certificatesDirectory / "network-root-truststore.jks"
@ -278,7 +280,7 @@ class DriverDSLImpl(
executorService.fork {
NodeRegistrationHelper(
config.corda,
HTTPNetworkRegistrationService(compatibilityZoneURL),
HTTPNetworkRegistrationService(compatibilityZoneURL, versionInfo),
NodeRegistrationOption(rootTruststorePath, rootTruststorePassword)
).buildKeystore()
config