From 14dcce49ac74b9d96b94ca97f20953a605fef526 Mon Sep 17 00:00:00 2001 From: Chris Rankin Date: Thu, 14 Jun 2018 15:18:44 +0100 Subject: [PATCH 01/14] ENT-1463, ENT-1903: Raise minimum JDK to 8u171 to fix ZIP compression bugs, (#3367) * Update JarFilter unit tests to show any Gradle stacktraces. * Raise minimum version of JDK8 to 8u171 - fixes ZIP compression bugs. --- build.gradle | 5 +++-- .../src/test/kotlin/net/corda/gradle/jarfilter/DummyJar.kt | 3 +-- .../net/corda/gradle/jarfilter/JarFilterConfigurationTest.kt | 2 +- .../net/corda/gradle/jarfilter/MetaFixConfigurationTests.kt | 2 +- .../src/test/kotlin/net/corda/gradle/jarfilter/Utilities.kt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/build.gradle b/build.gradle index b1a0dd42a9..c24c6fccf2 100644 --- a/build.gradle +++ b/build.gradle @@ -84,8 +84,9 @@ buildscript { ext.deterministic_rt_version = '1.0-SNAPSHOT' - // Update 121 is required for ObjectInputFilter and at time of writing 131 was latest: - ext.java8_minUpdateVersion = '131' + // Update 121 is required for ObjectInputFilter. + // Updates [131, 161] also have zip compression bugs on MacOS (High Sierra). + ext.java8_minUpdateVersion = '171' repositories { mavenLocal() diff --git a/buildSrc/jarfilter/src/test/kotlin/net/corda/gradle/jarfilter/DummyJar.kt b/buildSrc/jarfilter/src/test/kotlin/net/corda/gradle/jarfilter/DummyJar.kt index c332860669..7e768fc80b 100644 --- a/buildSrc/jarfilter/src/test/kotlin/net/corda/gradle/jarfilter/DummyJar.kt +++ b/buildSrc/jarfilter/src/test/kotlin/net/corda/gradle/jarfilter/DummyJar.kt @@ -88,8 +88,7 @@ class DummyJar( jar.write(arrayOfJunk(DATA_SIZE)) // One uncompressed text file - val text = """ -Jar: ${_path.toAbsolutePath()} + val text = """Jar: ${_path.toAbsolutePath()} Class: ${testClass.name} """.toByteArray() jar.putNextEntry(uncompressed("comment.txt", text)) diff --git a/buildSrc/jarfilter/src/test/kotlin/net/corda/gradle/jarfilter/JarFilterConfigurationTest.kt b/buildSrc/jarfilter/src/test/kotlin/net/corda/gradle/jarfilter/JarFilterConfigurationTest.kt index a124545ae4..1e52fd4198 100644 --- a/buildSrc/jarfilter/src/test/kotlin/net/corda/gradle/jarfilter/JarFilterConfigurationTest.kt +++ b/buildSrc/jarfilter/src/test/kotlin/net/corda/gradle/jarfilter/JarFilterConfigurationTest.kt @@ -262,7 +262,7 @@ task jarFilter(type: JarFilterTask) { testProjectDir.newFile("build.gradle").writeText(script) return GradleRunner.create() .withProjectDir(testProjectDir.root) - .withArguments(getBasicArgsForTasks("jarFilter", "--stacktrace")) + .withArguments(getBasicArgsForTasks("jarFilter")) .withPluginClasspath() } diff --git a/buildSrc/jarfilter/src/test/kotlin/net/corda/gradle/jarfilter/MetaFixConfigurationTests.kt b/buildSrc/jarfilter/src/test/kotlin/net/corda/gradle/jarfilter/MetaFixConfigurationTests.kt index bb67dba0c2..84944f6a3f 100644 --- a/buildSrc/jarfilter/src/test/kotlin/net/corda/gradle/jarfilter/MetaFixConfigurationTests.kt +++ b/buildSrc/jarfilter/src/test/kotlin/net/corda/gradle/jarfilter/MetaFixConfigurationTests.kt @@ -69,7 +69,7 @@ task metafix(type: MetaFixerTask) { testProjectDir.newFile("build.gradle").writeText(script) return GradleRunner.create() .withProjectDir(testProjectDir.root) - .withArguments(getBasicArgsForTasks("metafix", "--stacktrace")) + .withArguments(getBasicArgsForTasks("metafix")) .withPluginClasspath() } diff --git a/buildSrc/jarfilter/src/test/kotlin/net/corda/gradle/jarfilter/Utilities.kt b/buildSrc/jarfilter/src/test/kotlin/net/corda/gradle/jarfilter/Utilities.kt index 62a0a36cff..b0bc5a6bfb 100644 --- a/buildSrc/jarfilter/src/test/kotlin/net/corda/gradle/jarfilter/Utilities.kt +++ b/buildSrc/jarfilter/src/test/kotlin/net/corda/gradle/jarfilter/Utilities.kt @@ -29,7 +29,7 @@ private val testGradleUserHome: String get() = testGradleUserHomeValue ?: throw AssumptionViolatedException("System property 'test.gradle.user.home' not set.") fun getGradleArgsForTasks(vararg taskNames: String): MutableList = getBasicArgsForTasks(*taskNames).apply { add("--info") } -fun getBasicArgsForTasks(vararg taskNames: String): MutableList = mutableListOf(*taskNames, "-g", testGradleUserHome) +fun getBasicArgsForTasks(vararg taskNames: String): MutableList = mutableListOf(*taskNames, "--stacktrace", "-g", testGradleUserHome) @Throws(IOException::class) fun copyResourceTo(resourceName: String, target: Path) { From df0c9dc135218248b3f9a3f9849b29007ce22a10 Mon Sep 17 00:00:00 2001 From: Joel Dudley Date: Thu, 14 Jun 2018 15:57:49 +0100 Subject: [PATCH 02/14] Adds instructions for building Gradle plugins (#3372) * Update building-against-master.rst * Self-review. --- docs/source/building-against-master.rst | 34 ++++++++++++++++--------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/docs/source/building-against-master.rst b/docs/source/building-against-master.rst index 4c86894ade..fb73283025 100644 --- a/docs/source/building-against-master.rst +++ b/docs/source/building-against-master.rst @@ -1,21 +1,27 @@ -Building CorDapps against Master -================================ +Building CorDapps against a non-release branch +============================================== It is advisable to develop CorDapps against the most recent Corda stable release. However, you may need to build a CorDapp -against the unstable Master branch if your CorDapp uses a very recent feature, or you are using the CorDapp to test a PR +against an unstable non-release branch if your CorDapp uses a very recent feature, or you are using the CorDapp to test a PR on the main codebase. -To work against the Master branch, proceed as follows: +To work against a non-release branch, proceed as follows: 1. Clone the `Corda repository `_ -2. Open a terminal window in the folder where you cloned the Corda repository +2. Check out the branch or commit of the Corda repository you want to work against -3. Use the following command to check out the latest master branch: +3. Make a note of the ``gradlePluginsVersion`` in the root ``constants.properties`` file of the Corda repository + +4. Clone the `Corda Gradle Plugins repository `_ - ``git checkout master; git pull`` +5. Check out the tag of the Corda Gradle Plugins repository corresponding to the ``gradlePluginsVersion`` -4. Publish Corda to your local Maven repository using the following commands: +6. Follow the instructions in the readme of the Corda Gradle Plugins repository to install this version of the Corda Gradle plugins locally + +7. Open a terminal window in the folder where you cloned the Corda repository + +8. Publish Corda to your local Maven repository using the following commands: * Unix/Mac OSX: ``./gradlew install`` * Windows: ``gradlew.bat install`` @@ -23,9 +29,13 @@ To work against the Master branch, proceed as follows: .. warning:: If you do modify your local Corda repository after having published it to Maven local, then you must re-publish it to Maven local for the local installation to reflect the changes you have made. - .. warning:: As the Corda repository evolves on a daily basis, two clones of the Master branch at different points in - time may differ. If you are using a Master release and need help debugging an error, then please let us know the + .. warning:: As the Corda repository evolves on a daily basis, two clones of an unstable branch at different points in + time may differ. If you are using an unstable release and need help debugging an error, then please let us know the **commit** you are working from. This will help us ascertain the issue. + +9. Make a note of the ``corda_release_version`` in the root ``build.gradle`` file of the Corda repository -5. Update the ``ext.corda_release_version`` property in your CorDapp's root ``build.gradle`` file to match the version - here: https://github.com/corda/corda/blob/master/build.gradle#L7 +10. In your CorDapp's root ``build.gradle`` file: + + * Update ``ext.corda_release_version`` to the ``corda_release_version`` noted down earlier + * Update ``corda_gradle_plugins_version`` to the ``gradlePluginsVersion`` noted down earlier From 377d980c9984a6bb1fbdf33064e39f9ac6f391b1 Mon Sep 17 00:00:00 2001 From: Michal Kit Date: Thu, 14 Jun 2018 16:35:42 +0100 Subject: [PATCH 03/14] Fixing filename typo (#3358) --- .../network/{WhitelisGenerator.kt => WhitelistGenerator.kt} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename node-api/src/main/kotlin/net/corda/nodeapi/internal/network/{WhitelisGenerator.kt => WhitelistGenerator.kt} (100%) diff --git a/node-api/src/main/kotlin/net/corda/nodeapi/internal/network/WhitelisGenerator.kt b/node-api/src/main/kotlin/net/corda/nodeapi/internal/network/WhitelistGenerator.kt similarity index 100% rename from node-api/src/main/kotlin/net/corda/nodeapi/internal/network/WhitelisGenerator.kt rename to node-api/src/main/kotlin/net/corda/nodeapi/internal/network/WhitelistGenerator.kt From 94c71133056f572fcca97ef870e1bbdbf0dc3ef8 Mon Sep 17 00:00:00 2001 From: Mike Hearn Date: Wed, 13 Jun 2018 17:50:13 +0100 Subject: [PATCH 04/14] Upgrade to Gradle 4.8 --- build.gradle | 4 ++-- constants.properties | 2 +- gradle/wrapper/gradle-wrapper.jar | Bin 54333 -> 54413 bytes gradle/wrapper/gradle-wrapper.properties | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index c24c6fccf2..069980dc3e 100644 --- a/build.gradle +++ b/build.gradle @@ -59,7 +59,7 @@ buildscript { ext.h2_version = '1.4.197' // Update docs if renamed or removed. ext.postgresql_version = '42.1.4' ext.rxjava_version = '1.2.4' - ext.dokka_version = '0.9.16-eap-2' + ext.dokka_version = '0.9.17' ext.eddsa_version = '0.2.0' ext.dependency_checker_version = '3.1.0' ext.commons_collections_version = '4.1' @@ -431,6 +431,6 @@ if(file('corda-docs-only-build').exists() || (System.getenv('CORDA_DOCS_ONLY_BUI } wrapper { - gradleVersion = "4.4.1" + gradleVersion = "4.8" distributionType = Wrapper.DistributionType.ALL } diff --git a/constants.properties b/constants.properties index 52144277de..be17f677e5 100644 --- a/constants.properties +++ b/constants.properties @@ -6,7 +6,7 @@ proguardVersion=6.0.3 bouncycastleVersion=1.57 typesafeConfigVersion=1.3.1 jsr305Version=3.0.2 -artifactoryPluginVersion=4.4.18 +artifactoryPluginVersion=4.7.3 snakeYamlVersion=1.19 caffeineVersion=2.6.2 metricsVersion=3.2.5 diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 99340b4ad18d3c7e764794d300ffd35017036793..1948b9074f1016d15d505d185bc3f73deb82d8c8 100644 GIT binary patch delta 7645 zcmY+J1yEGq+sBth=@jYiT)J5r36YX+0f_|`q+M$1kY;J5J0yO9G$PHy(nv@P(v8yi z`uhIH|NFl)cjozg&v%}C?lWiRp8K56a`dw)Ey0w zNLByQ3WRMD9crV92>=`-7Ctfo=O*|pWnh^EI z5@uB5aCEifMc|5E#`_$dl)HWycLa4g?%hTwI6_zzITkBtE1MjvX6emFEbqzh`bz@+ zj$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ZJ3Vw|9-~skdPSvF8jX? zgZp17|39JsuZZ~H5RKr!(9y6k0IKv4#lHyw2vz=J!8;sS`nNX#>UaO-@iz&868ImE zfoWi7BkTaS_y1(gdrDa6Ux{M$Pdq#IH159hGQcDdm3d2 zu-pAb3YhGe8eqx^)|*TXYZ#M3wuYUK=>i5_{~79T*nellhlP$)0>-`nT1>F7<9vWN zpMMCQK!vIKlE8Q;*a7eS|JM=+yb1b;s}u5osL+3?JgE*~jrfN>lL`Ry5C0H2B@Zx7 z_=`YT)|50rJNYk)!dxfuVI!&d*#A8o`_%trQql-u4O95AxM@m&P5Qr4ya+Vd_i0{$ zO4k2MX=G-YJHiw>0ER#~0osfH+KjOCK~k9S3?(3=8MfTX2>U$43vliHi`@Tq#xhHZ q> Date: Sat, 19 May 2018 13:59:28 +0200 Subject: [PATCH 05/14] Make Gradle fail fast when a unit test doesn't succeed. --- build.gradle | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build.gradle b/build.gradle index 069980dc3e..4329fa1c93 100644 --- a/build.gradle +++ b/build.gradle @@ -194,6 +194,8 @@ allprojects { } tasks.withType(Test) { + failFast = true + // Prevent the project from creating temporary files outside of the build directory. systemProperty 'java.io.tmpdir', buildDir.absolutePath From 191eef12cb2765c6bfcbb6d4b76ad89ba391b0d0 Mon Sep 17 00:00:00 2001 From: josecoll Date: Thu, 14 Jun 2018 18:17:53 +0100 Subject: [PATCH 06/14] Fix bootstrapper publication problem. (#3370) --- tools/bootstrapper/build.gradle | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/bootstrapper/build.gradle b/tools/bootstrapper/build.gradle index 1748fda18f..04962dbe2f 100644 --- a/tools/bootstrapper/build.gradle +++ b/tools/bootstrapper/build.gradle @@ -41,6 +41,10 @@ artifacts { } } +jar { + classifier "ignore" +} + publish { disableDefaultJar = true name 'corda-tools-network-bootstrapper' From 230d5e294ebd28893796fc2d27d5298f8e5013a4 Mon Sep 17 00:00:00 2001 From: Thomas Schroeter Date: Fri, 15 Jun 2018 09:17:10 +0100 Subject: [PATCH 07/14] ENT-2084 Fix `CheckpointVerifier` (#3374) --- .../net/corda/node/internal/AbstractNode.kt | 29 +++++++++++-------- .../corda/node/internal/CheckpointVerifier.kt | 11 +++++-- .../persistence/DBCheckpointStorageTests.kt | 6 ++-- 3 files changed, 30 insertions(+), 16 deletions(-) diff --git a/node/src/main/kotlin/net/corda/node/internal/AbstractNode.kt b/node/src/main/kotlin/net/corda/node/internal/AbstractNode.kt index f87174cfcc..c8f321f13f 100644 --- a/node/src/main/kotlin/net/corda/node/internal/AbstractNode.kt +++ b/node/src/main/kotlin/net/corda/node/internal/AbstractNode.kt @@ -285,6 +285,7 @@ abstract class AbstractNode(val configuration: NodeConfiguration, val smm = makeStateMachineManager(database) val flowLogicRefFactory = FlowLogicRefFactoryImpl(cordappLoader.appClassLoader) val flowStarter = FlowStarterImpl(smm, flowLogicRefFactory) + val cordaServices = installCordaServices(flowStarter) val schedulerService = NodeSchedulerService( platformClock, database, @@ -294,8 +295,20 @@ abstract class AbstractNode(val configuration: NodeConfiguration, flowLogicRefFactory = flowLogicRefFactory, drainingModePollPeriod = configuration.drainingModePollPeriod, nodeProperties = nodeProperties) - runOnStop += { schedulerService.join() } + + tokenizableServices = nodeServices + cordaServices + schedulerService + + try { + verifyCheckpointsCompatible(checkpointStorage, cordappProvider.cordapps, versionInfo.platformVersion, _services, tokenizableServices) + } catch (e: CheckpointIncompatibleException) { + if (configuration.devMode) { + Node.printWarning(e.message) + } else { + throw e + } + } + (serverThread as? ExecutorService)?.let { runOnStop += { // We wait here, even though any in-flight messages should have been drained away because the @@ -309,8 +322,7 @@ abstract class AbstractNode(val configuration: NodeConfiguration, val rpcOps = makeRPCOps(flowStarter, smm) startMessagingService(rpcOps) installCoreFlows() - val cordaServices = installCordaServices(flowStarter) - tokenizableServices = nodeServices + cordaServices + schedulerService + registerCordappFlows(smm) _services.rpcFlows += cordappLoader.cordapps.flatMap { it.rpcFlows } startShell() @@ -670,15 +682,6 @@ abstract class AbstractNode(val configuration: NodeConfiguration, networkParameters: NetworkParameters): MutableList { checkpointStorage = DBCheckpointStorage() - try { - verifyCheckpointsCompatible(checkpointStorage, cordappProvider.cordapps, versionInfo.platformVersion) - } catch (e: CheckpointIncompatibleException) { - if (configuration.devMode) { - Node.printWarning(e.message) - } else { - throw e - } - } val keyManagementService = makeKeyManagementService(identityService, keyPairs, database) _services = ServiceHubInternalImpl( @@ -694,7 +697,9 @@ abstract class AbstractNode(val configuration: NodeConfiguration, nodeProperties, networkParameters, servicesForResolution) + network = makeMessagingService(database, nodeInfo, nodeProperties, networkParameters) + return mutableListOf(attachments, network, services.vaultService, services.keyManagementService, services.identityService, platformClock, services.auditService, services.monitoringService, services.networkMapCache, services.schemaService, diff --git a/node/src/main/kotlin/net/corda/node/internal/CheckpointVerifier.kt b/node/src/main/kotlin/net/corda/node/internal/CheckpointVerifier.kt index 96b7704df3..ad2a7c903d 100644 --- a/node/src/main/kotlin/net/corda/node/internal/CheckpointVerifier.kt +++ b/node/src/main/kotlin/net/corda/node/internal/CheckpointVerifier.kt @@ -3,11 +3,14 @@ package net.corda.node.internal import net.corda.core.cordapp.Cordapp import net.corda.core.crypto.SecureHash import net.corda.core.flows.FlowLogic +import net.corda.core.node.ServiceHub import net.corda.core.serialization.SerializationDefaults import net.corda.core.serialization.deserialize import net.corda.node.services.api.CheckpointStorage import net.corda.node.services.statemachine.SubFlow import net.corda.node.services.statemachine.SubFlowVersion +import net.corda.serialization.internal.SerializeAsTokenContextImpl +import net.corda.serialization.internal.withTokenContext object CheckpointVerifier { @@ -15,10 +18,14 @@ object CheckpointVerifier { * Verifies that all Checkpoints stored in the db can be safely loaded with the currently installed version. * @throws CheckpointIncompatibleException if any offending checkpoint is found. */ - fun verifyCheckpointsCompatible(checkpointStorage: CheckpointStorage, currentCordapps: List, platformVersion: Int) { + fun verifyCheckpointsCompatible(checkpointStorage: CheckpointStorage, currentCordapps: List, platformVersion: Int, serviceHub: ServiceHub, tokenizableServices: List) { + val checkpointSerializationContext = SerializationDefaults.CHECKPOINT_CONTEXT.withTokenContext( + SerializeAsTokenContextImpl(tokenizableServices, SerializationDefaults.SERIALIZATION_FACTORY, SerializationDefaults.CHECKPOINT_CONTEXT, serviceHub) + ) checkpointStorage.getAllCheckpoints().forEach { (_, serializedCheckpoint) -> + val checkpoint = try { - serializedCheckpoint.deserialize(context = SerializationDefaults.CHECKPOINT_CONTEXT) + serializedCheckpoint.deserialize(context = checkpointSerializationContext) } catch (e: Exception) { throw CheckpointIncompatibleException.CannotBeDeserialisedException(e) } diff --git a/node/src/test/kotlin/net/corda/node/services/persistence/DBCheckpointStorageTests.kt b/node/src/test/kotlin/net/corda/node/services/persistence/DBCheckpointStorageTests.kt index 76751aa8fd..903ffa6c01 100644 --- a/node/src/test/kotlin/net/corda/node/services/persistence/DBCheckpointStorageTests.kt +++ b/node/src/test/kotlin/net/corda/node/services/persistence/DBCheckpointStorageTests.kt @@ -20,6 +20,7 @@ import net.corda.testing.core.ALICE_NAME import net.corda.testing.core.SerializationEnvironmentRule import net.corda.testing.core.TestIdentity import net.corda.testing.internal.LogHelper +import net.corda.testing.node.MockServices import net.corda.testing.node.MockServices.Companion.makeTestDataSourceProperties import org.assertj.core.api.Assertions import org.assertj.core.api.Assertions.assertThat @@ -155,13 +156,14 @@ class DBCheckpointStorageTests { @Test fun `verify checkpoints compatible`() { + val mockServices = MockServices(emptyList(), ALICE.name) database.transaction { val (id, checkpoint) = newCheckpoint(1) checkpointStorage.addCheckpoint(id, checkpoint) } database.transaction { - CheckpointVerifier.verifyCheckpointsCompatible(checkpointStorage, emptyList(), 1) + CheckpointVerifier.verifyCheckpointsCompatible(checkpointStorage, emptyList(), 1, mockServices, emptyList()) } database.transaction { @@ -171,7 +173,7 @@ class DBCheckpointStorageTests { Assertions.assertThatThrownBy { database.transaction { - CheckpointVerifier.verifyCheckpointsCompatible(checkpointStorage, emptyList(), 1) + CheckpointVerifier.verifyCheckpointsCompatible(checkpointStorage, emptyList(), 1, mockServices, emptyList()) } }.isInstanceOf(CheckpointIncompatibleException::class.java) } From 3e98efe04b031ae50018be74fec3094a3570c534 Mon Sep 17 00:00:00 2001 From: Mike Hearn Date: Thu, 14 Jun 2018 15:23:45 +0100 Subject: [PATCH 08/14] Delete the network visualiser sample. It's very old and the build is strange and breaks in odd ways when Gradle runs in parallel. We haven't used it for a long time and have better demos these days anyway --- samples/network-visualiser/README.md | 13 - samples/network-visualiser/build.gradle | 78 ---- .../net/corda/netmap/NetworkMapVisualiser.kt | 359 ------------------ .../net/corda/netmap/VisualiserUtils.kt | 18 - .../kotlin/net/corda/netmap/VisualiserView.kt | 305 --------------- .../net/corda/netmap/VisualiserViewModel.kt | 225 ----------- .../corda/netmap/simulation/IRSSimulation.kt | 172 --------- .../net/corda/netmap/simulation/Simulation.kt | 205 ---------- .../net/corda/irs/web/simulation/trade.json | 89 ----- .../resources/net/corda/netmap/Corda logo.png | Bin 17274 -> 0 bytes .../resources/net/corda/netmap/Europe.jpg | Bin 309247 -> 0 bytes .../net/corda/netmap/MainWindow.fxml | 26 -- .../corda/netmap/SIL Open Font License.txt | 43 --- .../net/corda/netmap/SourceSansPro-Black.otf | Bin 234176 -> 0 bytes .../corda/netmap/SourceSansPro-BlackIt.otf | Bin 81120 -> 0 bytes .../net/corda/netmap/SourceSansPro-Bold.otf | Bin 235128 -> 0 bytes .../net/corda/netmap/SourceSansPro-BoldIt.otf | Bin 80392 -> 0 bytes .../corda/netmap/SourceSansPro-ExtraLight.otf | Bin 221580 -> 0 bytes .../netmap/SourceSansPro-ExtraLightIt.otf | Bin 76400 -> 0 bytes .../net/corda/netmap/SourceSansPro-It.otf | Bin 79724 -> 0 bytes .../net/corda/netmap/SourceSansPro-Light.otf | Bin 226032 -> 0 bytes .../corda/netmap/SourceSansPro-LightIt.otf | Bin 77816 -> 0 bytes .../corda/netmap/SourceSansPro-Regular.otf | Bin 229588 -> 0 bytes .../corda/netmap/SourceSansPro-Semibold.otf | Bin 232680 -> 0 bytes .../corda/netmap/SourceSansPro-SemiboldIt.otf | Bin 80316 -> 0 bytes .../resources/net/corda/netmap/WorldMap.png | Bin 349746 -> 0 bytes .../net/corda/netmap/WorldMapSquare.png | Bin 480246 -> 0 bytes .../resources/net/corda/netmap/styles.css | 228 ----------- .../netmap/simulation/IRSSimulationTest.kt | 19 - settings.gradle | 1 - 30 files changed, 1781 deletions(-) delete mode 100644 samples/network-visualiser/README.md delete mode 100644 samples/network-visualiser/build.gradle delete mode 100644 samples/network-visualiser/src/main/kotlin/net/corda/netmap/NetworkMapVisualiser.kt delete mode 100644 samples/network-visualiser/src/main/kotlin/net/corda/netmap/VisualiserUtils.kt delete mode 100644 samples/network-visualiser/src/main/kotlin/net/corda/netmap/VisualiserView.kt delete mode 100644 samples/network-visualiser/src/main/kotlin/net/corda/netmap/VisualiserViewModel.kt delete mode 100644 samples/network-visualiser/src/main/kotlin/net/corda/netmap/simulation/IRSSimulation.kt delete mode 100644 samples/network-visualiser/src/main/kotlin/net/corda/netmap/simulation/Simulation.kt delete mode 100644 samples/network-visualiser/src/main/resources/net/corda/irs/web/simulation/trade.json delete mode 100644 samples/network-visualiser/src/main/resources/net/corda/netmap/Corda logo.png delete mode 100644 samples/network-visualiser/src/main/resources/net/corda/netmap/Europe.jpg delete mode 100644 samples/network-visualiser/src/main/resources/net/corda/netmap/MainWindow.fxml delete mode 100644 samples/network-visualiser/src/main/resources/net/corda/netmap/SIL Open Font License.txt delete mode 100644 samples/network-visualiser/src/main/resources/net/corda/netmap/SourceSansPro-Black.otf delete mode 100644 samples/network-visualiser/src/main/resources/net/corda/netmap/SourceSansPro-BlackIt.otf delete mode 100644 samples/network-visualiser/src/main/resources/net/corda/netmap/SourceSansPro-Bold.otf delete mode 100644 samples/network-visualiser/src/main/resources/net/corda/netmap/SourceSansPro-BoldIt.otf delete mode 100644 samples/network-visualiser/src/main/resources/net/corda/netmap/SourceSansPro-ExtraLight.otf delete mode 100644 samples/network-visualiser/src/main/resources/net/corda/netmap/SourceSansPro-ExtraLightIt.otf delete mode 100644 samples/network-visualiser/src/main/resources/net/corda/netmap/SourceSansPro-It.otf delete mode 100644 samples/network-visualiser/src/main/resources/net/corda/netmap/SourceSansPro-Light.otf delete mode 100644 samples/network-visualiser/src/main/resources/net/corda/netmap/SourceSansPro-LightIt.otf delete mode 100644 samples/network-visualiser/src/main/resources/net/corda/netmap/SourceSansPro-Regular.otf delete mode 100644 samples/network-visualiser/src/main/resources/net/corda/netmap/SourceSansPro-Semibold.otf delete mode 100644 samples/network-visualiser/src/main/resources/net/corda/netmap/SourceSansPro-SemiboldIt.otf delete mode 100644 samples/network-visualiser/src/main/resources/net/corda/netmap/WorldMap.png delete mode 100644 samples/network-visualiser/src/main/resources/net/corda/netmap/WorldMapSquare.png delete mode 100644 samples/network-visualiser/src/main/resources/net/corda/netmap/styles.css delete mode 100644 samples/network-visualiser/src/test/kotlin/net/corda/netmap/simulation/IRSSimulationTest.kt diff --git a/samples/network-visualiser/README.md b/samples/network-visualiser/README.md deleted file mode 100644 index 4e9f9f8350..0000000000 --- a/samples/network-visualiser/README.md +++ /dev/null @@ -1,13 +0,0 @@ -# Network Visualiser - -This package contains a network visualiser that uses a simulation to visualise the interaction and messages between nodes on the Corda network. - -Please see the either the [online documentation](https://docs.corda.net/network-simulator.html) for more info on the network visualiser, or the [included offline version](../../docs/build/html/network-simulator.html). - -From the root directory of the repository, run it like this (Windows): - - gradle samples:network-visualiser:run - -or (Mac / Unix) - - ./gradlew samples:network-visualiser:run \ No newline at end of file diff --git a/samples/network-visualiser/build.gradle b/samples/network-visualiser/build.gradle deleted file mode 100644 index b45f06246f..0000000000 --- a/samples/network-visualiser/build.gradle +++ /dev/null @@ -1,78 +0,0 @@ -buildscript { - ext { - springBootVersion = '1.5.7.RELEASE' - } - repositories { - mavenCentral() - } - dependencies { - classpath "org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion" - classpath "io.spring.gradle:dependency-management-plugin:1.0.4.RELEASE" - } -} - -// Spring Boot plugin adds a numerous hardcoded dependencies in the version much lower then Corda expects -// causing the problems in runtime. Those can be changed by manipulating above properties -// See https://github.com/spring-gradle-plugins/dependency-management-plugin/blob/master/README.md#changing-the-value-of-a-version-property -// This has to be repeated here as otherwise the order of files does matter -ext['artemis.version'] = "$artemis_version" -ext['hibernate.version'] = "$hibernate_version" -ext['jackson.version'] = "$jackson_version" -ext['dropwizard-metrics.version'] = "$metrics_version" -ext['mockito.version'] = "$mockito_version" - -apply plugin: 'java' -apply plugin: 'kotlin' -apply plugin: 'idea' -apply plugin: 'application' -apply plugin: 'org.springframework.boot' -apply plugin: 'net.corda.plugins.quasar-utils' -apply plugin: 'us.kirchmeier.capsule' - -// Spring Boot plugin have to be reimported, however it picks up the settings from irs-demo, so there is no need to -// reconfigure - -// Warning: The network visualiser is not a Cordapp so please do not use it as an example of how -// to build a cordapp - -dependencies { - testCompile "junit:junit:$junit_version" - - // Corda integration dependencies - compile project(path: ":node:capsule", configuration: 'runtimeArtifacts') - compile project(path: ":webserver:webcapsule", configuration: 'runtimeArtifacts') - compile project(':core') - compile project(':finance') - compile project(':node-driver') - compile project(':finance') - compile project(':samples:irs-demo') - - // GraphStream: For visualisation - compileOnly "co.paralleluniverse:capsule:$capsule_version" -} - -idea { - module { - downloadJavadoc = true // defaults to false - downloadSources = true - } -} - -mainClassName = 'net.corda.netmap.NetworkMapVisualiser' - -task deployVisualiser(type: FatCapsule) { - applicationClass 'net.corda.netmap.NetworkMapVisualiser' - reallyExecutable - capsuleManifest { - minJavaVersion = '1.8.0' - javaAgents = [configurations.quasar.singleFile.name] - } -} - -jar { - manifest { - attributes( - 'Automatic-Module-Name': 'net.corda.samples.network.visualiser' - ) - } -} diff --git a/samples/network-visualiser/src/main/kotlin/net/corda/netmap/NetworkMapVisualiser.kt b/samples/network-visualiser/src/main/kotlin/net/corda/netmap/NetworkMapVisualiser.kt deleted file mode 100644 index 161264eb36..0000000000 --- a/samples/network-visualiser/src/main/kotlin/net/corda/netmap/NetworkMapVisualiser.kt +++ /dev/null @@ -1,359 +0,0 @@ -package net.corda.netmap - -import javafx.animation.* -import javafx.application.Application -import javafx.application.Platform -import javafx.beans.property.SimpleDoubleProperty -import javafx.beans.value.WritableValue -import javafx.geometry.Insets -import javafx.scene.input.KeyCode -import javafx.scene.input.KeyCodeCombination -import javafx.scene.layout.VBox -import javafx.stage.Stage -import javafx.util.Duration -import net.corda.core.serialization.deserialize -import net.corda.core.utilities.ProgressTracker -import net.corda.netmap.VisualiserViewModel.Style -import net.corda.netmap.simulation.IRSSimulation -import net.corda.node.services.statemachine.* -import net.corda.testing.core.singleIdentity -import net.corda.testing.node.InMemoryMessagingNetwork -import net.corda.testing.node.internal.InternalMockNetwork -import rx.Scheduler -import rx.schedulers.Schedulers -import java.time.format.DateTimeFormatter -import java.time.format.FormatStyle -import java.util.* -import kotlin.concurrent.schedule -import kotlin.concurrent.scheduleAtFixedRate -import kotlin.system.exitProcess - -fun WritableValue.keyValue(endValue: T, interpolator: Interpolator = Interpolator.EASE_OUT) = KeyValue(this, endValue, interpolator) - -// TODO: This code is all horribly ugly. Refactor to use TornadoFX to clean it up. - -class NetworkMapVisualiser : Application() { - enum class NodeType { - BANK, SERVICE - } - - enum class RunPauseButtonLabel { - RUN, PAUSE; - - override fun toString(): String { - return name.toLowerCase().capitalize() - } - } - - sealed class RunningPausedState { - class Running(val tickTimer: TimerTask) : RunningPausedState() - class Paused : RunningPausedState() - - val buttonLabel: RunPauseButtonLabel - get() { - return when (this) { - is RunningPausedState.Running -> RunPauseButtonLabel.PAUSE - is RunningPausedState.Paused -> RunPauseButtonLabel.RUN - } - } - } - - private val view = VisualiserView() - private val viewModel = VisualiserViewModel() - - val timer = Timer() - val uiThread: Scheduler = Schedulers.from { Platform.runLater(it) } - - override fun start(stage: Stage) { - viewModel.view = view - viewModel.presentationMode = "--presentation-mode" in parameters.raw - buildScene(stage) - viewModel.displayStyle = if ("--circle" in parameters.raw) { - Style.CIRCLE - } else { - viewModel.displayStyle - } - - val simulation = viewModel.simulation - // Update the white-backgrounded label indicating what flow step it's up to. - simulation.allFlowSteps.observeOn(uiThread).subscribe { (node, change) -> - val label = viewModel.nodesToWidgets[node]!!.statusLabel - if (change is ProgressTracker.Change.Position) { - // Fade in the status label if it's our first step. - if (label.text == "") { - with(FadeTransition(Duration(150.0), label)) { - fromValue = 0.0 - toValue = 1.0 - play() - } - } - label.text = change.newStep.label - if (change.newStep == ProgressTracker.DONE && change.tracker == change.tracker.topLevelTracker) { - runLater(500, -1) { - // Fade out the status label. - with(FadeTransition(Duration(750.0), label)) { - fromValue = 1.0 - toValue = 0.0 - setOnFinished { label.text = "" } - play() - } - } - } - } else if (change is ProgressTracker.Change.Rendering) { - label.text = change.ofStep.label - } - } - // Fire the message bullets between nodes. - simulation.mockNet.messagingNetwork.sentMessages.observeOn(uiThread).subscribe { msg: InMemoryMessagingNetwork.MessageTransfer -> - val senderNode: InternalMockNetwork.MockNode = simulation.mockNet.addressToNode(msg.sender) - val destNode: InternalMockNetwork.MockNode = simulation.mockNet.addressToNode(msg.recipients) - - if (transferIsInteresting(msg)) { - viewModel.nodesToWidgets[senderNode]!!.pulseAnim.play() - viewModel.fireBulletBetweenNodes(senderNode, destNode, "bank", "bank") - } - } - // Pulse all parties in a trade when the trade completes - simulation.doneSteps.observeOn(uiThread).subscribe { nodes: Collection -> - nodes.forEach { viewModel.nodesToWidgets[it]!!.longPulseAnim.play() } - } - - stage.setOnCloseRequest { exitProcess(0) } - //stage.isMaximized = true - stage.show() - } - - fun runLater(startAfter: Int, delayBetween: Int, body: () -> Unit) { - if (delayBetween != -1) { - timer.scheduleAtFixedRate(startAfter.toLong(), delayBetween.toLong()) { - Platform.runLater { - body() - } - } - } else { - timer.schedule(startAfter.toLong()) { - Platform.runLater { - body() - } - } - } - } - - private fun buildScene(stage: Stage) { - view.stage = stage - view.setup(viewModel.runningPausedState, viewModel.displayStyle, viewModel.presentationMode) - bindSidebar() - bindTopbar() - viewModel.createNodes() - - // Spacebar advances simulation by one step. - stage.scene.accelerators[KeyCodeCombination(KeyCode.SPACE)] = Runnable { onNextInvoked() } - - reloadStylesheet(stage) - - stage.focusedProperty().addListener { _, _, new -> - if (new) { - reloadStylesheet(stage) - } - } - } - - private fun bindTopbar() { - view.resetButton.setOnAction({ reset() }) - view.nextButton.setOnAction { - if (!view.simulateInitialisationCheckbox.isSelected && !viewModel.simulation.networkInitialisationFinished.isDone) { - skipNetworkInitialisation() - } else { - onNextInvoked() - } - } - viewModel.simulation.networkInitialisationFinished.thenAccept { - view.simulateInitialisationCheckbox.isVisible = false - } - view.runPauseButton.setOnAction { - val oldRunningPausedState = viewModel.runningPausedState - val newRunningPausedState = when (oldRunningPausedState) { - is NetworkMapVisualiser.RunningPausedState.Running -> { - oldRunningPausedState.tickTimer.cancel() - - view.nextButton.isDisable = false - view.resetButton.isDisable = false - - NetworkMapVisualiser.RunningPausedState.Paused() - } - is NetworkMapVisualiser.RunningPausedState.Paused -> { - val tickTimer = timer.scheduleAtFixedRate(viewModel.stepDuration.toMillis().toLong(), viewModel.stepDuration.toMillis().toLong()) { - Platform.runLater { - onNextInvoked() - } - } - - view.nextButton.isDisable = true - view.resetButton.isDisable = true - - if (!view.simulateInitialisationCheckbox.isSelected && !viewModel.simulation.networkInitialisationFinished.isDone) { - skipNetworkInitialisation() - } - - NetworkMapVisualiser.RunningPausedState.Running(tickTimer) - } - } - - view.runPauseButton.text = newRunningPausedState.buttonLabel.toString() - viewModel.runningPausedState = newRunningPausedState - } - view.styleChoice.selectionModel.selectedItemProperty() - .addListener { _, _, newValue -> viewModel.displayStyle = newValue } - viewModel.simulation.dateChanges.observeOn(uiThread).subscribe { view.dateLabel.text = it.format(DateTimeFormatter.ofLocalizedDate(FormatStyle.MEDIUM)) } - } - - private fun reloadStylesheet(stage: Stage) { - stage.scene.stylesheets.clear() - stage.scene.stylesheets.add(NetworkMapVisualiser::class.java.getResource("styles.css").toString()) - } - - private fun bindSidebar() { - viewModel.simulation.allFlowSteps.observeOn(uiThread).subscribe { (node, change) -> - if (change is ProgressTracker.Change.Position) { - val tracker = change.tracker.topLevelTracker - if (change.newStep == ProgressTracker.DONE) { - if (change.tracker == tracker) { - // Flow done; schedule it for removal in a few seconds. We batch them up to make nicer - // animations. - updateProgressTrackerWidget(change) - println("Flow done for ${node.started!!.info.singleIdentity().name}") - viewModel.doneTrackers += tracker - } else { - // Subflow is done; ignore it. - } - } else if (!viewModel.trackerBoxes.containsKey(tracker)) { - // New flow started up; add. - val extraLabel = viewModel.simulation.extraNodeLabels[node] - val label = node.started!!.info.singleIdentity().name.organisation.let { if (extraLabel != null) "$it: $extraLabel" else it } - val widget = view.buildProgressTrackerWidget(label, tracker.topLevelTracker) - println("Added: $tracker, $widget") - viewModel.trackerBoxes[tracker] = widget - view.sidebar.children += widget.vbox - } else { - updateProgressTrackerWidget(change) - } - } else if (change is ProgressTracker.Change.Structural) { - updateProgressTrackerWidget(change) - } - } - - Timer().scheduleAtFixedRate(0, 500) { - Platform.runLater { - for (tracker in viewModel.doneTrackers) { - val pane = viewModel.trackerBoxes[tracker]!!.vbox - // Slide the other tracker widgets up and over this one. - val slideProp = SimpleDoubleProperty(0.0) - slideProp.addListener { _ -> pane.padding = Insets(0.0, 0.0, slideProp.value, 0.0) } - val timeline = Timeline( - KeyFrame(Duration(250.0), - KeyValue(pane.opacityProperty(), 0.0), - KeyValue(slideProp, -pane.height - 50.0) // Subtract the bottom padding gap. - ) - ) - timeline.setOnFinished { - println("Removed: $tracker") - val vbox = viewModel.trackerBoxes.remove(tracker)?.vbox - view.sidebar.children.remove(vbox) - } - timeline.play() - } - viewModel.doneTrackers.clear() - } - } - } - - private fun updateProgressTrackerWidget(step: ProgressTracker.Change) { - if (step is ProgressTracker.Change.Position) { - // Animate the cursor to the right place. - Platform.runLater { - val tracker: ProgressTracker = step.tracker.topLevelTracker - val widget = viewModel.trackerBoxes[tracker] ?: return@runLater - val allSteps: List> = tracker.allSteps - - // Figure out the index of the new step. - val curStep = allSteps.indexOfFirst { it.second == step.newStep } - with(TranslateTransition(Duration(350.0), widget.cursor)) { - fromY = widget.cursor.translateY - toY = (curStep * view.sideBarStepHeight) + (view.sideBarStepHeight / 2.0) - play() - } - } - } else if (step is ProgressTracker.Change.Structural) { - Platform.runLater { - val tracker: ProgressTracker = step.tracker.topLevelTracker - val widget = viewModel.trackerBoxes[tracker] ?: return@runLater - val new = view.buildProgressTrackerWidget(widget.label.text, tracker) - val prevWidget = viewModel.trackerBoxes[tracker]?.vbox ?: throw AssertionError("No previous widget for tracker: $tracker") - val i = (prevWidget.parent as VBox).children.indexOf(viewModel.trackerBoxes[tracker]?.vbox) - (prevWidget.parent as VBox).children[i] = new.vbox - viewModel.trackerBoxes[tracker] = new - } - } - } - - var started = false - private fun startSimulation() { - if (!started) { - viewModel.simulation.start() - started = true - } - } - - private fun reset() { - viewModel.simulation.stop() - viewModel.simulation = IRSSimulation(true, false, null) - started = false - start(view.stage) - } - - private fun skipNetworkInitialisation() { - startSimulation() - while (!viewModel.simulation.networkInitialisationFinished.isDone) { - iterateSimulation() - } - } - - private fun onNextInvoked() { - if (started) { - iterateSimulation() - } else { - startSimulation() - } - } - - private fun iterateSimulation() { - // Loop until either we ran out of things to do, or we sent an interesting message. - while (true) { - val transfer: InMemoryMessagingNetwork.MessageTransfer = viewModel.simulation.iterate() ?: break - if (transferIsInteresting(transfer)) - break - else - System.err.println("skipping boring $transfer") - } - } - - private fun transferIsInteresting(transfer: InMemoryMessagingNetwork.MessageTransfer): Boolean { - // Loopback messages are boring. - if (transfer.sender == transfer.recipients) return false - val message = transfer.messageData.deserialize() - return when (message) { - is InitialSessionMessage -> message.firstPayload != null - is ExistingSessionMessage -> when (message.payload) { - is ConfirmSessionMessage -> false - is DataSessionMessage -> true - is ErrorSessionMessage -> true - is RejectSessionMessage -> true - is EndSessionMessage -> false - } - } - } -} - -fun main(args: Array) { - Application.launch(NetworkMapVisualiser::class.java, *args) -} diff --git a/samples/network-visualiser/src/main/kotlin/net/corda/netmap/VisualiserUtils.kt b/samples/network-visualiser/src/main/kotlin/net/corda/netmap/VisualiserUtils.kt deleted file mode 100644 index 8fc0ab99d7..0000000000 --- a/samples/network-visualiser/src/main/kotlin/net/corda/netmap/VisualiserUtils.kt +++ /dev/null @@ -1,18 +0,0 @@ -package net.corda.netmap - -import javafx.scene.paint.Color - -internal -fun colorToRgb(color: Color): String { - val builder = StringBuilder() - - builder.append("rgb(") - builder.append(Math.round(color.red * 256)) - builder.append(",") - builder.append(Math.round(color.green * 256)) - builder.append(",") - builder.append(Math.round(color.blue * 256)) - builder.append(")") - - return builder.toString() -} \ No newline at end of file diff --git a/samples/network-visualiser/src/main/kotlin/net/corda/netmap/VisualiserView.kt b/samples/network-visualiser/src/main/kotlin/net/corda/netmap/VisualiserView.kt deleted file mode 100644 index e6ba2d4ac2..0000000000 --- a/samples/network-visualiser/src/main/kotlin/net/corda/netmap/VisualiserView.kt +++ /dev/null @@ -1,305 +0,0 @@ -package net.corda.netmap - -import javafx.animation.KeyFrame -import javafx.animation.Timeline -import javafx.application.Platform -import javafx.collections.FXCollections -import javafx.event.EventHandler -import javafx.geometry.Insets -import javafx.geometry.Pos -import javafx.scene.Group -import javafx.scene.Node -import javafx.scene.Scene -import javafx.scene.control.* -import javafx.scene.image.Image -import javafx.scene.image.ImageView -import javafx.scene.input.ZoomEvent -import javafx.scene.layout.* -import javafx.scene.paint.Color -import javafx.scene.shape.Polygon -import javafx.scene.text.Font -import javafx.stage.Stage -import javafx.util.Duration -import net.corda.core.utilities.ProgressTracker -import net.corda.netmap.VisualiserViewModel.Style - -data class TrackerWidget(val vbox: VBox, val cursorBox: Pane, val label: Label, val cursor: Polygon) - -internal class VisualiserView { - lateinit var root: Pane - lateinit var stage: Stage - lateinit var splitter: SplitPane - lateinit var sidebar: VBox - lateinit var resetButton: Button - lateinit var nextButton: Button - lateinit var runPauseButton: Button - lateinit var simulateInitialisationCheckbox: CheckBox - lateinit var styleChoice: ChoiceBox