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..4aa738a4 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,23 @@ 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; version should match that of the Corda combined worker image used +- Docker + ### 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 +54,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 +71,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 +86,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 +101,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 1088827a..0029c953 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 { @@ -6,40 +8,42 @@ plugins { id 'org.jetbrains.kotlin.plugin.jpa' id 'java' id 'maven-publish' - id 'net.corda.plugins.csde' + id 'net.corda.gradle.plugin' } allprojects { - group 'com.r3.developers.csdetemplate' + group 'com.r3.developers.cordapptemplate' version '1.0-SNAPSHOT' def javaVersion = VERSION_17 - // Configure the CSDE - csde { + // 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" + composeFilePath = "config/combined-worker-compose.yaml" 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 + skipTestsDuringBuildCpis = "false" + cordaRuntimePluginWorkspaceDir = "workspace" + cordaBinDir = "${System.getProperty("user.home")}/.corda/corda5" + cordaCliBinDir = "${System.getProperty("user.home")}/.corda/cli" + + // 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. - tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach { + tasks.withType(KotlinCompile).configureEach { kotlinOptions { allWarningsAsErrors = false @@ -85,20 +89,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 { @@ -110,7 +100,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/config/combined-worker-compose.yaml b/config/combined-worker-compose.yaml new file mode 100644 index 00000000..ce092803 --- /dev/null +++ b/config/combined-worker-compose.yaml @@ -0,0 +1,72 @@ +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 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 37043155..3259bf9a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,21 +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 -csdePluginVersion=1.2.0-beta-+ +# Specify the version of the Corda runtime Gradle plugin to use +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 @@ -71,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 6b718c09..e2445064 100644 --- a/settings.gradle +++ b/settings.gradle @@ -22,15 +22,15 @@ 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 cordaGradlePluginVersion } } // 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?"