-
Notifications
You must be signed in to change notification settings - Fork 157
Expand file tree
/
Copy pathbuild.gradle
More file actions
108 lines (98 loc) · 3.43 KB
/
build.gradle
File metadata and controls
108 lines (98 loc) · 3.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
import static org.gradle.jvm.toolchain.JavaLanguageVersion.of
import net.corda.plugins.Cordform
plugins {
id 'net.corda.plugins.cordformation'
id 'base'
}
configurations {
ganache {
canBeConsumed = false
transitive = false
}
}
subprojects { //Properties that you need to compile your project (The application)
pluginManager.withPlugin('java') {
java {
toolchain {
languageVersion = of(8)
}
}
tasks.withType(JavaCompile).configureEach {
options.compilerArgs << "-parameters" // Required by Corda's serialisation framework.
}
}
def subPath = it.path
pluginManager.withPlugin('net.corda.plugins.cordapp') {
rootProject.dependencies {
ganache project(path: subPath, configuration: 'cordaCordapp')
}
}
configurations.matching { it.name.endsWith("Classpath") }.configureEach {
resolutionStrategy {
dependencySubstitution {
substitute module('com.fasterxml.jackson.module:jackson-module-kotlin') with module("com.fasterxml.jackson.module:jackson-module-kotlin:2.9.7")
substitute module('org.gradle:gradle-tooling-api') with module("org.gradle:gradle-tooling-api:${gradle.gradleVersion}")
}
}
}
}
//Module dependencis
dependencies {
cordaBootstrapper "$corda_release_group:corda-node-api:$corda_release_version"
cordaBootstrapper "org.slf4j:slf4j-simple:$slf4j_version"
corda "$corda_release_group:corda:$corda_release_version"
// CorDapp dependencies.
cordapp project(':workflows')
cordapp project(':contracts')
}
//Task to build the jar for ganache.
tasks.register('ganache') {
dependsOn configurations.ganache.buildDependencies
doLast {
copy {
from configurations.ganache
into layout.buildDirectory.dir('libs')
}
}
}
tasks.register('deployNodes', Cordform) {
/* This property will load the CorDapps to each of the node by default, including the Notary. You can find them
* in the cordapps folder of the node at build/nodes/Notary/cordapps. However, the notary doesn't really understand
* the notion of cordapps. In production, Notary does not need cordapps as well. This is just a short cut to load
* the Corda network bootstrapper.
*/
nodeDefaults {
cordapp project(':workflows')
cordapp project(':contracts')
rpcUsers = [[user: "user1", "password": "test", "permissions": ["ALL"]]]
runSchemaMigration = true //This configuration is for any CorDapps with custom schema, We will leave this as true to avoid
//problems for developers who are not familiar with Corda. If you are not using custom schemas, you can change
//it to false for quicker project compiling time.
}
node {
name "O=Notary,L=London,C=GB"
notary = [validating : false]
p2pPort 10002
rpcSettings {
address("localhost:10003")
adminAddress("localhost:10043")
}
rpcUsers = []
}
node {
name "O=PartyA,L=London,C=GB"
p2pPort 10005
rpcSettings {
address("localhost:10006")
adminAddress("localhost:10046")
}
}
node {
name "O=PartyB,L=New York,C=US"
p2pPort 10008
rpcSettings {
address("localhost:10009")
adminAddress("localhost:10049")
}
}
}