diff --git a/build.gradle b/build.gradle index ef179f9e3f..6a028e30d6 100644 --- a/build.gradle +++ b/build.gradle @@ -478,6 +478,6 @@ if (file('corda-docs-only-build').exists() || (System.getenv('CORDA_DOCS_ONLY_BU } wrapper { - gradleVersion = "4.8.1" + gradleVersion = "4.10" distributionType = Wrapper.DistributionType.ALL } diff --git a/client/rpc/src/main/kotlin/net/corda/client/rpc/CordaRPCClient.kt b/client/rpc/src/main/kotlin/net/corda/client/rpc/CordaRPCClient.kt index b370fd5321..b98b79bf5a 100644 --- a/client/rpc/src/main/kotlin/net/corda/client/rpc/CordaRPCClient.kt +++ b/client/rpc/src/main/kotlin/net/corda/client/rpc/CordaRPCClient.kt @@ -12,6 +12,7 @@ import net.corda.core.utilities.days import net.corda.core.utilities.minutes import net.corda.core.utilities.seconds import net.corda.nodeapi.internal.ArtemisTcpTransport.Companion.rpcConnectorTcpTransport +import net.corda.nodeapi.internal.PLATFORM_VERSION import net.corda.serialization.internal.AMQP_RPC_CLIENT_CONTEXT import java.time.Duration @@ -45,7 +46,7 @@ open class CordaRPCClientConfiguration @JvmOverloads constructor( * The default value is whatever version of Corda this RPC library was shipped as a part of. Therefore if you * use the RPC library from Corda 4, it will by default only connect to a node of version 4 or above. */ - open val minimumServerProtocolVersion: Int = 4, + open val minimumServerProtocolVersion: Int = PLATFORM_VERSION, /** * If set to true the client will track RPC call sites (default is false). If an error occurs subsequently diff --git a/core/src/main/kotlin/net/corda/core/messaging/CordaRPCOps.kt b/core/src/main/kotlin/net/corda/core/messaging/CordaRPCOps.kt index e7bc69c0e7..5716f2cb53 100644 --- a/core/src/main/kotlin/net/corda/core/messaging/CordaRPCOps.kt +++ b/core/src/main/kotlin/net/corda/core/messaging/CordaRPCOps.kt @@ -438,7 +438,7 @@ fun CordaRPCOps.pendingFlowsCount(): DataFeed> { } } }.subscribe() - if (completedFlowsCount == 0) { + if (pendingFlowsCount == 0) { updates.onCompleted() } return DataFeed(pendingFlowsCount, updates) diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 758de960ec..28861d273a 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index debd024022..f73107db58 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.8.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/node-api/src/main/kotlin/net/corda/nodeapi/internal/NodeInfoConstants.kt b/node-api/src/main/kotlin/net/corda/nodeapi/internal/NodeInfoConstants.kt index 8a75621a2b..79cb6844de 100644 --- a/node-api/src/main/kotlin/net/corda/nodeapi/internal/NodeInfoConstants.kt +++ b/node-api/src/main/kotlin/net/corda/nodeapi/internal/NodeInfoConstants.kt @@ -1,4 +1,5 @@ package net.corda.nodeapi.internal // TODO: Add to Corda node.conf to allow customisation -const val NODE_INFO_DIRECTORY = "additional-node-infos" \ No newline at end of file +const val NODE_INFO_DIRECTORY = "additional-node-infos" +const val PLATFORM_VERSION = 4 diff --git a/node/capsule/build.gradle b/node/capsule/build.gradle index 65b19d215d..bed8a224c5 100644 --- a/node/capsule/build.gradle +++ b/node/capsule/build.gradle @@ -9,7 +9,7 @@ apply plugin: 'com.jfrog.artifactory' description 'Corda Enterprise' configurations { - runtimeArtifacts.extendsFrom runtime + runtimeArtifacts.extendsFrom runtimeClasspath capsuleRuntime } @@ -31,18 +31,20 @@ ext { sourceCompatibility = 1.6 targetCompatibility = 1.6 +jar.enabled = false + task buildCordaJAR(type: FatCapsule, dependsOn: project(':node').compileJava) { - archiveName "corda-enterprise-${corda_release_version}.jar" applicationClass 'net.corda.node.Corda' + archiveName "corda-enterprise-${corda_release_version}.jar" applicationSource = files( - project(':node').configurations.runtime, - project(':node').jar, - project(':node').sourceSets.main.java.outputDir.toString() + '/CordaCaplet.class', - project(':node').sourceSets.main.java.outputDir.toString() + '/CordaCaplet$1.class', - "$rootDir/config/dev/log4j2.xml", - "$rootDir/node/build/resources/main/reference.conf" + project(':node').configurations.runtimeClasspath, + project(':node').tasks.jar, + project(':node').sourceSets.main.java.outputDir.toString() + '/CordaCaplet.class', + project(':node').sourceSets.main.java.outputDir.toString() + '/CordaCaplet$1.class', + project(':node').buildDir.toString() + '/resources/main/reference.conf', + "$rootDir/config/dev/log4j2.xml", + 'NOTICE' // Copy CDDL notice ) - from 'NOTICE' // Copy CDDL notice from configurations.capsuleRuntime.files.collect { zipTree(it) } capsuleManifest { @@ -65,12 +67,12 @@ task buildCordaJAR(type: FatCapsule, dependsOn: project(':node').compileJava) { } } -build.dependsOn buildCordaJAR +assemble.dependsOn buildCordaJAR artifacts { runtimeArtifacts buildCordaJAR publish buildCordaJAR { - classifier "" + classifier '' } } diff --git a/node/src/main/kotlin/net/corda/node/internal/Node.kt b/node/src/main/kotlin/net/corda/node/internal/Node.kt index 1beadaf839..b6a56a9b85 100644 --- a/node/src/main/kotlin/net/corda/node/internal/Node.kt +++ b/node/src/main/kotlin/net/corda/node/internal/Node.kt @@ -285,7 +285,6 @@ open class Node(configuration: NodeConfiguration, ArtemisRpcBroker.withoutSsl(configuration.p2pSslOptions, this.address, adminAddress, securityManager, MAX_RPC_MESSAGE_SIZE, jmxMonitoringHttpPort != null, rpcBrokerDirectory, shouldStartLocalShell()) } } - rpcBroker!!.closeOnStop() rpcBroker!!.addresses } } diff --git a/node/src/main/kotlin/net/corda/node/internal/NodeStartup.kt b/node/src/main/kotlin/net/corda/node/internal/NodeStartup.kt index 8157d88983..4ae3a2b7fd 100644 --- a/node/src/main/kotlin/net/corda/node/internal/NodeStartup.kt +++ b/node/src/main/kotlin/net/corda/node/internal/NodeStartup.kt @@ -27,6 +27,7 @@ import net.corda.node.utilities.registration.NodeRegistrationException import net.corda.node.utilities.registration.NodeRegistrationHelper import net.corda.node.utilities.saveToKeyStore import net.corda.node.utilities.saveToTrustStore +import net.corda.nodeapi.internal.PLATFORM_VERSION import net.corda.nodeapi.internal.addShutdownHook import net.corda.nodeapi.internal.config.UnknownConfigurationKeysException import net.corda.nodeapi.internal.persistence.CouldNotCreateDataSourceException @@ -416,7 +417,7 @@ open class NodeStartup: CordaCliWrapper("corda", "Runs a Corda Node") { protected open fun getVersionInfo(): VersionInfo { return VersionInfo( - CordaVersionProvider.platformVersion, + PLATFORM_VERSION, CordaVersionProvider.releaseVersion, CordaVersionProvider.revision, CordaVersionProvider.vendor diff --git a/node/src/main/kotlin/net/corda/node/services/messaging/P2PMessagingClient.kt b/node/src/main/kotlin/net/corda/node/services/messaging/P2PMessagingClient.kt index fb20278258..e5d03de792 100644 --- a/node/src/main/kotlin/net/corda/node/services/messaging/P2PMessagingClient.kt +++ b/node/src/main/kotlin/net/corda/node/services/messaging/P2PMessagingClient.kt @@ -319,12 +319,9 @@ class P2PMessagingClient(val config: NodeConfiguration, return } eventsSubscription = p2pConsumer!!.messages - .doOnError { error -> throw error } - .doOnNext { message -> deliver(message) } // this `run()` method is semantically meant to block until the message consumption runs, hence the latch here .doOnCompleted(latch::countDown) - .doOnError { error -> throw error } - .subscribe() + .subscribe({ message -> deliver(message) }, { error -> throw error }) p2pConsumer!! } consumer.start() diff --git a/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/DriverDSLImpl.kt b/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/DriverDSLImpl.kt index 6f4f35757f..ee698b5c50 100644 --- a/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/DriverDSLImpl.kt +++ b/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/DriverDSLImpl.kt @@ -25,6 +25,7 @@ import net.corda.node.services.Permissions import net.corda.node.services.config.* import net.corda.node.utilities.registration.HTTPNetworkRegistrationService import net.corda.node.utilities.registration.NodeRegistrationHelper +import net.corda.nodeapi.internal.PLATFORM_VERSION import net.corda.nodeapi.internal.DevIdentityGenerator import net.corda.nodeapi.internal.SignedNodeInfo import net.corda.nodeapi.internal.addShutdownHook @@ -296,7 +297,7 @@ class DriverDSLImpl( "devMode" to false) )).checkAndOverrideForInMemoryDB() - val versionInfo = VersionInfo(1, "1", "1", "1") + val versionInfo = VersionInfo(PLATFORM_VERSION, "1", "1", "1") config.corda.certificatesDirectory.createDirectories() // Create network root truststore. val rootTruststorePath = config.corda.certificatesDirectory / "network-root-truststore.jks" @@ -920,7 +921,7 @@ class NetworkVisibilityController { val (snapshot, updates) = rpc.networkMapFeed() visibleNodeCount = snapshot.size checkIfAllVisible() - subscription = updates.subscribe { + subscription = updates.subscribe({ when (it) { is NetworkMapCache.MapChange.Added -> { visibleNodeCount++ @@ -934,7 +935,9 @@ class NetworkVisibilityController { // Nothing to do here but better being exhaustive. } } - } + }, { _ -> + // Nothing to do on errors here. + }) return future } diff --git a/tools/explorer/capsule/build.gradle b/tools/explorer/capsule/build.gradle index 757c9b503a..76d22baf52 100644 --- a/tools/explorer/capsule/build.gradle +++ b/tools/explorer/capsule/build.gradle @@ -8,7 +8,7 @@ apply plugin: 'com.jfrog.artifactory' description 'Node Explorer' configurations { - runtimeArtifacts.extendsFrom runtime + runtimeArtifacts.extendsFrom runtimeClasspath } // Force the Caplet to target Java 6. This ensures that running 'java -jar explorer.jar' on any Java 6 VM upwards @@ -19,12 +19,12 @@ configurations { sourceCompatibility = 1.6 targetCompatibility = 1.6 -task buildExplorerJAR(type: FatCapsule, dependsOn: project(':tools:explorer').compileJava) { +task buildExplorerJAR(type: FatCapsule, dependsOn: project(':tools:explorer').tasks.jar) { applicationClass 'net.corda.explorer.Main' archiveName "node-explorer-${corda_release_version}.jar" applicationSource = files( - project(':tools:explorer').configurations.runtime, - project(':tools:explorer').jar, + project(':tools:explorer').configurations.runtimeClasspath, + project(':tools:explorer').tasks.jar, project(':tools:explorer').sourceSets.main.java.outputDir.toString() + '/ExplorerCaplet.class' ) classifier 'fat' @@ -54,6 +54,7 @@ artifacts { jar { classifier "ignore" + enabled = false } publish { diff --git a/webserver/webcapsule/build.gradle b/webserver/webcapsule/build.gradle index 38a5765248..58a9d3325b 100644 --- a/webserver/webcapsule/build.gradle +++ b/webserver/webcapsule/build.gradle @@ -1,6 +1,6 @@ /** * This build.gradle exists to publish our capsule (executable fat jar) to maven. It cannot be placed in the - * node project because the bintray plugin cannot publish two modules from one project. + * webserver project because the bintray plugin cannot publish two modules from one project. */ apply plugin: 'net.corda.plugins.publish-utils' apply plugin: 'us.kirchmeier.capsule' @@ -26,18 +26,20 @@ dependencies { sourceCompatibility = 1.6 targetCompatibility = 1.6 -task buildWebserverJar(type: FatCapsule, dependsOn: project(':node').compileJava) { +jar.enabled = false + +task buildWebserverJar(type: FatCapsule, dependsOn: project(':node').tasks.jar) { applicationClass 'net.corda.webserver.WebServer' archiveName "corda-webserver-${corda_release_version}.jar" applicationSource = files( - project(':webserver').configurations.runtime, - project(':webserver').jar, - project(':node').sourceSets.main.java.outputDir.toString() + '/CordaCaplet.class', - project(':node').sourceSets.main.java.outputDir.toString() + '/CordaCaplet$1.class', - "$rootDir/config/dev/log4j2.xml", - "$rootDir/node/build/resources/main/reference.conf" + project(':webserver').configurations.runtimeClasspath, + project(':webserver').tasks.jar, + project(':node').sourceSets.main.java.outputDir.toString() + '/CordaCaplet.class', + project(':node').sourceSets.main.java.outputDir.toString() + '/CordaCaplet$1.class', + project(':node').buildDir.toString() + '/resources/main/reference.conf', + "$rootDir/config/dev/log4j2.xml", + project(':node:capsule').projectDir.toString() + '/NOTICE' // Copy CDDL notice ) - from 'NOTICE' // Copy CDDL notice from configurations.capsuleRuntime.files.collect { zipTree(it) } capsuleManifest { @@ -57,10 +59,12 @@ task buildWebserverJar(type: FatCapsule, dependsOn: project(':node').compileJava } } +assemble.dependsOn buildWebserverJar + artifacts { runtimeArtifacts buildWebserverJar publish buildWebserverJar { - classifier "" + classifier '' } }