corda/samples/notary-demo/build.gradle
josecoll 9cdda3bd77
CORDA-2149 CorDapp Contract and Workflow version identifiers (#4363)
* Implementation of Contract and Workflow attribute identifiers.

* Fixes following rebase from master.

* Fix broken JUnit test.

* Fix broken JUnit test.

* Fix broken JUnit test.

* Added missing constants.

* Further clean-up.

* Updated documentation.

* Added changelog entry.

* Updated all samples (using new Gradle Plugin 4.0.37 functionality)

* Temporarily resolve gradle plugins from latest published snapshot.

* Temporarily resolve gradle plugins from latest published snapshot.

* Updates following feedback from PR review.

* Move constants into CordappInfo companion object.

* Contract and Workflow attribute `version` to `versionId` (as version is a reserved gradle variable)

* Clarified warning message on incorrect version identifier.

* Align version identifier processing logic with gradle cordapp plugin.

* Updated comment.

* Minor fixes following rebase from master.

* Fixed broken unit test.

* Improved exception reporting.

* Update to use 4.0.37 of Gradle Plugins.

* Added support for combined Contract and Workflow CorDapp info.

* Updated following discussions with Shams + cleanup.

* Updated following Shams PR review.

* Minor API improvements.

* Added missing cordapp info causing deployNodes to fail.
2018-12-14 09:39:23 +00:00

267 lines
7.9 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",
extraConfig: [
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",
extraConfig: [
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",
extraConfig: [
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",
extraConfig: [
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",
extraConfig: [
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",
extraConfig: [
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",
extraConfig: [
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 {
targetPlatformVersion corda_platform_version.toInteger()
minimumPlatformVersion 1
workflow {
name "net/corda/samples/notary-demo"
versionId 1
vendor "R3"
licence "Open Source (Apache 2)"
}
}