2017-05-16 10:30:50 +00:00
|
|
|
import net.corda.plugins.Cordform
|
|
|
|
|
2016-11-22 18:09:56 +00:00
|
|
|
apply plugin: 'java'
|
|
|
|
apply plugin: 'kotlin'
|
|
|
|
apply plugin: 'idea'
|
|
|
|
apply plugin: 'net.corda.plugins.quasar-utils'
|
2017-10-09 19:08:08 +00:00
|
|
|
apply plugin: 'net.corda.plugins.cordapp'
|
2016-11-22 18:09:56 +00:00
|
|
|
apply plugin: 'net.corda.plugins.cordformation'
|
|
|
|
|
|
|
|
configurations {
|
|
|
|
integrationTestCompile.extendsFrom testCompile
|
|
|
|
integrationTestRuntime.extendsFrom testRuntime
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2018-04-24 13:03:41 +00:00
|
|
|
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
2016-11-22 18:09:56 +00:00
|
|
|
|
|
|
|
// Corda integration dependencies
|
2018-10-15 20:11:52 +00:00
|
|
|
cordaRuntime project(path: ":node:capsule", configuration: 'runtimeArtifacts')
|
|
|
|
cordaRuntime project(path: ":webserver:webcapsule", configuration: 'runtimeArtifacts')
|
2017-07-27 16:53:51 +00:00
|
|
|
cordaCompile project(':core')
|
|
|
|
cordaCompile project(':client:jfx')
|
|
|
|
cordaCompile project(':client:rpc')
|
2018-10-10 09:04:22 +00:00
|
|
|
cordaCompile project(':test-utils')
|
2016-11-22 18:09:56 +00:00
|
|
|
}
|
|
|
|
|
2018-10-15 20:11:52 +00:00
|
|
|
def nodeTask = tasks.getByPath(':node:capsule:assemble')
|
|
|
|
def webTask = tasks.getByPath(':webserver:webcapsule:assemble')
|
|
|
|
|
2017-10-13 09:36:25 +00:00
|
|
|
task deployNodes(dependsOn: ['deployNodesSingle', 'deployNodesRaft', 'deployNodesBFT', 'deployNodesCustom'])
|
2017-05-31 10:14:53 +00:00
|
|
|
|
2018-10-15 20:11:52 +00:00
|
|
|
task deployNodesSingle(type: Cordform, dependsOn: ['jar', nodeTask, webTask]) {
|
2018-08-24 15:29:14 +00:00
|
|
|
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]
|
|
|
|
}
|
2016-11-22 18:09:56 +00:00
|
|
|
}
|
|
|
|
|
2018-10-15 20:11:52 +00:00
|
|
|
task deployNodesCustom(type: Cordform, dependsOn: ['jar', nodeTask, webTask]) {
|
2018-08-24 15:29:14 +00:00
|
|
|
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"
|
|
|
|
}
|
2018-10-10 12:31:29 +00:00
|
|
|
notary = [
|
|
|
|
validating: true,
|
|
|
|
className: "net.corda.notarydemo.MyCustomValidatingNotaryService"
|
|
|
|
]
|
2018-08-24 15:29:14 +00:00
|
|
|
}
|
2017-10-13 09:36:25 +00:00
|
|
|
}
|
|
|
|
|
2018-10-15 20:11:52 +00:00
|
|
|
task deployNodesRaft(type: Cordform, dependsOn: ['jar', nodeTask, webTask]) {
|
2019-01-09 15:52:42 +00:00
|
|
|
def className = ""
|
2018-08-24 15:29:14 +00:00
|
|
|
directory file("$buildDir/nodes/nodesRaft")
|
|
|
|
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 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 15:29:14 +00:00
|
|
|
nodeAddress: "localhost:10008"
|
2019-01-09 15:52:42 +00:00
|
|
|
]
|
2018-08-24 15:29:14 +00: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 15:29:14 +00:00
|
|
|
nodeAddress: "localhost:10012",
|
|
|
|
clusterAddresses: ["localhost:10008"]
|
2019-01-09 15:52:42 +00:00
|
|
|
]
|
2018-08-24 15:29:14 +00: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 15:29:14 +00:00
|
|
|
nodeAddress: "localhost:10016",
|
|
|
|
clusterAddresses: ["localhost:10008"]
|
2019-01-09 15:52:42 +00:00
|
|
|
]
|
2018-08-24 15:29:14 +00:00
|
|
|
]
|
|
|
|
}
|
2016-11-22 18:09:56 +00:00
|
|
|
}
|
|
|
|
|
2018-10-15 20:11:52 +00:00
|
|
|
task deployNodesBFT(type: Cordform, dependsOn: ['jar', nodeTask, webTask]) {
|
2018-08-24 15:29:14 +00:00
|
|
|
def clusterAddresses = ["localhost:11000", "localhost:11010", "localhost:11020", "localhost:11030"]
|
|
|
|
directory file("$buildDir/nodes/nodesBFT")
|
|
|
|
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 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 15:29:14 +00:00
|
|
|
replicaId: 0,
|
|
|
|
clusterAddresses: clusterAddresses
|
2019-01-09 15:52:42 +00:00
|
|
|
]
|
2018-08-24 15:29:14 +00: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 09:04:22 +00:00
|
|
|
replicaId: 1,
|
2018-08-24 15:29:14 +00:00
|
|
|
clusterAddresses: clusterAddresses
|
2019-01-09 15:52:42 +00:00
|
|
|
]
|
2018-08-24 15:29:14 +00: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 09:04:22 +00:00
|
|
|
replicaId: 2,
|
2018-08-24 15:29:14 +00:00
|
|
|
clusterAddresses: clusterAddresses
|
2019-01-09 15:52:42 +00:00
|
|
|
]
|
2018-08-24 15:29:14 +00: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 09:04:22 +00:00
|
|
|
replicaId: 3,
|
2018-08-24 15:29:14 +00:00
|
|
|
clusterAddresses: clusterAddresses
|
2019-01-09 15:52:42 +00:00
|
|
|
]
|
2018-08-24 15:29:14 +00:00
|
|
|
]
|
|
|
|
}
|
2017-05-24 11:25:06 +00:00
|
|
|
}
|
|
|
|
|
2016-11-22 18:09:56 +00:00
|
|
|
task notarise(type: JavaExec) {
|
|
|
|
classpath = sourceSets.main.runtimeClasspath
|
2017-05-18 14:58:35 +00:00
|
|
|
main = 'net.corda.notarydemo.NotariseKt'
|
2016-11-22 18:09:56 +00:00
|
|
|
}
|
2017-10-06 14:37:33 +00:00
|
|
|
|
|
|
|
jar {
|
|
|
|
manifest {
|
|
|
|
attributes(
|
|
|
|
'Automatic-Module-Name': 'net.corda.samples.demos.notary'
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
2018-10-15 20:11:52 +00:00
|
|
|
|
|
|
|
cordapp {
|
2018-12-14 09:39:23 +00:00
|
|
|
targetPlatformVersion corda_platform_version.toInteger()
|
|
|
|
minimumPlatformVersion 1
|
|
|
|
workflow {
|
2018-10-15 20:11:52 +00:00
|
|
|
name "net/corda/samples/notary-demo"
|
2018-12-14 09:39:23 +00:00
|
|
|
versionId 1
|
|
|
|
vendor "R3"
|
|
|
|
licence "Open Source (Apache 2)"
|
2018-10-15 20:11:52 +00:00
|
|
|
}
|
|
|
|
}
|