Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Example Projects Standalone #74

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,15 @@ See https://docs.corda.net/getting-set-up.html.

# Usage

From the root directory run the following commands:
Build and run the nodes:

* `./gradlew clean deployNodesX`
* `examples/cordapp-sweepstake/cordapp/build/nodes/runnodes`
* `./gradlew clean deployNodes`
* `./build/nodes/runnodes`

Once built, start the spring boot web application `WorldCupApplication` using the following command:
Start the Spring Boot web application `WorldCupApplication`:
* `./gradlew runTournamentServer`

Navigate to the server
`http://localhost:8080/`
Navigate to the server http://localhost:8080

1. Click the 'Import players' button
2. Click the 'Create accounts and issue teams' button. Wait for the two columns on the table to be populated
Expand Down
131 changes: 131 additions & 0 deletions examples/cordapp-sweepstake/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
buildscript {
ext {
corda_release_group = 'net.corda'
corda_release_version = '4.3-RC02'
corda_gradle_plugins_version = '4.0.42'
accounts_release_group = 'com.r3.corda.lib.accounts'
accounts_release_version = '1.0-RC04'
confidential_id_release_group = "com.r3.corda.lib.ci"
confidential_id_release_version = "1.0-RC03"
tokens_release_group = 'com.r3.corda.lib.tokens'
tokens_release_version = '1.0'
quasar_version = '0.7.10'
kotlin_version = '1.2.71'
spring_boot_version = '2.0.2.RELEASE'
junit_version = '4.12'
}

repositories {
mavenCentral()
jcenter()
maven { url 'https://ci-artifactory.corda.r3cev.com/artifactory/corda' }
}

dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "net.corda.plugins:cordapp:$corda_gradle_plugins_version"
classpath "net.corda.plugins:cordformation:$corda_gradle_plugins_version"
classpath "net.corda.plugins:quasar-utils:$corda_gradle_plugins_version"
classpath("org.springframework.boot:spring-boot-gradle-plugin:2.0.5.RELEASE")
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

allprojects {
repositories {
jcenter()
mavenCentral()
maven { url "https://ci-artifactory.corda.r3cev.com/artifactory/corda-dev" }
maven { url 'https://ci-artifactory.corda.r3cev.com/artifactory/corda' }
//This is needed until the accounts sdk is official
maven { url "http://ci-artifactory.corda.r3cev.com/artifactory/corda-lib-dev" }
maven { url 'http://ci-artifactory.corda.r3cev.com/artifactory/corda-lib' }
//Corda testing node-driver requires gradle-tooling-api
maven { url 'https://repo.gradle.org/gradle/libs-releases-local/' }
//Crash Shell dependencies are not published correctly in R3 repo
maven { url 'https://jitpack.io' }
}

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
languageVersion = "1.2"
apiVersion = "1.2"
jvmTarget = "1.8"
javaParameters = true // Useful for reflection.
}
}
}

wrapper {
gradleVersion = "4.10.2"
distributionType = Wrapper.DistributionType.ALL
}

apply plugin: 'kotlin'
apply plugin: 'net.corda.plugins.cordapp'
apply plugin: 'net.corda.plugins.cordformation'
apply plugin: 'net.corda.plugins.quasar-utils'

dependencies {
cordaCompile "$corda_release_group:corda-node-api:$corda_release_version"
cordaCompile "$confidential_id_release_group:ci-workflows:$confidential_id_release_version"

// CorDapp dependencies.
cordapp project(":contracts")
cordapp project(":workflows")
cordapp "$accounts_release_group:accounts-contracts:$accounts_release_version"
cordapp "$accounts_release_group:accounts-workflows:$accounts_release_version"
cordapp "$confidential_id_release_group:ci-workflows:$confidential_id_release_version"
// Tokens
cordapp "$tokens_release_group:tokens-contracts:$tokens_release_version"
cordapp "$tokens_release_group:tokens-workflows:$tokens_release_version"
cordapp "$tokens_release_group:tokens-money:$tokens_release_version"
}

task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar']) {

nodeDefaults {
projectCordapp {
deploy = false
}
cordapp project(':contracts')
cordapp project(':workflows')
cordapp("$accounts_release_group:accounts-contracts:$accounts_release_version")
cordapp("$accounts_release_group:accounts-workflows:$accounts_release_version")
cordapp("$confidential_id_release_group:ci-workflows:$confidential_id_release_version")
cordapp "$tokens_release_group:tokens-contracts:$tokens_release_version"
cordapp "$tokens_release_group:tokens-workflows:$tokens_release_version"
cordapp "$tokens_release_group:tokens-money:$tokens_release_version"
}

node {
name "O=Notary,L=London,C=GB"
notary = [validating: false]
p2pPort 10000
sshdPort 2222
rpcSettings {
address("localhost:10001")
adminAddress("localhost:10002")
}
}
node {
name "O=TournamentA,L=London,C=GB"
p2pPort 10004
sshdPort 2223
rpcSettings {
address("localhost:10005")
adminAddress("localhost:10006")
}
rpcUsers = [[user: "user1", "password": "test", "permissions": ["ALL"]]]
}
node {
name "O=TournamentB,L=London,C=GB"
p2pPort 10008
sshdPort 2224
rpcSettings {
address("localhost:10009")
adminAddress("localhost:10010")
}
rpcUsers = [[user: "user1", "password": "test", "permissions": ["ALL"]]]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ apply plugin: 'net.corda.plugins.cordapp'
apply plugin: 'net.corda.plugins.cordformation'
apply plugin: 'net.corda.plugins.quasar-utils'


cordapp {
info {
name "World Cup Sweepstake - Contracts"
Expand All @@ -17,9 +16,12 @@ cordapp {
}

dependencies {
// Kotlin.
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"

// Corda.
cordaCompile "$corda_release_group:corda-core:$corda_release_version"
cordaCompile "$accounts_release_group:accounts-contracts:$accounts_release_version"
cordaRuntime "$corda_release_group:corda:$corda_release_version"

// Kotlin.
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
}
132 changes: 0 additions & 132 deletions examples/cordapp-sweepstake/cordapp/build.gradle

This file was deleted.

4 changes: 4 additions & 0 deletions examples/cordapp-sweepstake/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
group=com.r3.corda.examples
name=cordapp-sweepstake
version=0.1
kotlin.incremental=false
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading