corda/samples/raft-notary-demo/build.gradle

131 lines
3.6 KiB
Groovy
Raw Normal View History

import net.corda.plugins.Cordform
apply plugin: 'java'
apply plugin: 'kotlin'
apply plugin: 'idea'
apply plugin: 'net.corda.plugins.quasar-utils'
apply plugin: 'net.corda.plugins.publish-utils'
apply plugin: 'net.corda.plugins.cordformation'
apply plugin: 'maven-publish'
ext {
deployTo = "build/nodes"
notaryType = "corda.notary.validating.raft"
notaryName = "CN=Raft,O=R3,OU=corda,L=Zurich,C=CH"
advertisedNotary = "$notaryType|$notaryName"
}
configurations {
integrationTestCompile.extendsFrom testCompile
integrationTestRuntime.extendsFrom testRuntime
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version"
testCompile "junit:junit:$junit_version"
// Corda integration dependencies
runtime project(path: ":node:capsule", configuration: 'runtimeArtifacts')
2017-03-30 16:34:32 +00:00
runtime project(path: ":webserver:webcapsule", configuration: 'runtimeArtifacts')
compile project(':core')
compile project(':client:jfx')
compile project(':client:rpc')
compile project(':test-utils')
// Javax is required for webapis
compile "org.glassfish.jersey.core:jersey-server:${jersey_version}"
}
idea {
module {
downloadJavadoc = true // defaults to false
downloadSources = true
}
}
publishing {
publications {
jarAndSources(MavenPublication) {
from components.java
artifactId 'raftnotarydemo'
artifact sourceJar
artifact javadocJar
}
}
}
task cleanNodes {
doLast {
delete deployTo
}
}
task generateNotaryIdentity(type: JavaExec, dependsOn: 'cleanNodes') {
classpath = sourceSets.main.runtimeClasspath
main = "net.corda.node.utilities.ServiceIdentityGeneratorKt"
def nodeDirs = ["$deployTo/Notary1",
"$deployTo/Notary2",
"$deployTo/Notary3"].join("|")
args = [nodeDirs, notaryType, notaryName]
}
task deployNodes(type: Cordform, dependsOn: ['jar', generateNotaryIdentity]) {
directory deployTo
networkMap "CN=Notary 1,O=R3,OU=corda,L=London,C=UK"
node {
name "CN=Alice Corp,O=Alice Corp,L=London,C=UK"
nearestCity "London"
advertisedServices = []
p2pPort 10002
rpcPort 10003
cordapps = []
rpcUsers = [['username': "demo", 'password': "demo", 'permissions': [
'StartFlow.net.corda.notarydemo.flows.DummyIssueAndMove',
'StartFlow.net.corda.notarydemo.flows.RPCStartableNotaryFlowClient'
]]]
}
node {
name "CN=Bob Plc,O=Bob Plc,L=London,C=UK"
nearestCity "New York"
advertisedServices = []
p2pPort 10005
rpcPort 10006
cordapps = []
}
node {
name "CN=Notary 1,O=R3,OU=corda,L=London,C=UK"
nearestCity "London"
advertisedServices = [advertisedNotary]
p2pPort 10009
rpcPort 10010
cordapps = []
notaryNodePort 10008
}
node {
name "CN=Notary 2,O=R3,OU=corda,L=London,C=UK"
nearestCity "London"
advertisedServices = [advertisedNotary]
p2pPort 10013
rpcPort 10014
cordapps = []
notaryNodePort 10012
notaryClusterAddresses = ["localhost:10008"]
}
node {
name "CN=Notary 3,O=R3,OU=corda,L=London,C=UK"
nearestCity "London"
advertisedServices = [advertisedNotary]
p2pPort 10017
rpcPort 10018
cordapps = []
notaryNodePort 10016
notaryClusterAddresses = ["localhost:10008"]
}
}
task notarise(type: JavaExec) {
classpath = sourceSets.main.runtimeClasspath
main = 'net.corda.notarydemo.NotaryDemoKt'
}