From 65457dc305ad9d82a5b096054d278376b9a7f3ed Mon Sep 17 00:00:00 2001 From: Anton Subbotin Date: Fri, 26 Jan 2024 17:10:08 +0000 Subject: [PATCH 01/12] Apply gradle changes --- build.gradle | 51 ++++++++++++++++++++++++++++++------------------- settings.gradle | 4 +++- 2 files changed, 34 insertions(+), 21 deletions(-) diff --git a/build.gradle b/build.gradle index 1088827a..35a39e3c 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,9 @@ plugins { id 'org.jetbrains.kotlin.plugin.jpa' id 'java' id 'maven-publish' - id 'net.corda.plugins.csde' +// id 'net.corda.plugins.csde' + + id 'net.corda.gradle.plugin' } allprojects { @@ -16,26 +18,35 @@ allprojects { def javaVersion = VERSION_17 // Configure the CSDE - csde { - cordaClusterURL = "https://localhost:8888" - networkConfigFile = "config/static-network-config.json" - r3RootCertFile = "config/r3-ca-key.pem" - corDappCpiName = "MyCorDapp" - notaryCpiName = "NotaryServer" - cordaRpcUser = "admin" - cordaRpcPasswd ="admin" - workflowsModuleName = workflowsModule - csdeWorkspaceDir = "workspace" - notaryVersion = cordaNotaryPluginsVersion - combinedWorkerVersion = combinedWorkerJarVersion +// csde { +// cordaClusterURL = "https://localhost:8888" +// networkConfigFile = "config/static-network-config.json" +// r3RootCertFile = "config/r3-ca-key.pem" +// corDappCpiName = "MyCorDapp" +// notaryCpiName = "NotaryServer" +// cordaRpcUser = "admin" +// cordaRpcPasswd ="admin" +// workflowsModuleName = workflowsModule +// csdeWorkspaceDir = "workspace" +// notaryVersion = cordaNotaryPluginsVersion +// combinedWorkerVersion = combinedWorkerJarVersion +// postgresJdbcVersion = "42.4.3" +// cordaDbContainerName = "CSDEpostgresql" +// cordaBinDir = "${System.getProperty("user.home")}/$cordaBinariesDirectory" +// cordaCliBinDir = "${System.getProperty("user.home")}/$cordaCliBinariesDirectory" +// cpiUploadTimeout = cpiUploadDefault +// cordaProcessorTimeout = processorTimeout +// vnodeRegistrationTimeout = vnodeRegistrationTimeoutDefault +// skipTestsDuringBuildCpis = this.skipTestsDuringBuildCpis +// } + + // New Corda gradle plugin + cordaRuntimeGradlePlugin { +// combinedWorkerVersion = "5.1.0.0" postgresJdbcVersion = "42.4.3" - cordaDbContainerName = "CSDEpostgresql" - cordaBinDir = "${System.getProperty("user.home")}/$cordaBinariesDirectory" - cordaCliBinDir = "${System.getProperty("user.home")}/$cordaCliBinariesDirectory" - cpiUploadTimeout = cpiUploadDefault - cordaProcessorTimeout = processorTimeout - vnodeRegistrationTimeout = vnodeRegistrationTimeoutDefault - skipTestsDuringBuildCpis = this.skipTestsDuringBuildCpis + // Only need to supply these if you want to use an unpublished version + artifactoryUsername = findProperty('cordaArtifactoryUsername') ?: System.getenv('CORDA_ARTIFACTORY_USERNAME') + artifactoryPassword = findProperty('cordaArtifactoryPassword') ?: System.getenv('CORDA_ARTIFACTORY_PASSWORD') } // Declare the set of Kotlin compiler options we need to build a CorDapp. diff --git a/settings.gradle b/settings.gradle index 6b718c09..18e7a4a4 100644 --- a/settings.gradle +++ b/settings.gradle @@ -22,10 +22,12 @@ pluginManagement { id 'net.corda.plugins.cordapp-cpk2' version cordaPluginsVersion id 'net.corda.plugins.cordapp-cpb2' version cordaPluginsVersion id 'net.corda.cordapp.cordapp-configuration' version cordaApiVersion - id 'net.corda.plugins.csde' version csdePluginVersion +// id 'net.corda.plugins.csde' version csdePluginVersion id 'org.jetbrains.kotlin.jvm' version kotlinVersion id 'org.jetbrains.kotlin.plugin.jpa' version kotlinVersion id 'org.jetbrains.kotlin.plugin.allopen' version kotlinVersion + + id 'net.corda.gradle.plugin' version '5.2.0.0-alpha-1706283415396' } } From a92f6638b87ce98b0919fa1e4b283fc9a0d8631c Mon Sep 17 00:00:00 2001 From: Anton Subbotin Date: Tue, 30 Jan 2024 16:23:27 +0000 Subject: [PATCH 02/12] Run SNAPSHOT from mavenLocal --- settings.gradle | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/settings.gradle b/settings.gradle index 18e7a4a4..abf29075 100644 --- a/settings.gradle +++ b/settings.gradle @@ -27,7 +27,8 @@ pluginManagement { id 'org.jetbrains.kotlin.plugin.jpa' version kotlinVersion id 'org.jetbrains.kotlin.plugin.allopen' version kotlinVersion - id 'net.corda.gradle.plugin' version '5.2.0.0-alpha-1706283415396' +// id 'net.corda.gradle.plugin' version '5.2.0.0-alpha-1706283415396' + id 'net.corda.gradle.plugin' version '5.2.0.0-SNAPSHOT' } } From d0851801b7a9bec684c6806918f00c16899bb2d9 Mon Sep 17 00:00:00 2001 From: Anton Subbotin Date: Tue, 30 Jan 2024 16:39:08 +0000 Subject: [PATCH 03/12] Cleanup gradle config --- build.gradle | 25 ------------------------- gradle.properties | 3 ++- settings.gradle | 5 +---- 3 files changed, 3 insertions(+), 30 deletions(-) diff --git a/build.gradle b/build.gradle index 35a39e3c..c9003665 100644 --- a/build.gradle +++ b/build.gradle @@ -6,8 +6,6 @@ plugins { id 'org.jetbrains.kotlin.plugin.jpa' id 'java' id 'maven-publish' -// id 'net.corda.plugins.csde' - id 'net.corda.gradle.plugin' } @@ -17,29 +15,6 @@ allprojects { def javaVersion = VERSION_17 - // Configure the CSDE -// csde { -// cordaClusterURL = "https://localhost:8888" -// networkConfigFile = "config/static-network-config.json" -// r3RootCertFile = "config/r3-ca-key.pem" -// corDappCpiName = "MyCorDapp" -// notaryCpiName = "NotaryServer" -// cordaRpcUser = "admin" -// cordaRpcPasswd ="admin" -// workflowsModuleName = workflowsModule -// csdeWorkspaceDir = "workspace" -// notaryVersion = cordaNotaryPluginsVersion -// combinedWorkerVersion = combinedWorkerJarVersion -// postgresJdbcVersion = "42.4.3" -// cordaDbContainerName = "CSDEpostgresql" -// cordaBinDir = "${System.getProperty("user.home")}/$cordaBinariesDirectory" -// cordaCliBinDir = "${System.getProperty("user.home")}/$cordaCliBinariesDirectory" -// cpiUploadTimeout = cpiUploadDefault -// cordaProcessorTimeout = processorTimeout -// vnodeRegistrationTimeout = vnodeRegistrationTimeoutDefault -// skipTestsDuringBuildCpis = this.skipTestsDuringBuildCpis -// } - // New Corda gradle plugin cordaRuntimeGradlePlugin { // combinedWorkerVersion = "5.1.0.0" diff --git a/gradle.properties b/gradle.properties index 37043155..926e6424 100644 --- a/gradle.properties +++ b/gradle.properties @@ -16,7 +16,8 @@ combinedWorkerJarVersion=5.1.0.0 cordaPluginsVersion=7.0.3 # Specify the version of the CSDE gradle plugin to use -csdePluginVersion=1.2.0-beta-+ +cordaGradlePluginVersion=5.2.0.0-SNAPSHOT +#cordaGradlePluginVersion=5.2.0.0-alpha-1706283415396 # Specify the name of the workflows module # This will be the name of the generated cpk and cpb files diff --git a/settings.gradle b/settings.gradle index abf29075..a822c8e0 100644 --- a/settings.gradle +++ b/settings.gradle @@ -22,13 +22,10 @@ pluginManagement { id 'net.corda.plugins.cordapp-cpk2' version cordaPluginsVersion id 'net.corda.plugins.cordapp-cpb2' version cordaPluginsVersion id 'net.corda.cordapp.cordapp-configuration' version cordaApiVersion -// id 'net.corda.plugins.csde' version csdePluginVersion id 'org.jetbrains.kotlin.jvm' version kotlinVersion id 'org.jetbrains.kotlin.plugin.jpa' version kotlinVersion id 'org.jetbrains.kotlin.plugin.allopen' version kotlinVersion - -// id 'net.corda.gradle.plugin' version '5.2.0.0-alpha-1706283415396' - id 'net.corda.gradle.plugin' version '5.2.0.0-SNAPSHOT' + id 'net.corda.gradle.plugin' version cordaGradlePluginVersion } } From fdc22841a07a25a255efb63705d806e1d3c942cc Mon Sep 17 00:00:00 2001 From: Anton Subbotin Date: Mon, 5 Feb 2024 10:32:10 +0000 Subject: [PATCH 04/12] Use 5.0.1.0 versions of combined worker and notary --- build.gradle | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index c9003665..5d4731f8 100644 --- a/build.gradle +++ b/build.gradle @@ -17,7 +17,8 @@ allprojects { // New Corda gradle plugin cordaRuntimeGradlePlugin { -// combinedWorkerVersion = "5.1.0.0" + combinedWorkerVersion = "5.0.1.0" + notaryVersion = "5.0.1.0" postgresJdbcVersion = "42.4.3" // Only need to supply these if you want to use an unpublished version artifactoryUsername = findProperty('cordaArtifactoryUsername') ?: System.getenv('CORDA_ARTIFACTORY_USERNAME') From a93e52fefdb9a8263c9dcf526016eba9b195780f Mon Sep 17 00:00:00 2001 From: Anton Subbotin Date: Mon, 12 Feb 2024 09:43:15 +0000 Subject: [PATCH 05/12] Test with docker compose file --- build.gradle | 6 +++--- config/combined-worker-compose.yaml | 30 +++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 config/combined-worker-compose.yaml diff --git a/build.gradle b/build.gradle index 5d4731f8..55d8bd97 100644 --- a/build.gradle +++ b/build.gradle @@ -17,9 +17,9 @@ allprojects { // New Corda gradle plugin cordaRuntimeGradlePlugin { - combinedWorkerVersion = "5.0.1.0" - notaryVersion = "5.0.1.0" - postgresJdbcVersion = "42.4.3" + notaryVersion = "5.2.0.0-beta-1706865687074" + composeFilePath = "config/combined-worker-compose.yaml" + // Only need to supply these if you want to use an unpublished version artifactoryUsername = findProperty('cordaArtifactoryUsername') ?: System.getenv('CORDA_ARTIFACTORY_USERNAME') artifactoryPassword = findProperty('cordaArtifactoryPassword') ?: System.getenv('CORDA_ARTIFACTORY_PASSWORD') diff --git a/config/combined-worker-compose.yaml b/config/combined-worker-compose.yaml new file mode 100644 index 00000000..e5fa2b5c --- /dev/null +++ b/config/combined-worker-compose.yaml @@ -0,0 +1,30 @@ +version: '2' +services: + postgresql: + image: postgres:14.10 + restart: unless-stopped + tty: true + environment: + - POSTGRES_USER=postgres + - POSTGRES_PASSWORD=password + - POSTGRES_DB=cordacluster + ports: + - 5432:5432 + + corda: + image: corda-os-docker.software.r3.com/corda-os-combined-worker:5.2.0.0-beta-1707102610189 + depends_on: + - postgresql + command: [ "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005", + "-mbus.busType=DATABASE", + "-spassphrase=password", + "-ssalt=salt", + "-ddatabase.user=user", + "-ddatabase.pass=password", + "-ddatabase.jdbc.url=jdbc:postgresql://postgresql:5432/cordacluster", + "-ddatabase.jdbc.directory=/opt/jdbc-driver/" + ] + ports: + - 8888:8888 + - 7004:7004 + - 5005:5005 \ No newline at end of file From cc51ed17d375db1a889943520c0c460f2bb6489d Mon Sep 17 00:00:00 2001 From: Anton Subbotin Date: Tue, 27 Feb 2024 11:18:22 +0000 Subject: [PATCH 06/12] Use 5.2 versions across --- build.gradle | 9 ++- config/combined-worker-compose.yaml | 2 +- config/combined-worker-kafka-compose.yaml | 69 +++++++++++++++++++++++ gradle.properties | 13 ++--- 4 files changed, 80 insertions(+), 13 deletions(-) create mode 100644 config/combined-worker-kafka-compose.yaml diff --git a/build.gradle b/build.gradle index 55d8bd97..da811338 100644 --- a/build.gradle +++ b/build.gradle @@ -1,3 +1,5 @@ +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + import static org.gradle.api.JavaVersion.VERSION_17 plugins { @@ -17,8 +19,9 @@ allprojects { // New Corda gradle plugin cordaRuntimeGradlePlugin { - notaryVersion = "5.2.0.0-beta-1706865687074" - composeFilePath = "config/combined-worker-compose.yaml" + notaryVersion = "5.2.0.0-RC02" + composeFilePath = "config/combined-worker-kafka-compose.yaml" +// composeFilePath = "config/combined-worker-compose.yaml" // Only need to supply these if you want to use an unpublished version artifactoryUsername = findProperty('cordaArtifactoryUsername') ?: System.getenv('CORDA_ARTIFACTORY_USERNAME') @@ -26,7 +29,7 @@ allprojects { } // Declare the set of Kotlin compiler options we need to build a CorDapp. - tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach { + tasks.withType(KotlinCompile).configureEach { kotlinOptions { allWarningsAsErrors = false diff --git a/config/combined-worker-compose.yaml b/config/combined-worker-compose.yaml index e5fa2b5c..d2b5517e 100644 --- a/config/combined-worker-compose.yaml +++ b/config/combined-worker-compose.yaml @@ -12,7 +12,7 @@ services: - 5432:5432 corda: - image: corda-os-docker.software.r3.com/corda-os-combined-worker:5.2.0.0-beta-1707102610189 + image: corda-os-docker.software.r3.com/corda-os-combined-worker:5.2.0.0-RC02 depends_on: - postgresql command: [ "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005", diff --git a/config/combined-worker-kafka-compose.yaml b/config/combined-worker-kafka-compose.yaml new file mode 100644 index 00000000..5b9c840b --- /dev/null +++ b/config/combined-worker-kafka-compose.yaml @@ -0,0 +1,69 @@ +version: '2' +services: + postgresql: + image: postgres:14.10 + restart: unless-stopped + tty: true + environment: + - POSTGRES_USER=postgres + - POSTGRES_PASSWORD=password + - POSTGRES_DB=cordacluster + ports: + - 5432:5432 + + kafka: + image: confluentinc/cp-kafka:latest + ports: + - 9092:9092 + environment: + KAFKA_NODE_ID: 1 + CLUSTER_ID: ZDFiZmU3ODUyMzRiNGI3NG + KAFKA_PROCESS_ROLES: broker,controller + KAFKA_CONTROLLER_QUORUM_VOTERS: 1@kafka:9093 + KAFKA_LISTENERS: PLAINTEXT://0.0.0.0:9092,DOCKER_INTERNAL://0.0.0.0:29092,CONTROLLER://0.0.0.0:9093 + KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9092,DOCKER_INTERNAL://kafka:29092 + KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,DOCKER_INTERNAL:PLAINTEXT,CONTROLLER:PLAINTEXT + KAFKA_INTER_BROKER_LISTENER_NAME: DOCKER_INTERNAL + KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER + KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 + KAFKA_DEFAULT_REPLICATION_FACTOR: 1 + KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1 + KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1 + KAFKA_AUTO_CREATE_TOPICS_ENABLE: "true" + + kafka-create-topics: + image: openjdk:17-jdk + depends_on: + - kafka + volumes: + - ${CORDA_CLI:-~/.corda/cli}:/opt/corda-cli + working_dir: /opt/corda-cli + command: [ "java", + "-jar", + "corda-cli.jar", + "topic", + "-b=kafka:29092", + "create", + "connect" + ] + + corda: + image: corda-os-docker.software.r3.com/corda-os-combined-worker-kafka:5.2.0.0-RC02 + depends_on: + - postgresql + - kafka + - kafka-create-topics + command: [ "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005", + "-mbus.busType=KAFKA", + "-mbootstrap.servers=kafka:29092", + "-spassphrase=password", + "-ssalt=salt", + "-ddatabase.user=user", + "-ddatabase.pass=password", + "-ddatabase.jdbc.url=jdbc:postgresql://postgresql:5432/cordacluster", + "-ddatabase.jdbc.directory=/opt/jdbc-driver/" + ] + ports: + - 8888:8888 + - 7004:7004 + - 5005:5005 \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 926e6424..c275b81f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,22 +2,17 @@ kotlin.code.style=official # Specify the version of the Corda-API to use. # This needs to match the version supported by the Corda Cluster the CorDapp will run on. -cordaApiVersion=5.1.0.39 +cordaApiVersion=5.2.0.49-RC02 # Specify the version of the notary plugins to use. # Currently packaged as part of corda-runtime-os, so should be set to a corda-runtime-os version. -cordaNotaryPluginsVersion=5.1.0.0 - -# Specify the version of the Combined Worker to use -# Currently packaged as part of corda-runtime-os, so should be set to a corda-runtime-os version. -combinedWorkerJarVersion=5.1.0.0 +cordaNotaryPluginsVersion=5.2.0.0-RC02 # Specify the version of the cordapp-cpb and cordapp-cpk plugins -cordaPluginsVersion=7.0.3 +cordaPluginsVersion=7.0.4 # Specify the version of the CSDE gradle plugin to use -cordaGradlePluginVersion=5.2.0.0-SNAPSHOT -#cordaGradlePluginVersion=5.2.0.0-alpha-1706283415396 +cordaGradlePluginVersion=5.2.0.0-RC02 # Specify the name of the workflows module # This will be the name of the generated cpk and cpb files From 07160052818acc1f5bc245907a99e6e214e6c9ea Mon Sep 17 00:00:00 2001 From: Anton Subbotin Date: Tue, 27 Feb 2024 12:22:20 +0000 Subject: [PATCH 07/12] Fix JDWP config in compose files --- config/combined-worker-compose.yaml | 18 ++++++++++-------- config/combined-worker-kafka-compose.yaml | 20 +++++++++++--------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/config/combined-worker-compose.yaml b/config/combined-worker-compose.yaml index d2b5517e..924e2cd0 100644 --- a/config/combined-worker-compose.yaml +++ b/config/combined-worker-compose.yaml @@ -15,14 +15,16 @@ services: image: corda-os-docker.software.r3.com/corda-os-combined-worker:5.2.0.0-RC02 depends_on: - postgresql - command: [ "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005", - "-mbus.busType=DATABASE", - "-spassphrase=password", - "-ssalt=salt", - "-ddatabase.user=user", - "-ddatabase.pass=password", - "-ddatabase.jdbc.url=jdbc:postgresql://postgresql:5432/cordacluster", - "-ddatabase.jdbc.directory=/opt/jdbc-driver/" + environment: + JAVA_TOOL_OPTIONS: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 + command: [ + "-mbus.busType=DATABASE", + "-spassphrase=password", + "-ssalt=salt", + "-ddatabase.user=user", + "-ddatabase.pass=password", + "-ddatabase.jdbc.url=jdbc:postgresql://postgresql:5432/cordacluster", + "-ddatabase.jdbc.directory=/opt/jdbc-driver/" ] ports: - 8888:8888 diff --git a/config/combined-worker-kafka-compose.yaml b/config/combined-worker-kafka-compose.yaml index 5b9c840b..750b3b4f 100644 --- a/config/combined-worker-kafka-compose.yaml +++ b/config/combined-worker-kafka-compose.yaml @@ -53,15 +53,17 @@ services: - postgresql - kafka - kafka-create-topics - command: [ "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005", - "-mbus.busType=KAFKA", - "-mbootstrap.servers=kafka:29092", - "-spassphrase=password", - "-ssalt=salt", - "-ddatabase.user=user", - "-ddatabase.pass=password", - "-ddatabase.jdbc.url=jdbc:postgresql://postgresql:5432/cordacluster", - "-ddatabase.jdbc.directory=/opt/jdbc-driver/" + environment: + JAVA_TOOL_OPTIONS: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 + command: [ + "-mbus.busType=KAFKA", + "-mbootstrap.servers=kafka:29092", + "-spassphrase=password", + "-ssalt=salt", + "-ddatabase.user=user", + "-ddatabase.pass=password", + "-ddatabase.jdbc.url=jdbc:postgresql://postgresql:5432/cordacluster", + "-ddatabase.jdbc.directory=/opt/jdbc-driver/" ] ports: - 8888:8888 From 9b36681d9217b484a0d274f67fed9881a1add7f2 Mon Sep 17 00:00:00 2001 From: Anton Subbotin Date: Tue, 27 Feb 2024 13:32:53 +0000 Subject: [PATCH 08/12] Get rid of CSDE across the code and docs --- .ci/Jenkinsfile | 3 +- README.md | 32 +++++++++---------- build.gradle | 12 +++++-- .../utxoexample/contracts/ChatContract.kt | 4 +-- .../utxoexample/states/ChatState.kt | 4 +-- .../apples/contracts/ApplesContractTest.kt | 2 +- .../ChatContractCreateCommandTest.kt | 20 +++++------- .../ChatContractUpdateCommandTest.kt | 16 +++++----- gradle.properties | 8 ++--- settings.gradle | 2 +- .../flowexample/workflows/MyFirstFlow.kt | 4 +-- .../workflows/CreateNewChatFlow.kt | 8 ++--- .../workflows/FinalizeChatSubFlow.kt | 4 +-- .../utxoexample/workflows/GetChatFlow.kt | 6 ++-- .../utxoexample/workflows/ListChatsFlow.kt | 6 ++-- .../workflows/ResponderValidations.kt | 4 +-- .../utxoexample/workflows/TestContractFlow.kt | 8 ++--- .../utxoexample/workflows/UpdateChatFlow.kt | 8 ++--- 18 files changed, 76 insertions(+), 75 deletions(-) rename contracts/src/main/kotlin/com/r3/developers/{csdetemplate => cordapptemplate}/utxoexample/contracts/ChatContract.kt (97%) rename contracts/src/main/kotlin/com/r3/developers/{csdetemplate => cordapptemplate}/utxoexample/states/ChatState.kt (90%) rename contracts/src/test/kotlin/com/r3/developers/{csdetemplate => cordapptemplate}/utxoexample/contracts/ChatContractCreateCommandTest.kt (88%) rename contracts/src/test/kotlin/com/r3/developers/{csdetemplate => cordapptemplate}/utxoexample/contracts/ChatContractUpdateCommandTest.kt (91%) rename workflows/src/main/kotlin/com/r3/developers/{csdetemplate => cordapptemplate}/flowexample/workflows/MyFirstFlow.kt (97%) rename workflows/src/main/kotlin/com/r3/developers/{csdetemplate => cordapptemplate}/utxoexample/workflows/CreateNewChatFlow.kt (93%) rename workflows/src/main/kotlin/com/r3/developers/{csdetemplate => cordapptemplate}/utxoexample/workflows/FinalizeChatSubFlow.kt (97%) rename workflows/src/main/kotlin/com/r3/developers/{csdetemplate => cordapptemplate}/utxoexample/workflows/GetChatFlow.kt (96%) rename workflows/src/main/kotlin/com/r3/developers/{csdetemplate => cordapptemplate}/utxoexample/workflows/ListChatsFlow.kt (90%) rename workflows/src/main/kotlin/com/r3/developers/{csdetemplate => cordapptemplate}/utxoexample/workflows/ResponderValidations.kt (88%) rename workflows/src/main/kotlin/com/r3/developers/{csdetemplate => cordapptemplate}/utxoexample/workflows/TestContractFlow.kt (98%) rename workflows/src/main/kotlin/com/r3/developers/{csdetemplate => cordapptemplate}/utxoexample/workflows/UpdateChatFlow.kt (93%) diff --git a/.ci/Jenkinsfile b/.ci/Jenkinsfile index 2c230c11..ef306e71 100644 --- a/.ci/Jenkinsfile +++ b/.ci/Jenkinsfile @@ -1,7 +1,6 @@ -@Library('corda-shared-build-pipeline-steps@5.1') _ +@Library('corda-shared-build-pipeline-steps@5.2') _ cordaPipeline( - nexusAppId: 'com.corda.CSDE-kotlin.5.0', publishRepoPrefix: '', slimBuild: true, runUnitTests: false, diff --git a/README.md b/README.md index 78a6a433..99a990be 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,22 @@ -# CSDE-cordapp-template-kotlin +# release-V5 cordapp-template-kotlin - -To help make the process of prototyping CorDapps on Corda 5 release more straight forward we have developed the Cordapp Standard Development Environment (CSDE). - -The CSDE is obtained by cloning this CSDE-Cordapp-Template-Kotlin repository to your local machine. The CSDE provides: +This template repository provides: - A pre-setup Cordapp Project which you can use as a starting point to develop your own prototypes. - A base Gradle configuration which brings in the dependencies you need to write and test a Corda 5 Cordapp. -- A set of Gradle helper tasks which speed up and simplify the development and deployment process. +- A set of Gradle helper tasks, provided by the [Corda runtime gradle plugin](https://github.com/corda/corda-runtime-os/tree/release/os/5.2/tools/corda-runtime-gradle-plugin#readme), which speed up and simplify the development and deployment process. - Debug configuration for debugging a local Corda cluster. -- The MyFirstFlow code which forms the basis of this getting started documentation, this is located in package com.r3.developers.csdetemplate.flowexample +- The MyFirstFlow code which forms the basis of this getting started documentation, this is located in package com.r3.developers.cordapptemplate.flowexample -- A UTXO example in package com.r3.developers.csdetemplate.utxoexample packages +- A UTXO example in package com.r3.developers.cordapptemplate.utxoexample packages - Ability to configure the Members of the Local Corda Network. -To find out how to use the CSDE, please refer to the *Getting Started Using the CSDE* subsection within the *Developing Applications* section in the latest Corda 5 documentation at https://docs.r3.com/ +To find out how to use the template, please refer to the ** subsection within the *Developing Applications* section in the latest Corda 5 documentation at https://docs.r3.com/ ## Chat app @@ -31,19 +28,22 @@ In this app you can: 3. Individually query out the history of one chat entry. `GetChatFlowArgs` 4. Continue chatting within the chat entry with the counterparty. `UpdateChatFlow` +### Prerequisites +Corda CLI must be installed. It is used by the Corda runtime gradle plugin internally, as well as by the example Docker compose file to create necessary Kafka topics. The version of Corda CLI should match that of Corda combined worker image used in the compose file. + ### Setting up 1. We will begin our test deployment with clicking the `startCorda`. This task will load up the combined Corda workers in docker. - A successful deployment will allow you to open the REST APIs at: https://localhost:8888/api/v1/swagger#. You can test out some of the + A successful deployment will allow you to open the REST APIs at: https://localhost:8888/api/v5_2/swagger#. You can test out some of the functions to check connectivity. (GET /cpi function call should return an empty list as for now.) -2. We will now deploy the cordapp with a click of `5-vNodeSetup` task. Upon successful deployment of the CPI, the GET /cpi function call should now return the meta data of the cpi you just upload +2. We will now deploy the cordapp with a click of `vNodeSetup` task. Upon successful deployment of the CPI, the GET /cpi function call should now return the meta data of the cpi you just upload ### Running the chat app In Corda 5, flows will be triggered via `POST /flow/{holdingidentityshorthash}` and flow result will need to be view at `GET /flow/{holdingidentityshorthash}/{clientrequestid}` -* holdingidentityshorthash: the id of the network participants, ie Bob, Alice, Charlie. You can view all the short hashes of the network member with another gradle task called `ListVNodes` +* holdingidentityshorthash: the id of the network participants, ie Bob, Alice, Charlie. You can view all the short hashes of the network member with another gradle task called `listVNodes` * clientrequestid: the id you specify in the flow requestBody when you trigger a flow. #### Step 1: Create Chat Entry @@ -53,7 +53,7 @@ Go to `POST /flow/{holdingidentityshorthash}`, enter the identity short hash(Ali ``` { "clientRequestId": "create-1", - "flowClassName": "com.r3.developers.csdetemplate.utxoexample.workflows.CreateNewChatFlow", + "flowClassName": "com.r3.developers.cordapptemplate.utxoexample.workflows.CreateNewChatFlow", "requestBody": { "chatName":"Chat with Bob", "otherMember":"CN=Bob, OU=Test Dept, O=R3, L=London, C=GB", @@ -70,7 +70,7 @@ Go to `POST /flow/{holdingidentityshorthash}`, enter the identity short hash(Ali ``` { "clientRequestId": "list-1", - "flowClassName": "com.r3.developers.csdetemplate.utxoexample.workflows.ListChatsFlow", + "flowClassName": "com.r3.developers.cordapptemplate.utxoexample.workflows.ListChatsFlow", "requestBody": {} } ``` @@ -85,7 +85,7 @@ this message will be recorded as a message from Alice, vice versa. And the id fi ``` { "clientRequestId": "update-1", - "flowClassName": "com.r3.developers.csdetemplate.utxoexample.workflows.UpdateChatFlow", + "flowClassName": "com.r3.developers.cordapptemplate.utxoexample.workflows.UpdateChatFlow", "requestBody": { "id":" ** fill in id **", "message": "How are you today?" @@ -100,7 +100,7 @@ After a few back and forth of the messaging, you can view entire chat history by ``` { "clientRequestId": "get-1", - "flowClassName": "com.r3.developers.csdetemplate.utxoexample.workflows.GetChatFlow", + "flowClassName": "com.r3.developers.cordapptemplate.utxoexample.workflows.GetChatFlow", "requestBody": { "id":" ** fill in id **", "numberOfRecords":"4" diff --git a/build.gradle b/build.gradle index da811338..3467d9ba 100644 --- a/build.gradle +++ b/build.gradle @@ -12,7 +12,7 @@ plugins { } allprojects { - group 'com.r3.developers.csdetemplate' + group 'com.r3.developers.cordapptemplate' version '1.0-SNAPSHOT' def javaVersion = VERSION_17 @@ -20,8 +20,14 @@ allprojects { // New Corda gradle plugin cordaRuntimeGradlePlugin { notaryVersion = "5.2.0.0-RC02" + + // Use compose file to start the Combined Worker with Postgres and Kafka + // Note: To ensure that the Combined Worker starts correctly, Corda CLI needs to be used to create necessary topics. + // Corda CLI version should be aligned with the Combined Worker version composeFilePath = "config/combined-worker-kafka-compose.yaml" -// composeFilePath = "config/combined-worker-compose.yaml" + + // Alternatively, you can use a Database-only combined worker: + // composeFilePath = "config/combined-worker-compose.yaml" // Only need to supply these if you want to use an unpublished version artifactoryUsername = findProperty('cordaArtifactoryUsername') ?: System.getenv('CORDA_ARTIFACTORY_USERNAME') @@ -100,7 +106,7 @@ allprojects { publishing { publications { maven(MavenPublication) { - artifactId "corda-CSDE-kotlin-sample" + artifactId "corda-dev-template-kotlin-sample" groupId project.group artifact jar } diff --git a/contracts/src/main/kotlin/com/r3/developers/csdetemplate/utxoexample/contracts/ChatContract.kt b/contracts/src/main/kotlin/com/r3/developers/cordapptemplate/utxoexample/contracts/ChatContract.kt similarity index 97% rename from contracts/src/main/kotlin/com/r3/developers/csdetemplate/utxoexample/contracts/ChatContract.kt rename to contracts/src/main/kotlin/com/r3/developers/cordapptemplate/utxoexample/contracts/ChatContract.kt index d61471b3..371c979c 100644 --- a/contracts/src/main/kotlin/com/r3/developers/csdetemplate/utxoexample/contracts/ChatContract.kt +++ b/contracts/src/main/kotlin/com/r3/developers/cordapptemplate/utxoexample/contracts/ChatContract.kt @@ -1,6 +1,6 @@ -package com.r3.developers.csdetemplate.utxoexample.contracts +package com.r3.developers.cordapptemplate.utxoexample.contracts -import com.r3.developers.csdetemplate.utxoexample.states.ChatState +import com.r3.developers.cordapptemplate.utxoexample.states.ChatState import net.corda.v5.base.exceptions.CordaRuntimeException import net.corda.v5.ledger.utxo.Command import net.corda.v5.ledger.utxo.Contract diff --git a/contracts/src/main/kotlin/com/r3/developers/csdetemplate/utxoexample/states/ChatState.kt b/contracts/src/main/kotlin/com/r3/developers/cordapptemplate/utxoexample/states/ChatState.kt similarity index 90% rename from contracts/src/main/kotlin/com/r3/developers/csdetemplate/utxoexample/states/ChatState.kt rename to contracts/src/main/kotlin/com/r3/developers/cordapptemplate/utxoexample/states/ChatState.kt index 2fc17c9c..b7a16a8a 100644 --- a/contracts/src/main/kotlin/com/r3/developers/csdetemplate/utxoexample/states/ChatState.kt +++ b/contracts/src/main/kotlin/com/r3/developers/cordapptemplate/utxoexample/states/ChatState.kt @@ -1,6 +1,6 @@ -package com.r3.developers.csdetemplate.utxoexample.states +package com.r3.developers.cordapptemplate.utxoexample.states -import com.r3.developers.csdetemplate.utxoexample.contracts.ChatContract +import com.r3.developers.cordapptemplate.utxoexample.contracts.ChatContract import net.corda.v5.base.types.MemberX500Name import net.corda.v5.ledger.utxo.BelongsToContract import net.corda.v5.ledger.utxo.ContractState diff --git a/contracts/src/test/kotlin/com/r3/developers/apples/contracts/ApplesContractTest.kt b/contracts/src/test/kotlin/com/r3/developers/apples/contracts/ApplesContractTest.kt index d926d091..f79ce593 100644 --- a/contracts/src/test/kotlin/com/r3/developers/apples/contracts/ApplesContractTest.kt +++ b/contracts/src/test/kotlin/com/r3/developers/apples/contracts/ApplesContractTest.kt @@ -9,7 +9,7 @@ import java.security.PublicKey import java.util.UUID /** - * The following is the base implementation of the Contract Tests for the Apples CSDE-template-tutorial. + * The following is the base implementation of the Contract Tests for the Apples CorDapp template tutorial. * * - The AppleContractTest abstract class implements the ContractTest class. * - For full contract test coverage, we generally create a class for every command scenario for every state. diff --git a/contracts/src/test/kotlin/com/r3/developers/csdetemplate/utxoexample/contracts/ChatContractCreateCommandTest.kt b/contracts/src/test/kotlin/com/r3/developers/cordapptemplate/utxoexample/contracts/ChatContractCreateCommandTest.kt similarity index 88% rename from contracts/src/test/kotlin/com/r3/developers/csdetemplate/utxoexample/contracts/ChatContractCreateCommandTest.kt rename to contracts/src/test/kotlin/com/r3/developers/cordapptemplate/utxoexample/contracts/ChatContractCreateCommandTest.kt index 668de026..e662f55d 100644 --- a/contracts/src/test/kotlin/com/r3/developers/csdetemplate/utxoexample/contracts/ChatContractCreateCommandTest.kt +++ b/contracts/src/test/kotlin/com/r3/developers/cordapptemplate/utxoexample/contracts/ChatContractCreateCommandTest.kt @@ -1,19 +1,15 @@ -package com.r3.developers.csdetemplate.utxoexample.contracts +package com.r3.developers.cordapptemplate.utxoexample.contracts import com.r3.corda.ledger.utxo.testing.ContractTest import com.r3.corda.ledger.utxo.testing.buildTransaction -import com.r3.developers.csdetemplate.utxoexample.contracts.ChatContract.Companion.CREATE_COMMAND_SHOULD_HAVE_NO_INPUT_STATES -import com.r3.developers.csdetemplate.utxoexample.contracts.ChatContract.Companion.CREATE_COMMAND_SHOULD_HAVE_ONLY_ONE_OUTPUT_STATE -import com.r3.developers.csdetemplate.utxoexample.contracts.ChatContract.Companion.OUTPUT_STATE_SHOULD_ONLY_HAVE_TWO_PARTICIPANTS -import com.r3.developers.csdetemplate.utxoexample.contracts.ChatContract.Companion.REQUIRE_SINGLE_COMMAND -import com.r3.developers.csdetemplate.utxoexample.contracts.ChatContract.Companion.TRANSACTION_SHOULD_BE_SIGNED_BY_ALL_PARTICIPANTS -import com.r3.developers.csdetemplate.utxoexample.contracts.ChatContract.Companion.UNKNOWN_COMMAND -import com.r3.developers.csdetemplate.utxoexample.contracts.ChatContract.Create -import com.r3.developers.csdetemplate.utxoexample.states.ChatState -import net.corda.v5.crypto.SecureHash +import com.r3.developers.cordapptemplate.utxoexample.contracts.ChatContract.Companion.CREATE_COMMAND_SHOULD_HAVE_NO_INPUT_STATES +import com.r3.developers.cordapptemplate.utxoexample.contracts.ChatContract.Companion.CREATE_COMMAND_SHOULD_HAVE_ONLY_ONE_OUTPUT_STATE +import com.r3.developers.cordapptemplate.utxoexample.contracts.ChatContract.Companion.OUTPUT_STATE_SHOULD_ONLY_HAVE_TWO_PARTICIPANTS +import com.r3.developers.cordapptemplate.utxoexample.contracts.ChatContract.Companion.REQUIRE_SINGLE_COMMAND +import com.r3.developers.cordapptemplate.utxoexample.contracts.ChatContract.Companion.TRANSACTION_SHOULD_BE_SIGNED_BY_ALL_PARTICIPANTS +import com.r3.developers.cordapptemplate.utxoexample.contracts.ChatContract.Companion.UNKNOWN_COMMAND +import com.r3.developers.cordapptemplate.utxoexample.states.ChatState import net.corda.v5.ledger.utxo.Command -import org.junit.jupiter.api.Assertions.assertThrows -import org.junit.jupiter.api.Assertions.assertTrue import org.junit.jupiter.api.Test import java.util.* diff --git a/contracts/src/test/kotlin/com/r3/developers/csdetemplate/utxoexample/contracts/ChatContractUpdateCommandTest.kt b/contracts/src/test/kotlin/com/r3/developers/cordapptemplate/utxoexample/contracts/ChatContractUpdateCommandTest.kt similarity index 91% rename from contracts/src/test/kotlin/com/r3/developers/csdetemplate/utxoexample/contracts/ChatContractUpdateCommandTest.kt rename to contracts/src/test/kotlin/com/r3/developers/cordapptemplate/utxoexample/contracts/ChatContractUpdateCommandTest.kt index 62039b74..e47d76c2 100644 --- a/contracts/src/test/kotlin/com/r3/developers/csdetemplate/utxoexample/contracts/ChatContractUpdateCommandTest.kt +++ b/contracts/src/test/kotlin/com/r3/developers/cordapptemplate/utxoexample/contracts/ChatContractUpdateCommandTest.kt @@ -1,14 +1,14 @@ -package com.r3.developers.csdetemplate.utxoexample.contracts +package com.r3.developers.cordapptemplate.utxoexample.contracts import com.r3.corda.ledger.utxo.testing.ContractTest import com.r3.corda.ledger.utxo.testing.buildTransaction -import com.r3.developers.csdetemplate.utxoexample.contracts.ChatContract.Companion.TRANSACTION_SHOULD_BE_SIGNED_BY_ALL_PARTICIPANTS -import com.r3.developers.csdetemplate.utxoexample.contracts.ChatContract.Companion.UPDATE_COMMAND_CHATNAME_SHOULD_NOT_CHANGE -import com.r3.developers.csdetemplate.utxoexample.contracts.ChatContract.Companion.UPDATE_COMMAND_ID_SHOULD_NOT_CHANGE -import com.r3.developers.csdetemplate.utxoexample.contracts.ChatContract.Companion.UPDATE_COMMAND_PARTICIPANTS_SHOULD_NOT_CHANGE -import com.r3.developers.csdetemplate.utxoexample.contracts.ChatContract.Companion.UPDATE_COMMAND_SHOULD_HAVE_ONLY_ONE_INPUT_STATE -import com.r3.developers.csdetemplate.utxoexample.contracts.ChatContract.Companion.UPDATE_COMMAND_SHOULD_HAVE_ONLY_ONE_OUTPUT_STATE -import com.r3.developers.csdetemplate.utxoexample.states.ChatState +import com.r3.developers.cordapptemplate.utxoexample.contracts.ChatContract.Companion.TRANSACTION_SHOULD_BE_SIGNED_BY_ALL_PARTICIPANTS +import com.r3.developers.cordapptemplate.utxoexample.contracts.ChatContract.Companion.UPDATE_COMMAND_CHATNAME_SHOULD_NOT_CHANGE +import com.r3.developers.cordapptemplate.utxoexample.contracts.ChatContract.Companion.UPDATE_COMMAND_ID_SHOULD_NOT_CHANGE +import com.r3.developers.cordapptemplate.utxoexample.contracts.ChatContract.Companion.UPDATE_COMMAND_PARTICIPANTS_SHOULD_NOT_CHANGE +import com.r3.developers.cordapptemplate.utxoexample.contracts.ChatContract.Companion.UPDATE_COMMAND_SHOULD_HAVE_ONLY_ONE_INPUT_STATE +import com.r3.developers.cordapptemplate.utxoexample.contracts.ChatContract.Companion.UPDATE_COMMAND_SHOULD_HAVE_ONLY_ONE_OUTPUT_STATE +import com.r3.developers.cordapptemplate.utxoexample.states.ChatState import net.corda.v5.ledger.utxo.StateAndRef import org.junit.jupiter.api.Test import java.util.* diff --git a/gradle.properties b/gradle.properties index c275b81f..3259bf9a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -11,7 +11,7 @@ cordaNotaryPluginsVersion=5.2.0.0-RC02 # Specify the version of the cordapp-cpb and cordapp-cpk plugins cordaPluginsVersion=7.0.4 -# Specify the version of the CSDE gradle plugin to use +# Specify the version of the Corda runtime Gradle plugin to use cordaGradlePluginVersion=5.2.0.0-RC02 # Specify the name of the workflows module @@ -67,9 +67,9 @@ processorTimeout=-1 # Value is in milliseconds vnodeRegistrationTimeoutDefault=30000 -# Specify if you want to run the contracts and workflows tests as part of the CSDE-cordapp > 3-buildCpis task -# False by default, will execute the tests every time you stand the CSDE up - gives extra protection -# Set to true to skip the tests, making the CSDE launching process quicker. You will be responsible for running workflow tests yourself +# Specify if you want to run the contracts and workflows tests as part of the corda-runtime-plugin-cordapp > buildCpis task +# False by default, will execute the tests every time you stand the template up - gives extra protection +# Set to true to skip the tests, making the launching process quicker. You will be responsible for running workflow tests yourself skipTestsDuringBuildCpis=false # R3 internal repository diff --git a/settings.gradle b/settings.gradle index a822c8e0..e2445064 100644 --- a/settings.gradle +++ b/settings.gradle @@ -30,7 +30,7 @@ pluginManagement { } // Root project name, used in naming the project as a whole and used in naming objects built by the project. -rootProject.name = 'csde-cordapp-template-kotlin' +rootProject.name = 'cordapp-template-kotlin' include ':workflows' include ':contracts' diff --git a/workflows/src/main/kotlin/com/r3/developers/csdetemplate/flowexample/workflows/MyFirstFlow.kt b/workflows/src/main/kotlin/com/r3/developers/cordapptemplate/flowexample/workflows/MyFirstFlow.kt similarity index 97% rename from workflows/src/main/kotlin/com/r3/developers/csdetemplate/flowexample/workflows/MyFirstFlow.kt rename to workflows/src/main/kotlin/com/r3/developers/cordapptemplate/flowexample/workflows/MyFirstFlow.kt index ed70228b..47e46d3d 100644 --- a/workflows/src/main/kotlin/com/r3/developers/csdetemplate/flowexample/workflows/MyFirstFlow.kt +++ b/workflows/src/main/kotlin/com/r3/developers/cordapptemplate/flowexample/workflows/MyFirstFlow.kt @@ -1,4 +1,4 @@ -package com.r3.developers.csdetemplate.flowexample.workflows +package com.r3.developers.cordapptemplate.flowexample.workflows import net.corda.v5.application.flows.* import net.corda.v5.application.marshalling.JsonMarshallingService @@ -146,7 +146,7 @@ class MyFirstFlowResponder: ResponderFlow { RequestBody for triggering the flow via REST: { "clientRequestId": "r1", - "flowClassName": "com.r3.developers.csdetemplate.flowexample.workflows.MyFirstFlow", + "flowClassName": "com.r3.developers.cordapptemplate.flowexample.workflows.MyFirstFlow", "requestBody": { "otherMember":"CN=Bob, OU=Test Dept, O=R3, L=London, C=GB" } diff --git a/workflows/src/main/kotlin/com/r3/developers/csdetemplate/utxoexample/workflows/CreateNewChatFlow.kt b/workflows/src/main/kotlin/com/r3/developers/cordapptemplate/utxoexample/workflows/CreateNewChatFlow.kt similarity index 93% rename from workflows/src/main/kotlin/com/r3/developers/csdetemplate/utxoexample/workflows/CreateNewChatFlow.kt rename to workflows/src/main/kotlin/com/r3/developers/cordapptemplate/utxoexample/workflows/CreateNewChatFlow.kt index dc0ffe9d..9bc75584 100644 --- a/workflows/src/main/kotlin/com/r3/developers/csdetemplate/utxoexample/workflows/CreateNewChatFlow.kt +++ b/workflows/src/main/kotlin/com/r3/developers/cordapptemplate/utxoexample/workflows/CreateNewChatFlow.kt @@ -1,7 +1,7 @@ -package com.r3.developers.csdetemplate.utxoexample.workflows +package com.r3.developers.cordapptemplate.utxoexample.workflows -import com.r3.developers.csdetemplate.utxoexample.contracts.ChatContract -import com.r3.developers.csdetemplate.utxoexample.states.ChatState +import com.r3.developers.cordapptemplate.utxoexample.contracts.ChatContract +import com.r3.developers.cordapptemplate.utxoexample.states.ChatState import net.corda.v5.application.flows.* import net.corda.v5.application.marshalling.JsonMarshallingService import net.corda.v5.application.membership.MemberLookup @@ -102,7 +102,7 @@ class CreateNewChatFlow: ClientStartableFlow { RequestBody for triggering the flow via REST: { "clientRequestId": "create-1", - "flowClassName": "com.r3.developers.csdetemplate.utxoexample.workflows.CreateNewChatFlow", + "flowClassName": "com.r3.developers.cordapptemplate.utxoexample.workflows.CreateNewChatFlow", "requestBody": { "chatName":"Chat with Bob", "otherMember":"CN=Bob, OU=Test Dept, O=R3, L=London, C=GB", diff --git a/workflows/src/main/kotlin/com/r3/developers/csdetemplate/utxoexample/workflows/FinalizeChatSubFlow.kt b/workflows/src/main/kotlin/com/r3/developers/cordapptemplate/utxoexample/workflows/FinalizeChatSubFlow.kt similarity index 97% rename from workflows/src/main/kotlin/com/r3/developers/csdetemplate/utxoexample/workflows/FinalizeChatSubFlow.kt rename to workflows/src/main/kotlin/com/r3/developers/cordapptemplate/utxoexample/workflows/FinalizeChatSubFlow.kt index f195e1b1..bedd4309 100644 --- a/workflows/src/main/kotlin/com/r3/developers/csdetemplate/utxoexample/workflows/FinalizeChatSubFlow.kt +++ b/workflows/src/main/kotlin/com/r3/developers/cordapptemplate/utxoexample/workflows/FinalizeChatSubFlow.kt @@ -1,6 +1,6 @@ -package com.r3.developers.csdetemplate.utxoexample.workflows +package com.r3.developers.cordapptemplate.utxoexample.workflows -import com.r3.developers.csdetemplate.utxoexample.states.ChatState +import com.r3.developers.cordapptemplate.utxoexample.states.ChatState import net.corda.v5.application.flows.* import net.corda.v5.application.messaging.FlowMessaging import net.corda.v5.application.messaging.FlowSession diff --git a/workflows/src/main/kotlin/com/r3/developers/csdetemplate/utxoexample/workflows/GetChatFlow.kt b/workflows/src/main/kotlin/com/r3/developers/cordapptemplate/utxoexample/workflows/GetChatFlow.kt similarity index 96% rename from workflows/src/main/kotlin/com/r3/developers/csdetemplate/utxoexample/workflows/GetChatFlow.kt rename to workflows/src/main/kotlin/com/r3/developers/cordapptemplate/utxoexample/workflows/GetChatFlow.kt index d79e3513..e62bb801 100644 --- a/workflows/src/main/kotlin/com/r3/developers/csdetemplate/utxoexample/workflows/GetChatFlow.kt +++ b/workflows/src/main/kotlin/com/r3/developers/cordapptemplate/utxoexample/workflows/GetChatFlow.kt @@ -1,6 +1,6 @@ -package com.r3.developers.csdetemplate.utxoexample.workflows +package com.r3.developers.cordapptemplate.utxoexample.workflows -import com.r3.developers.csdetemplate.utxoexample.states.ChatState +import com.r3.developers.cordapptemplate.utxoexample.states.ChatState import net.corda.v5.application.flows.ClientRequestBody import net.corda.v5.application.flows.ClientStartableFlow import net.corda.v5.application.flows.CordaInject @@ -107,7 +107,7 @@ class GetChatFlow: ClientStartableFlow { RequestBody for triggering the flow via REST: { "clientRequestId": "get-1", - "flowClassName": "com.r3.developers.csdetemplate.utxoexample.workflows.GetChatFlow", + "flowClassName": "com.r3.developers.cordapptemplate.utxoexample.workflows.GetChatFlow", "requestBody": { "id":"** fill in id **", "numberOfRecords":"4" diff --git a/workflows/src/main/kotlin/com/r3/developers/csdetemplate/utxoexample/workflows/ListChatsFlow.kt b/workflows/src/main/kotlin/com/r3/developers/cordapptemplate/utxoexample/workflows/ListChatsFlow.kt similarity index 90% rename from workflows/src/main/kotlin/com/r3/developers/csdetemplate/utxoexample/workflows/ListChatsFlow.kt rename to workflows/src/main/kotlin/com/r3/developers/cordapptemplate/utxoexample/workflows/ListChatsFlow.kt index 6a211b42..daef20a5 100644 --- a/workflows/src/main/kotlin/com/r3/developers/csdetemplate/utxoexample/workflows/ListChatsFlow.kt +++ b/workflows/src/main/kotlin/com/r3/developers/cordapptemplate/utxoexample/workflows/ListChatsFlow.kt @@ -1,6 +1,6 @@ -package com.r3.developers.csdetemplate.utxoexample.workflows +package com.r3.developers.cordapptemplate.utxoexample.workflows -import com.r3.developers.csdetemplate.utxoexample.states.ChatState +import com.r3.developers.cordapptemplate.utxoexample.states.ChatState import net.corda.v5.application.flows.ClientRequestBody import net.corda.v5.application.flows.ClientStartableFlow import net.corda.v5.application.flows.CordaInject @@ -55,7 +55,7 @@ class ListChatsFlow : ClientStartableFlow { RequestBody for triggering the flow via REST: { "clientRequestId": "list-1", - "flowClassName": "com.r3.developers.csdetemplate.utxoexample.workflows.ListChatsFlow", + "flowClassName": "com.r3.developers.cordapptemplate.utxoexample.workflows.ListChatsFlow", "requestBody": {} } */ diff --git a/workflows/src/main/kotlin/com/r3/developers/csdetemplate/utxoexample/workflows/ResponderValidations.kt b/workflows/src/main/kotlin/com/r3/developers/cordapptemplate/utxoexample/workflows/ResponderValidations.kt similarity index 88% rename from workflows/src/main/kotlin/com/r3/developers/csdetemplate/utxoexample/workflows/ResponderValidations.kt rename to workflows/src/main/kotlin/com/r3/developers/cordapptemplate/utxoexample/workflows/ResponderValidations.kt index b7847881..82770b92 100644 --- a/workflows/src/main/kotlin/com/r3/developers/csdetemplate/utxoexample/workflows/ResponderValidations.kt +++ b/workflows/src/main/kotlin/com/r3/developers/cordapptemplate/utxoexample/workflows/ResponderValidations.kt @@ -1,6 +1,6 @@ -package com.r3.developers.csdetemplate.utxoexample.workflows +package com.r3.developers.cordapptemplate.utxoexample.workflows -import com.r3.developers.csdetemplate.utxoexample.states.ChatState +import com.r3.developers.cordapptemplate.utxoexample.states.ChatState import net.corda.v5.base.annotations.Suspendable import net.corda.v5.base.exceptions.CordaRuntimeException import net.corda.v5.base.types.MemberX500Name diff --git a/workflows/src/main/kotlin/com/r3/developers/csdetemplate/utxoexample/workflows/TestContractFlow.kt b/workflows/src/main/kotlin/com/r3/developers/cordapptemplate/utxoexample/workflows/TestContractFlow.kt similarity index 98% rename from workflows/src/main/kotlin/com/r3/developers/csdetemplate/utxoexample/workflows/TestContractFlow.kt rename to workflows/src/main/kotlin/com/r3/developers/cordapptemplate/utxoexample/workflows/TestContractFlow.kt index a560e172..8f5f86dc 100644 --- a/workflows/src/main/kotlin/com/r3/developers/csdetemplate/utxoexample/workflows/TestContractFlow.kt +++ b/workflows/src/main/kotlin/com/r3/developers/cordapptemplate/utxoexample/workflows/TestContractFlow.kt @@ -1,7 +1,7 @@ -package com.r3.developers.csdetemplate.utxoexample.workflows +package com.r3.developers.cordapptemplate.utxoexample.workflows -import com.r3.developers.csdetemplate.utxoexample.contracts.ChatContract -import com.r3.developers.csdetemplate.utxoexample.states.ChatState +import com.r3.developers.cordapptemplate.utxoexample.contracts.ChatContract +import com.r3.developers.cordapptemplate.utxoexample.states.ChatState import net.corda.v5.application.flows.* import net.corda.v5.application.marshalling.JsonMarshallingService import net.corda.v5.application.membership.MemberLookup @@ -483,7 +483,7 @@ class TestContractFlow: ClientStartableFlow { /* { "clientRequestId": "dummy-1", - "flowClassName": "com.r3.developers.csdetemplate.utxoexample.workflows.TestContractFlow", + "flowClassName": "com.r3.developers.cordapptemplate.utxoexample.workflows.TestContractFlow", "requestBody": { "otherMember":"CN=Bob, OU=Test Dept, O=R3, L=London, C=GB" } diff --git a/workflows/src/main/kotlin/com/r3/developers/csdetemplate/utxoexample/workflows/UpdateChatFlow.kt b/workflows/src/main/kotlin/com/r3/developers/cordapptemplate/utxoexample/workflows/UpdateChatFlow.kt similarity index 93% rename from workflows/src/main/kotlin/com/r3/developers/csdetemplate/utxoexample/workflows/UpdateChatFlow.kt rename to workflows/src/main/kotlin/com/r3/developers/cordapptemplate/utxoexample/workflows/UpdateChatFlow.kt index f67e6a62..58febfe4 100644 --- a/workflows/src/main/kotlin/com/r3/developers/csdetemplate/utxoexample/workflows/UpdateChatFlow.kt +++ b/workflows/src/main/kotlin/com/r3/developers/cordapptemplate/utxoexample/workflows/UpdateChatFlow.kt @@ -1,7 +1,7 @@ -package com.r3.developers.csdetemplate.utxoexample.workflows +package com.r3.developers.cordapptemplate.utxoexample.workflows -import com.r3.developers.csdetemplate.utxoexample.contracts.ChatContract -import com.r3.developers.csdetemplate.utxoexample.states.ChatState +import com.r3.developers.cordapptemplate.utxoexample.contracts.ChatContract +import com.r3.developers.cordapptemplate.utxoexample.states.ChatState import net.corda.v5.application.flows.* import net.corda.v5.application.marshalling.JsonMarshallingService import net.corda.v5.application.membership.MemberLookup @@ -100,7 +100,7 @@ class UpdateChatFlow: ClientStartableFlow { RequestBody for triggering the flow via REST: { "clientRequestId": "update-2", - "flowClassName": "com.r3.developers.csdetemplate.utxoexample.workflows.UpdateChatFlow", + "flowClassName": "com.r3.developers.cordapptemplate.utxoexample.workflows.UpdateChatFlow", "requestBody": { "id":"** fill in id **", "message": "How are you today?" From 909a209ec1ac75f36a4a794d4518045e3f890440 Mon Sep 17 00:00:00 2001 From: Anton Subbotin Date: Tue, 27 Feb 2024 15:50:18 +0000 Subject: [PATCH 09/12] Add more plugin config properties --- build.gradle | 52 ++++++++++++++--------- config/combined-worker-kafka-compose.yaml | 15 ++++--- 2 files changed, 39 insertions(+), 28 deletions(-) diff --git a/build.gradle b/build.gradle index 3467d9ba..dba12373 100644 --- a/build.gradle +++ b/build.gradle @@ -17,17 +17,27 @@ allprojects { def javaVersion = VERSION_17 - // New Corda gradle plugin + // Configure Corda runtime gradle plugin cordaRuntimeGradlePlugin { - notaryVersion = "5.2.0.0-RC02" - - // Use compose file to start the Combined Worker with Postgres and Kafka - // Note: To ensure that the Combined Worker starts correctly, Corda CLI needs to be used to create necessary topics. - // Corda CLI version should be aligned with the Combined Worker version + cordaClusterURL = "https://localhost:8888" + cordaRestUser = "admin" + cordaRestPasswd ="admin" + cordaRuntimePluginWorkspaceDir = "workspace" composeFilePath = "config/combined-worker-kafka-compose.yaml" - // Alternatively, you can use a Database-only combined worker: // composeFilePath = "config/combined-worker-compose.yaml" + composeNetworkName = "corda-cluster" + notaryVersion = cordaNotaryPluginsVersion + cordaBinDir = "${System.getProperty("user.home")}/.corda/corda5" + cordaCliBinDir = "${System.getProperty("user.home")}/.corda/cli" + corDappCpiName = "MyCorDapp" + notaryCpiName = "NotaryServer" + networkConfigFile = "config/static-network-config.json" + r3RootCertFile = "config/r3-ca-key.pem" + workflowsModuleName = "workflows" + cpiUploadTimeout = "10000" + vnodeRegistrationTimeout = "30000" + cordaProcessorTimeout = "-1" // Only need to supply these if you want to use an unpublished version artifactoryUsername = findProperty('cordaArtifactoryUsername') ?: System.getenv('CORDA_ARTIFACTORY_USERNAME') @@ -81,20 +91,20 @@ allprojects { password = findProperty('cordaArtifactoryPassword') ?: System.getenv('CORDA_ARTIFACTORY_PASSWORD') } } - maven { - // Quasar & Antlr - url = "$artifactoryContextUrl/corda-dependencies-dev" - authentication { - basic(BasicAuthentication) - } - credentials { - username = findProperty('cordaArtifactoryUsername') ?: System.getenv('CORDA_ARTIFACTORY_USERNAME') - password = findProperty('cordaArtifactoryPassword') ?: System.getenv('CORDA_ARTIFACTORY_PASSWORD') - } - mavenContent { - snapshotsOnly() - } - } +// maven { +// Quasar & Antlr +// url = "$artifactoryContextUrl/corda-dependencies-dev" +// authentication { +// basic(BasicAuthentication) +// } +// credentials { +// username = findProperty('cordaArtifactoryUsername') ?: System.getenv('CORDA_ARTIFACTORY_USERNAME') +// password = findProperty('cordaArtifactoryPassword') ?: System.getenv('CORDA_ARTIFACTORY_PASSWORD') +// } +// mavenContent { +// snapshotsOnly() +// } +// } } tasks.withType(Test).configureEach { diff --git a/config/combined-worker-kafka-compose.yaml b/config/combined-worker-kafka-compose.yaml index 750b3b4f..ce092803 100644 --- a/config/combined-worker-kafka-compose.yaml +++ b/config/combined-worker-kafka-compose.yaml @@ -38,13 +38,14 @@ services: volumes: - ${CORDA_CLI:-~/.corda/cli}:/opt/corda-cli working_dir: /opt/corda-cli - command: [ "java", - "-jar", - "corda-cli.jar", - "topic", - "-b=kafka:29092", - "create", - "connect" + command: [ + "java", + "-jar", + "corda-cli.jar", + "topic", + "-b=kafka:29092", + "create", + "connect" ] corda: From 6b91e3c6da34059cb467a33e5ade929107971c61 Mon Sep 17 00:00:00 2001 From: Anton Subbotin Date: Tue, 27 Feb 2024 16:27:22 +0000 Subject: [PATCH 10/12] Remove commented code, add prerequisites in readme --- README.md | 3 ++- build.gradle | 14 -------------- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 99a990be..5bc6a5db 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,8 @@ In this app you can: 4. Continue chatting within the chat entry with the counterparty. `UpdateChatFlow` ### Prerequisites -Corda CLI must be installed. It is used by the Corda runtime gradle plugin internally, as well as by the example Docker compose file to create necessary Kafka topics. The version of Corda CLI should match that of Corda combined worker image used in the compose file. +- Corda CLI; version should matching that of the Corda combined worker image used +- Docker ### Setting up diff --git a/build.gradle b/build.gradle index dba12373..cd126afa 100644 --- a/build.gradle +++ b/build.gradle @@ -91,20 +91,6 @@ allprojects { password = findProperty('cordaArtifactoryPassword') ?: System.getenv('CORDA_ARTIFACTORY_PASSWORD') } } -// maven { -// Quasar & Antlr -// url = "$artifactoryContextUrl/corda-dependencies-dev" -// authentication { -// basic(BasicAuthentication) -// } -// credentials { -// username = findProperty('cordaArtifactoryUsername') ?: System.getenv('CORDA_ARTIFACTORY_USERNAME') -// password = findProperty('cordaArtifactoryPassword') ?: System.getenv('CORDA_ARTIFACTORY_PASSWORD') -// } -// mavenContent { -// snapshotsOnly() -// } -// } } tasks.withType(Test).configureEach { From 55ecbbd73a0cba7b3ff806c537c36858a7bd60cd Mon Sep 17 00:00:00 2001 From: Anton Subbotin Date: Tue, 27 Feb 2024 16:34:59 +0000 Subject: [PATCH 11/12] Restructure config properties --- build.gradle | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/build.gradle b/build.gradle index cd126afa..fa375d3e 100644 --- a/build.gradle +++ b/build.gradle @@ -19,25 +19,26 @@ allprojects { // Configure Corda runtime gradle plugin cordaRuntimeGradlePlugin { + notaryVersion = cordaNotaryPluginsVersion + notaryCpiName = "NotaryServer" + corDappCpiName = "MyCorDapp" + cpiUploadTimeout = "30000" + vnodeRegistrationTimeout = "60000" + cordaProcessorTimeout = "300000" + workflowsModuleName = "workflows" cordaClusterURL = "https://localhost:8888" cordaRestUser = "admin" cordaRestPasswd ="admin" - cordaRuntimePluginWorkspaceDir = "workspace" composeFilePath = "config/combined-worker-kafka-compose.yaml" - // Alternatively, you can use a Database-only combined worker: - // composeFilePath = "config/combined-worker-compose.yaml" - composeNetworkName = "corda-cluster" - notaryVersion = cordaNotaryPluginsVersion - cordaBinDir = "${System.getProperty("user.home")}/.corda/corda5" - cordaCliBinDir = "${System.getProperty("user.home")}/.corda/cli" - corDappCpiName = "MyCorDapp" - notaryCpiName = "NotaryServer" networkConfigFile = "config/static-network-config.json" r3RootCertFile = "config/r3-ca-key.pem" - workflowsModuleName = "workflows" - cpiUploadTimeout = "10000" - vnodeRegistrationTimeout = "30000" - cordaProcessorTimeout = "-1" + skipTestsDuringBuildCpis = "false" + cordaRuntimePluginWorkspaceDir = "workspace" + cordaBinDir = "${System.getProperty("user.home")}/.corda/corda5" + cordaCliBinDir = "${System.getProperty("user.home")}/.corda/cli" + + // Alternatively, you can use a Database-only combined worker: + // composeFilePath = "config/combined-worker-compose.yaml" // Only need to supply these if you want to use an unpublished version artifactoryUsername = findProperty('cordaArtifactoryUsername') ?: System.getenv('CORDA_ARTIFACTORY_USERNAME') From c861d12c758dc38d34af6fee3c76bc72e69fc963 Mon Sep 17 00:00:00 2001 From: Anton Subbotin Date: Wed, 28 Feb 2024 08:11:59 +0000 Subject: [PATCH 12/12] Use only kafka compose file --- README.md | 2 +- build.gradle | 5 +- config/combined-worker-compose.yaml | 44 +++++++++++++- config/combined-worker-kafka-compose.yaml | 72 ----------------------- 4 files changed, 44 insertions(+), 79 deletions(-) delete mode 100644 config/combined-worker-kafka-compose.yaml diff --git a/README.md b/README.md index 5bc6a5db..4aa738a4 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ In this app you can: 4. Continue chatting within the chat entry with the counterparty. `UpdateChatFlow` ### Prerequisites -- Corda CLI; version should matching that of the Corda combined worker image used +- Corda CLI; version should match that of the Corda combined worker image used - Docker ### Setting up diff --git a/build.gradle b/build.gradle index fa375d3e..0029c953 100644 --- a/build.gradle +++ b/build.gradle @@ -29,7 +29,7 @@ allprojects { cordaClusterURL = "https://localhost:8888" cordaRestUser = "admin" cordaRestPasswd ="admin" - composeFilePath = "config/combined-worker-kafka-compose.yaml" + composeFilePath = "config/combined-worker-compose.yaml" networkConfigFile = "config/static-network-config.json" r3RootCertFile = "config/r3-ca-key.pem" skipTestsDuringBuildCpis = "false" @@ -37,9 +37,6 @@ allprojects { cordaBinDir = "${System.getProperty("user.home")}/.corda/corda5" cordaCliBinDir = "${System.getProperty("user.home")}/.corda/cli" - // Alternatively, you can use a Database-only combined worker: - // composeFilePath = "config/combined-worker-compose.yaml" - // Only need to supply these if you want to use an unpublished version artifactoryUsername = findProperty('cordaArtifactoryUsername') ?: System.getenv('CORDA_ARTIFACTORY_USERNAME') artifactoryPassword = findProperty('cordaArtifactoryPassword') ?: System.getenv('CORDA_ARTIFACTORY_PASSWORD') diff --git a/config/combined-worker-compose.yaml b/config/combined-worker-compose.yaml index 924e2cd0..ce092803 100644 --- a/config/combined-worker-compose.yaml +++ b/config/combined-worker-compose.yaml @@ -11,14 +11,54 @@ services: ports: - 5432:5432 + kafka: + image: confluentinc/cp-kafka:latest + ports: + - 9092:9092 + environment: + KAFKA_NODE_ID: 1 + CLUSTER_ID: ZDFiZmU3ODUyMzRiNGI3NG + KAFKA_PROCESS_ROLES: broker,controller + KAFKA_CONTROLLER_QUORUM_VOTERS: 1@kafka:9093 + KAFKA_LISTENERS: PLAINTEXT://0.0.0.0:9092,DOCKER_INTERNAL://0.0.0.0:29092,CONTROLLER://0.0.0.0:9093 + KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9092,DOCKER_INTERNAL://kafka:29092 + KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,DOCKER_INTERNAL:PLAINTEXT,CONTROLLER:PLAINTEXT + KAFKA_INTER_BROKER_LISTENER_NAME: DOCKER_INTERNAL + KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER + KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 + KAFKA_DEFAULT_REPLICATION_FACTOR: 1 + KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1 + KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1 + KAFKA_AUTO_CREATE_TOPICS_ENABLE: "true" + + kafka-create-topics: + image: openjdk:17-jdk + depends_on: + - kafka + volumes: + - ${CORDA_CLI:-~/.corda/cli}:/opt/corda-cli + working_dir: /opt/corda-cli + command: [ + "java", + "-jar", + "corda-cli.jar", + "topic", + "-b=kafka:29092", + "create", + "connect" + ] + corda: - image: corda-os-docker.software.r3.com/corda-os-combined-worker:5.2.0.0-RC02 + image: corda-os-docker.software.r3.com/corda-os-combined-worker-kafka:5.2.0.0-RC02 depends_on: - postgresql + - kafka + - kafka-create-topics environment: JAVA_TOOL_OPTIONS: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 command: [ - "-mbus.busType=DATABASE", + "-mbus.busType=KAFKA", + "-mbootstrap.servers=kafka:29092", "-spassphrase=password", "-ssalt=salt", "-ddatabase.user=user", diff --git a/config/combined-worker-kafka-compose.yaml b/config/combined-worker-kafka-compose.yaml deleted file mode 100644 index ce092803..00000000 --- a/config/combined-worker-kafka-compose.yaml +++ /dev/null @@ -1,72 +0,0 @@ -version: '2' -services: - postgresql: - image: postgres:14.10 - restart: unless-stopped - tty: true - environment: - - POSTGRES_USER=postgres - - POSTGRES_PASSWORD=password - - POSTGRES_DB=cordacluster - ports: - - 5432:5432 - - kafka: - image: confluentinc/cp-kafka:latest - ports: - - 9092:9092 - environment: - KAFKA_NODE_ID: 1 - CLUSTER_ID: ZDFiZmU3ODUyMzRiNGI3NG - KAFKA_PROCESS_ROLES: broker,controller - KAFKA_CONTROLLER_QUORUM_VOTERS: 1@kafka:9093 - KAFKA_LISTENERS: PLAINTEXT://0.0.0.0:9092,DOCKER_INTERNAL://0.0.0.0:29092,CONTROLLER://0.0.0.0:9093 - KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9092,DOCKER_INTERNAL://kafka:29092 - KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,DOCKER_INTERNAL:PLAINTEXT,CONTROLLER:PLAINTEXT - KAFKA_INTER_BROKER_LISTENER_NAME: DOCKER_INTERNAL - KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER - KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 - KAFKA_DEFAULT_REPLICATION_FACTOR: 1 - KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1 - KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1 - KAFKA_AUTO_CREATE_TOPICS_ENABLE: "true" - - kafka-create-topics: - image: openjdk:17-jdk - depends_on: - - kafka - volumes: - - ${CORDA_CLI:-~/.corda/cli}:/opt/corda-cli - working_dir: /opt/corda-cli - command: [ - "java", - "-jar", - "corda-cli.jar", - "topic", - "-b=kafka:29092", - "create", - "connect" - ] - - corda: - image: corda-os-docker.software.r3.com/corda-os-combined-worker-kafka:5.2.0.0-RC02 - depends_on: - - postgresql - - kafka - - kafka-create-topics - environment: - JAVA_TOOL_OPTIONS: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 - command: [ - "-mbus.busType=KAFKA", - "-mbootstrap.servers=kafka:29092", - "-spassphrase=password", - "-ssalt=salt", - "-ddatabase.user=user", - "-ddatabase.pass=password", - "-ddatabase.jdbc.url=jdbc:postgresql://postgresql:5432/cordacluster", - "-ddatabase.jdbc.directory=/opt/jdbc-driver/" - ] - ports: - - 8888:8888 - - 7004:7004 - - 5005:5005 \ No newline at end of file