2017-05-16 11:30:50 +01:00
|
|
|
import net.corda.plugins.Cordform
|
|
|
|
|
2016-11-22 18:09:56 +00:00
|
|
|
apply plugin: 'kotlin'
|
|
|
|
apply plugin: 'idea'
|
2017-10-09 20:08:08 +01:00
|
|
|
apply plugin: 'net.corda.plugins.cordapp'
|
2016-11-22 18:09:56 +00:00
|
|
|
apply plugin: 'net.corda.plugins.cordformation'
|
|
|
|
|
2019-03-11 16:48:35 +00:00
|
|
|
cordapp {
|
|
|
|
info {
|
|
|
|
name "Corda Notary Demo"
|
|
|
|
vendor "R3"
|
|
|
|
targetPlatformVersion corda_platform_version.toInteger()
|
|
|
|
minimumPlatformVersion 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-11-22 18:09:56 +00:00
|
|
|
dependencies {
|
2022-03-08 10:50:59 +00:00
|
|
|
if (System.getProperty('excludeShell') == null) {
|
|
|
|
cordaDriver "net.corda:corda-shell:$corda_release_version"
|
|
|
|
}
|
2018-04-24 14:03:41 +01:00
|
|
|
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
2019-03-11 16:48:35 +00:00
|
|
|
cordaCompile project(':client:rpc')
|
2016-11-22 18:09:56 +00:00
|
|
|
// Corda integration dependencies
|
2018-10-15 21:11:52 +01:00
|
|
|
cordaRuntime project(path: ":node:capsule", configuration: 'runtimeArtifacts')
|
2019-03-11 16:48:35 +00:00
|
|
|
|
|
|
|
// 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 11:57:56 +01:00
|
|
|
cordaRuntime "org.slf4j:slf4j-simple:$slf4j_version"
|
2019-01-23 13:26:33 +00:00
|
|
|
|
|
|
|
// Notary implementations
|
|
|
|
cordapp project(':samples:notary-demo:contracts')
|
|
|
|
cordapp project(':samples:notary-demo:workflows')
|
2016-11-22 18:09:56 +00:00
|
|
|
}
|
|
|
|
|
2018-10-15 21:11:52 +01:00
|
|
|
def nodeTask = tasks.getByPath(':node:capsule:assemble')
|
2019-09-26 10:20:49 +01:00
|
|
|
def webTask = tasks.getByPath(':testing:testserver:testcapsule::assemble')
|
2018-10-15 21:11:52 +01:00
|
|
|
|
2017-10-13 10:36:25 +01:00
|
|
|
task deployNodes(dependsOn: ['deployNodesSingle', 'deployNodesRaft', 'deployNodesBFT', 'deployNodesCustom'])
|
2017-05-31 11:14:53 +01:00
|
|
|
|
2018-10-15 21:11:52 +01:00
|
|
|
task deployNodesSingle(type: Cordform, dependsOn: ['jar', nodeTask, webTask]) {
|
2018-08-24 16:29:14 +01:00
|
|
|
directory file("$buildDir/nodes/nodesSingle")
|
|
|
|
nodeDefaults {
|
2019-01-23 13:26:33 +00:00
|
|
|
projectCordapp {
|
|
|
|
deploy = false
|
|
|
|
}
|
2018-08-24 16:29:14 +01:00
|
|
|
extraConfig = [h2Settings: [address: "localhost:0"]]
|
2019-01-23 13:26:33 +00:00
|
|
|
cordapp project(':samples:notary-demo:contracts')
|
|
|
|
cordapp project(':samples:notary-demo:workflows')
|
2020-06-15 15:52:31 +01:00
|
|
|
runSchemaMigration = true
|
2018-08-24 16:29:14 +01:00
|
|
|
}
|
|
|
|
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"]]]
|
|
|
|
}
|
2023-08-24 16:56:11 +01:00
|
|
|
node {
|
|
|
|
name "O=Bob Plc,L=Rome,C=IT"
|
|
|
|
p2pPort 10005
|
|
|
|
rpcSettings {
|
|
|
|
address "localhost:10006"
|
|
|
|
adminAddress "localhost:10007"
|
|
|
|
}
|
|
|
|
rpcUsers = [[user: "demou", password: "demop", permissions: ["ALL"]]]
|
|
|
|
}
|
2018-08-24 16:29:14 +01:00
|
|
|
node {
|
2020-07-20 10:59:08 +01:00
|
|
|
name "O=Notary Node,L=Zurich,C=CH"
|
2018-08-24 16:29:14 +01:00
|
|
|
p2pPort 10009
|
|
|
|
rpcSettings {
|
|
|
|
address "localhost:10010"
|
|
|
|
adminAddress "localhost:10110"
|
|
|
|
}
|
2020-07-20 10:59:08 +01:00
|
|
|
notary = [validating: true,
|
|
|
|
serviceLegalName: "O=Notary Service,L=Zurich,C=CH"
|
|
|
|
]
|
2018-08-24 16:29:14 +01:00
|
|
|
}
|
2016-11-22 18:09:56 +00:00
|
|
|
}
|
|
|
|
|
2018-10-15 21:11:52 +01:00
|
|
|
task deployNodesCustom(type: Cordform, dependsOn: ['jar', nodeTask, webTask]) {
|
2018-08-24 16:29:14 +01:00
|
|
|
directory file("$buildDir/nodes/nodesCustom")
|
|
|
|
nodeDefaults {
|
2019-01-23 13:26:33 +00:00
|
|
|
projectCordapp {
|
|
|
|
deploy = false
|
|
|
|
}
|
2018-08-24 16:29:14 +01:00
|
|
|
extraConfig = [h2Settings: [address: "localhost:0"]]
|
2019-01-23 13:26:33 +00:00
|
|
|
cordapp project(':samples:notary-demo:contracts')
|
|
|
|
cordapp project(':samples:notary-demo:workflows')
|
2018-08-24 16:29:14 +01:00
|
|
|
}
|
|
|
|
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"]]]
|
|
|
|
}
|
2023-08-24 16:56:11 +01:00
|
|
|
node {
|
|
|
|
name "O=Bob Plc,L=Rome,C=IT"
|
|
|
|
p2pPort 10005
|
|
|
|
rpcSettings {
|
|
|
|
address "localhost:10006"
|
|
|
|
adminAddress "localhost:10007"
|
|
|
|
}
|
|
|
|
rpcUsers = [[user: "demou", password: "demop", permissions: ["ALL"]]]
|
|
|
|
}
|
2018-08-24 16:29:14 +01:00
|
|
|
node {
|
2020-07-20 10:59:08 +01:00
|
|
|
name "O=Notary Node,L=Zurich,C=CH"
|
2018-08-24 16:29:14 +01:00
|
|
|
p2pPort 10009
|
|
|
|
rpcSettings {
|
|
|
|
address "localhost:10010"
|
|
|
|
adminAddress "localhost:10110"
|
|
|
|
}
|
2018-10-10 13:31:29 +01:00
|
|
|
notary = [
|
|
|
|
validating: true,
|
2020-07-20 10:59:08 +01:00
|
|
|
className: "net.corda.notarydemo.MyCustomValidatingNotaryService",
|
|
|
|
serviceLegalName: "O=Notary Service,L=Zurich,C=CH"
|
2018-10-10 13:31:29 +01:00
|
|
|
]
|
2018-08-24 16:29:14 +01:00
|
|
|
}
|
2017-10-13 10:36:25 +01:00
|
|
|
}
|
|
|
|
|
2018-10-15 21:11:52 +01:00
|
|
|
task deployNodesRaft(type: Cordform, dependsOn: ['jar', nodeTask, webTask]) {
|
2018-08-24 16:29:14 +01:00
|
|
|
directory file("$buildDir/nodes/nodesRaft")
|
|
|
|
nodeDefaults {
|
2019-01-23 13:26:33 +00:00
|
|
|
projectCordapp {
|
|
|
|
deploy = false
|
|
|
|
}
|
2018-08-24 16:29:14 +01:00
|
|
|
extraConfig = [h2Settings: [address: "localhost:0"]]
|
2019-01-23 13:26:33 +00:00
|
|
|
cordapp project(':samples:notary-demo:contracts')
|
|
|
|
cordapp project(':samples:notary-demo:workflows')
|
2018-08-24 16:29:14 +01:00
|
|
|
}
|
|
|
|
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"]]]
|
|
|
|
}
|
2023-08-24 16:56:11 +01:00
|
|
|
node {
|
|
|
|
name "O=Bob Plc,L=Rome,C=IT"
|
|
|
|
p2pPort 10005
|
|
|
|
rpcSettings {
|
|
|
|
address "localhost:10006"
|
|
|
|
adminAddress "localhost:10007"
|
|
|
|
}
|
|
|
|
rpcUsers = [[user: "demou", password: "demop", permissions: ["ALL"]]]
|
|
|
|
}
|
2018-08-24 16:29:14 +01:00
|
|
|
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",
|
2019-01-09 15:52:42 +00:00
|
|
|
raft: [
|
2018-08-24 16:29:14 +01:00
|
|
|
nodeAddress: "localhost:10008"
|
2019-01-09 15:52:42 +00:00
|
|
|
]
|
2018-08-24 16:29:14 +01:00
|
|
|
]
|
|
|
|
}
|
|
|
|
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",
|
2019-01-09 15:52:42 +00:00
|
|
|
raft: [
|
2018-08-24 16:29:14 +01:00
|
|
|
nodeAddress: "localhost:10012",
|
|
|
|
clusterAddresses: ["localhost:10008"]
|
2019-01-09 15:52:42 +00:00
|
|
|
]
|
2018-08-24 16:29:14 +01:00
|
|
|
]
|
|
|
|
}
|
|
|
|
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",
|
2019-01-09 15:52:42 +00:00
|
|
|
raft: [
|
2018-08-24 16:29:14 +01:00
|
|
|
nodeAddress: "localhost:10016",
|
|
|
|
clusterAddresses: ["localhost:10008"]
|
2019-01-09 15:52:42 +00:00
|
|
|
]
|
2018-08-24 16:29:14 +01:00
|
|
|
]
|
|
|
|
}
|
2016-11-22 18:09:56 +00:00
|
|
|
}
|
|
|
|
|
2018-10-15 21:11:52 +01:00
|
|
|
task deployNodesBFT(type: Cordform, dependsOn: ['jar', nodeTask, webTask]) {
|
2018-08-24 16:29:14 +01:00
|
|
|
def clusterAddresses = ["localhost:11000", "localhost:11010", "localhost:11020", "localhost:11030"]
|
|
|
|
directory file("$buildDir/nodes/nodesBFT")
|
|
|
|
nodeDefaults {
|
2019-01-23 13:26:33 +00:00
|
|
|
projectCordapp {
|
|
|
|
deploy = false
|
|
|
|
}
|
2018-08-24 16:29:14 +01:00
|
|
|
extraConfig = [h2Settings: [address: "localhost:0"]]
|
2019-01-23 13:26:33 +00:00
|
|
|
cordapp project(':samples:notary-demo:contracts')
|
|
|
|
cordapp project(':samples:notary-demo:workflows')
|
2018-08-24 16:29:14 +01:00
|
|
|
}
|
|
|
|
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"]]]
|
2023-08-24 16:56:11 +01:00
|
|
|
}
|
|
|
|
node {
|
|
|
|
name "O=Bob Plc,L=Rome,C=IT"
|
|
|
|
p2pPort 10005
|
|
|
|
rpcSettings {
|
|
|
|
address "localhost:10006"
|
|
|
|
adminAddress "localhost:10007"
|
|
|
|
}
|
|
|
|
rpcUsers = [[user: "demou", password: "demop", permissions: ["ALL"]]]
|
2018-08-24 16:29:14 +01:00
|
|
|
}
|
|
|
|
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",
|
2019-01-09 15:52:42 +00:00
|
|
|
bftSMaRt: [
|
2018-08-24 16:29:14 +01:00
|
|
|
replicaId: 0,
|
|
|
|
clusterAddresses: clusterAddresses
|
2019-01-09 15:52:42 +00:00
|
|
|
]
|
2018-08-24 16:29:14 +01:00
|
|
|
]
|
|
|
|
}
|
|
|
|
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",
|
2019-01-09 15:52:42 +00:00
|
|
|
bftSMaRt: [
|
2018-10-10 10:04:22 +01:00
|
|
|
replicaId: 1,
|
2018-08-24 16:29:14 +01:00
|
|
|
clusterAddresses: clusterAddresses
|
2019-01-09 15:52:42 +00:00
|
|
|
]
|
2018-08-24 16:29:14 +01:00
|
|
|
]
|
|
|
|
}
|
|
|
|
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",
|
2019-01-09 15:52:42 +00:00
|
|
|
bftSMaRt: [
|
2018-10-10 10:04:22 +01:00
|
|
|
replicaId: 2,
|
2018-08-24 16:29:14 +01:00
|
|
|
clusterAddresses: clusterAddresses
|
2019-01-09 15:52:42 +00:00
|
|
|
]
|
2018-08-24 16:29:14 +01:00
|
|
|
]
|
|
|
|
}
|
|
|
|
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",
|
2019-01-09 15:52:42 +00:00
|
|
|
bftSMaRt: [
|
2018-10-10 10:04:22 +01:00
|
|
|
replicaId: 3,
|
2018-08-24 16:29:14 +01:00
|
|
|
clusterAddresses: clusterAddresses
|
2019-01-09 15:52:42 +00:00
|
|
|
]
|
2018-08-24 16:29:14 +01:00
|
|
|
]
|
|
|
|
}
|
2017-05-24 12:25:06 +01:00
|
|
|
}
|
|
|
|
|
2019-03-11 16:48:35 +00:00
|
|
|
task notarise(type: JavaExec, dependsOn: jar) {
|
2016-11-22 18:09:56 +00:00
|
|
|
classpath = sourceSets.main.runtimeClasspath
|
2019-03-11 16:48:35 +00:00
|
|
|
main = 'net.corda.notarydemo.client.NotariseKt'
|
2016-11-22 18:09:56 +00:00
|
|
|
}
|