2016-11-17 11:03:40 +00:00
|
|
|
apply plugin: 'kotlin'
|
|
|
|
apply plugin: 'idea'
|
|
|
|
apply plugin: 'net.corda.plugins.quasar-utils'
|
2019-03-11 16:48:35 +00:00
|
|
|
apply plugin: 'net.corda.plugins.cordapp'
|
2016-11-17 11:03:40 +00:00
|
|
|
apply plugin: 'net.corda.plugins.cordformation'
|
|
|
|
|
2019-03-11 16:48:35 +00:00
|
|
|
cordapp {
|
|
|
|
info {
|
|
|
|
name "Trader Demo"
|
|
|
|
vendor "R3"
|
|
|
|
targetPlatformVersion corda_platform_version.toInteger()
|
|
|
|
minimumPlatformVersion 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
sourceSets {
|
|
|
|
integrationTest {
|
|
|
|
kotlin {
|
|
|
|
compileClasspath += main.output + test.output
|
|
|
|
runtimeClasspath += main.output + test.output
|
|
|
|
srcDir file('src/integration-test/kotlin')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
configurations {
|
|
|
|
integrationTestCompile.extendsFrom testCompile
|
2019-05-20 10:57:56 +00:00
|
|
|
integrationTestRuntimeOnly.extendsFrom testRuntimeOnly
|
2019-03-11 16:48:35 +00:00
|
|
|
}
|
|
|
|
|
2016-11-17 11:03:40 +00:00
|
|
|
dependencies {
|
2018-04-24 13:03:41 +00:00
|
|
|
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
2019-03-11 16:48:35 +00:00
|
|
|
compile "net.sf.jopt-simple:jopt-simple:$jopt_simple_version"
|
|
|
|
cordaCompile project(':client:rpc')
|
|
|
|
|
|
|
|
// Cordformation needs a SLF4J implementation when executing the Network
|
|
|
|
// Bootstrapper, but Log4J doesn't shutdown completely from within Gradle.
|
|
|
|
// Use a much simpler SLF4J implementation here instead.
|
2019-05-20 10:57:56 +00:00
|
|
|
cordaRuntime "org.slf4j:slf4j-simple:$slf4j_version"
|
2019-03-11 16:48:35 +00:00
|
|
|
|
|
|
|
// We only need this for its DUMMY_BANK constants, and
|
|
|
|
// DO NOT want it added to Gradle's runtime classpath.
|
|
|
|
compileOnly project(':test-utils')
|
2016-11-17 11:03:40 +00:00
|
|
|
|
2017-08-15 08:14:15 +00:00
|
|
|
// The trader demo CorDapp depends upon Cash CorDapp features
|
2018-12-19 18:02:51 +00:00
|
|
|
cordapp project(':finance:contracts')
|
|
|
|
cordapp project(':finance:workflows')
|
2019-01-23 13:26:33 +00:00
|
|
|
cordapp project(':samples:trader-demo:workflows-trader')
|
2017-08-15 08:14:15 +00:00
|
|
|
|
2016-11-17 11:03:40 +00:00
|
|
|
// Corda integration dependencies
|
2018-10-15 20:11:52 +00:00
|
|
|
cordaRuntime project(path: ":node:capsule", configuration: 'runtimeArtifacts')
|
2016-11-17 11:03:40 +00:00
|
|
|
|
2021-09-15 07:52:14 +00:00
|
|
|
testCompile(project(':node-driver'))
|
2019-05-15 15:40:12 +00:00
|
|
|
|
|
|
|
testImplementation "org.junit.jupiter:junit-jupiter-api:${junit_jupiter_version}"
|
2019-05-20 10:57:56 +00:00
|
|
|
testImplementation "junit:junit:$junit_version"
|
2019-05-15 15:40:12 +00:00
|
|
|
|
2019-05-20 10:57:56 +00:00
|
|
|
testRuntimeOnly "org.junit.vintage:junit-vintage-engine:${junit_vintage_version}"
|
2019-05-15 15:40:12 +00:00
|
|
|
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junit_jupiter_version}"
|
|
|
|
testRuntimeOnly "org.junit.platform:junit-platform-launcher:${junit_platform_version}"
|
2019-05-20 10:57:56 +00:00
|
|
|
|
2019-03-11 16:48:35 +00:00
|
|
|
testCompile "org.assertj:assertj-core:$assertj_version"
|
|
|
|
}
|
|
|
|
|
|
|
|
task integrationTest(type: Test, dependsOn: []) {
|
|
|
|
testClassesDirs = sourceSets.integrationTest.output.classesDirs
|
|
|
|
classpath = sourceSets.integrationTest.runtimeClasspath
|
2016-11-17 11:03:40 +00:00
|
|
|
}
|
|
|
|
|
2018-10-15 20:11:52 +00:00
|
|
|
def nodeTask = tasks.getByPath(':node:capsule:assemble')
|
2019-03-11 16:48:35 +00:00
|
|
|
task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar', nodeTask]) {
|
2017-11-02 15:09:49 +00:00
|
|
|
ext.rpcUsers = [['username': "demo", 'password': "demo", 'permissions': ["ALL"]]]
|
2019-01-11 13:51:23 +00:00
|
|
|
nodeDefaults {
|
2019-01-23 13:26:33 +00:00
|
|
|
projectCordapp {
|
|
|
|
deploy = false // TODO This is a bug, project cordapp should be disabled if no cordapp plugin is applied.
|
|
|
|
}
|
2019-01-11 13:51:23 +00:00
|
|
|
cordapp project(':finance:workflows')
|
|
|
|
cordapp project(':finance:contracts')
|
2019-01-23 13:26:33 +00:00
|
|
|
cordapp project(':samples:trader-demo:workflows-trader')
|
2020-06-15 14:52:31 +00:00
|
|
|
runSchemaMigration = true
|
2019-01-11 13:51:23 +00:00
|
|
|
}
|
2016-11-17 11:03:40 +00:00
|
|
|
node {
|
2020-07-20 09:59:08 +00:00
|
|
|
name "O=Notary Node,L=Zurich,C=CH"
|
|
|
|
notary = [validating : true,
|
|
|
|
serviceLegalName: "O=Notary Service,L=Zurich,C=CH"
|
|
|
|
]
|
2017-03-17 10:32:14 +00:00
|
|
|
p2pPort 10002
|
2018-03-16 16:41:34 +00:00
|
|
|
rpcSettings {
|
|
|
|
address "localhost:10003"
|
|
|
|
adminAddress "localhost:10004"
|
|
|
|
}
|
2018-08-01 10:50:42 +00:00
|
|
|
extraConfig = ['h2Settings.address' : 'localhost:10014']
|
2016-11-17 11:03:40 +00:00
|
|
|
}
|
|
|
|
node {
|
2017-09-07 13:47:42 +00:00
|
|
|
name "O=Bank A,L=London,C=GB"
|
2017-03-17 10:32:14 +00:00
|
|
|
p2pPort 10005
|
2017-01-17 14:12:55 +00:00
|
|
|
rpcUsers = ext.rpcUsers
|
2018-01-25 14:32:58 +00:00
|
|
|
rpcSettings {
|
|
|
|
address "localhost:10006"
|
|
|
|
adminAddress "localhost:10007"
|
|
|
|
}
|
2018-08-01 10:50:42 +00:00
|
|
|
extraConfig = ['h2Settings.address' : 'localhost:10015']
|
2016-11-17 11:03:40 +00:00
|
|
|
}
|
|
|
|
node {
|
2017-09-07 13:47:42 +00:00
|
|
|
name "O=Bank B,L=New York,C=US"
|
2017-03-17 10:32:14 +00:00
|
|
|
p2pPort 10008
|
2017-01-17 14:12:55 +00:00
|
|
|
rpcUsers = ext.rpcUsers
|
2018-01-25 14:32:58 +00:00
|
|
|
rpcSettings {
|
|
|
|
address "localhost:10009"
|
|
|
|
adminAddress "localhost:10010"
|
|
|
|
}
|
2018-08-01 10:50:42 +00:00
|
|
|
extraConfig = ['h2Settings.address' : 'localhost:10016']
|
2016-11-17 11:03:40 +00:00
|
|
|
}
|
2016-12-06 16:16:47 +00:00
|
|
|
node {
|
2017-09-07 13:47:42 +00:00
|
|
|
name "O=BankOfCorda,L=New York,C=US"
|
2017-03-17 10:32:14 +00:00
|
|
|
p2pPort 10011
|
2017-08-11 09:20:27 +00:00
|
|
|
rpcUsers = ext.rpcUsers
|
2018-01-25 14:32:58 +00:00
|
|
|
rpcSettings {
|
|
|
|
address "localhost:10012"
|
|
|
|
adminAddress "localhost:10013"
|
|
|
|
}
|
2018-08-01 10:50:42 +00:00
|
|
|
extraConfig = ['h2Settings.address' : 'localhost:10017']
|
2016-12-06 16:16:47 +00:00
|
|
|
}
|
2018-10-23 15:45:07 +00:00
|
|
|
|
|
|
|
//All other nodes should be using LoggingBuyerFlow as it is a subclass of BuyerFlow
|
|
|
|
node {
|
2019-01-15 11:42:05 +00:00
|
|
|
name "O=NonLogging Bank,L=London,C=GB"
|
2018-10-23 15:45:07 +00:00
|
|
|
p2pPort 10025
|
|
|
|
rpcUsers = ext.rpcUsers
|
|
|
|
rpcSettings {
|
|
|
|
address "localhost:10026"
|
|
|
|
adminAddress "localhost:10027"
|
|
|
|
}
|
|
|
|
extraConfig = ['h2Settings.address' : 'localhost:10035']
|
|
|
|
flowOverride("net.corda.traderdemo.flow.SellerFlow", "net.corda.traderdemo.flow.BuyerFlow")
|
|
|
|
}
|
2016-11-17 11:03:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
idea {
|
|
|
|
module {
|
|
|
|
downloadJavadoc = true // defaults to false
|
|
|
|
downloadSources = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-03-11 16:48:35 +00:00
|
|
|
task runBank(type: JavaExec, dependsOn: jar) {
|
|
|
|
classpath = sourceSets.test.runtimeClasspath
|
2016-11-17 17:04:12 +00:00
|
|
|
main = 'net.corda.traderdemo.TraderDemoKt'
|
|
|
|
args '--role'
|
2017-08-11 09:20:27 +00:00
|
|
|
args 'BANK'
|
2016-11-17 17:04:12 +00:00
|
|
|
}
|
|
|
|
|
2019-03-11 16:48:35 +00:00
|
|
|
task runSeller(type: JavaExec, dependsOn: jar) {
|
|
|
|
classpath = sourceSets.test.runtimeClasspath
|
2016-11-17 17:04:12 +00:00
|
|
|
main = 'net.corda.traderdemo.TraderDemoKt'
|
|
|
|
args '--role'
|
|
|
|
args 'SELLER'
|
2017-01-03 14:15:23 +00:00
|
|
|
}
|