corda/samples/notary-demo/build.gradle
Florian Friemel 47068e6b7a [CORDA-2077] Use latest gradle plugin version (4.0.32), set target version in core and sample CorDapps (#4038)
* Upgrade gradle plugin; add target version attribute to finance and sample cordapps.
* Remove '-SNAPSHOT' from gradlePluginsVersion.
* Fix naming.
* Update docs.
* Respond to feedback.
* Fix irs demo
* Fix more samples
* Fix more samples
* Fix deployNodes
* Fix deployNodes
* more fixes
* fix simm valuation
* more fixes
* more fixes
* more fixes
* more fixes
* Publication should have *nothing* to do with cordformation and deployNodes.
Remove it! And if this exposes a bug then "so be it".
* Disable CorDapp signing for Cordapp Configuration and Network Verifier.
* Disable CorDapp signing for SIMM Valuation Demo.
* Remove remaining publishing nonsense from samples.
* Workarounds fpr cordapp-configuration, network-verifier and simm-valuation-demo:
JarSigner rejects jars with duplicates inside, so remove them.
* Upgrade to Gradle plugin 4.0.32 and reenable CorDapp signing for samples.
2018-10-15 21:11:52 +01:00

265 lines
7.8 KiB
Groovy

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.cordapp'
apply plugin: 'net.corda.plugins.cordformation'
configurations {
integrationTestCompile.extendsFrom testCompile
integrationTestRuntime.extendsFrom testRuntime
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
// Corda integration dependencies
cordaRuntime project(path: ":node:capsule", configuration: 'runtimeArtifacts')
cordaRuntime project(path: ":webserver:webcapsule", configuration: 'runtimeArtifacts')
cordaCompile project(':core')
cordaCompile project(':client:jfx')
cordaCompile project(':client:rpc')
cordaCompile project(':test-utils')
// Notary implementations
cordapp project(':experimental:notary-raft')
cordapp project(':experimental:notary-bft-smart')
}
def nodeTask = tasks.getByPath(':node:capsule:assemble')
def webTask = tasks.getByPath(':webserver:webcapsule:assemble')
task deployNodes(dependsOn: ['deployNodesSingle', 'deployNodesRaft', 'deployNodesBFT', 'deployNodesCustom'])
task deployNodesSingle(type: Cordform, dependsOn: ['jar', nodeTask, webTask]) {
directory file("$buildDir/nodes/nodesSingle")
nodeDefaults {
extraConfig = [h2Settings: [address: "localhost:0"]]
}
node {
name "O=Alice Corp,L=Madrid,C=ES"
p2pPort 10002
rpcSettings {
address "localhost:10003"
adminAddress "localhost:10103"
}
rpcUsers = [[user: "demou", password: "demop", permissions: ["ALL"]]]
}
node {
name "O=Notary Service,L=Zurich,C=CH"
p2pPort 10009
rpcSettings {
address "localhost:10010"
adminAddress "localhost:10110"
}
notary = [validating: true]
}
}
task deployNodesCustom(type: Cordform, dependsOn: ['jar', nodeTask, webTask]) {
directory file("$buildDir/nodes/nodesCustom")
nodeDefaults {
extraConfig = [h2Settings: [address: "localhost:0"]]
}
node {
name "O=Alice Corp,L=Madrid,C=ES"
p2pPort 10002
rpcSettings {
address "localhost:10003"
adminAddress "localhost:10103"
}
rpcUsers = [[user: "demou", password: "demop", permissions: ["ALL"]]]
}
node {
name "O=Notary Service,L=Zurich,C=CH"
p2pPort 10009
rpcSettings {
address "localhost:10010"
adminAddress "localhost:10110"
}
notary = [
validating: true,
className: "net.corda.notarydemo.MyCustomValidatingNotaryService"
]
}
}
task deployNodesRaft(type: Cordform, dependsOn: ['jar', nodeTask, webTask]) {
def className = "net.corda.notary.raft.RaftNotaryService"
directory file("$buildDir/nodes/nodesRaft")
nodeDefaults {
extraConfig = [h2Settings: [address: "localhost:0"]]
cordapp project(':experimental:notary-raft')
}
node {
name "O=Alice Corp,L=Madrid,C=ES"
p2pPort 10002
rpcSettings {
address "localhost:10003"
adminAddress "localhost:10103"
}
rpcUsers = [[user: "demou", password: "demop", permissions: ["ALL"]]]
}
node {
name "O=Notary Service 0,L=Zurich,C=CH"
p2pPort 10009
rpcSettings {
address "localhost:10010"
adminAddress "localhost:10110"
}
notary = [
validating: true,
serviceLegalName: "O=Raft,L=Zurich,C=CH",
raft: [
nodeAddress: "localhost:10008"
],
className: className
]
}
node {
name "O=Notary Service 1,L=Zurich,C=CH"
p2pPort 10013
rpcSettings {
address "localhost:10014"
adminAddress "localhost:10114"
}
notary = [
validating: true,
serviceLegalName: "O=Raft,L=Zurich,C=CH",
raft: [
nodeAddress: "localhost:10012",
clusterAddresses: ["localhost:10008"]
],
className: className
]
}
node {
name "O=Notary Service 2,L=Zurich,C=CH"
p2pPort 10017
rpcSettings {
address "localhost:10018"
adminAddress "localhost:10118"
}
notary = [
validating: true,
serviceLegalName: "O=Raft,L=Zurich,C=CH",
raft: [
nodeAddress: "localhost:10016",
clusterAddresses: ["localhost:10008"]
],
className: className
]
}
}
task deployNodesBFT(type: Cordform, dependsOn: ['jar', nodeTask, webTask]) {
def clusterAddresses = ["localhost:11000", "localhost:11010", "localhost:11020", "localhost:11030"]
def className = "net.corda.notary.bftsmart.BftSmartNotaryService"
directory file("$buildDir/nodes/nodesBFT")
nodeDefaults {
extraConfig = [h2Settings: [address: "localhost:0"]]
cordapp project(':experimental:notary-bft-smart')
}
node {
name "O=Alice Corp,L=Madrid,C=ES"
p2pPort 10002
rpcSettings {
address "localhost:10003"
adminAddress "localhost:10103"
}
rpcUsers = [[user: "demou", password: "demop", permissions: ["ALL"]]]
}
node {
name "O=Notary Service 0,L=Zurich,C=CH"
p2pPort 10009
rpcSettings {
address "localhost:10010"
adminAddress "localhost:10110"
}
notary = [
validating: false,
serviceLegalName: "O=BFT,L=Zurich,C=CH",
bftSMaRt: [
replicaId: 0,
clusterAddresses: clusterAddresses
],
className: className
]
}
node {
name "O=Notary Service 1,L=Zurich,C=CH"
p2pPort 10013
rpcSettings {
address "localhost:10014"
adminAddress "localhost:10114"
}
notary = [
validating: false,
serviceLegalName: "O=BFT,L=Zurich,C=CH",
bftSMaRt: [
replicaId: 1,
clusterAddresses: clusterAddresses
],
className: className
]
}
node {
name "O=Notary Service 2,L=Zurich,C=CH"
p2pPort 10017
rpcSettings {
address "localhost:10018"
adminAddress "localhost:10118"
}
notary = [
validating: false,
serviceLegalName: "O=BFT,L=Zurich,C=CH",
bftSMaRt: [
replicaId: 2,
clusterAddresses: clusterAddresses
],
className: className
]
}
node {
name "O=Notary Service 3,L=Zurich,C=CH"
p2pPort 10021
rpcSettings {
address "localhost:10022"
adminAddress "localhost:10122"
}
notary = [
validating: false,
serviceLegalName: "O=BFT,L=Zurich,C=CH",
bftSMaRt: [
replicaId: 3,
clusterAddresses: clusterAddresses
],
className: className
]
}
}
task notarise(type: JavaExec) {
classpath = sourceSets.main.runtimeClasspath
main = 'net.corda.notarydemo.NotariseKt'
}
jar {
manifest {
attributes(
'Automatic-Module-Name': 'net.corda.samples.demos.notary'
)
}
}
cordapp {
info {
name "net/corda/samples/notary-demo"
vendor "Corda Open Source"
targetPlatformVersion corda_platform_version.toInteger()
minimumPlatformVersion 1
}
}