|
| 1 | +buildscript {//properties that you need to build the project |
| 2 | + Properties constants = new Properties() |
| 3 | + file("$projectDir/../constants.properties").withInputStream { constants.load(it) } |
| 4 | + |
| 5 | + ext { |
| 6 | + corda_release_group = constants.getProperty("cordaReleaseGroup") |
| 7 | + corda_core_release_group = constants.getProperty("cordaCoreReleaseGroup") |
| 8 | + corda_release_version = constants.getProperty("cordaVersion") |
| 9 | + corda_core_release_version = constants.getProperty("cordaCoreVersion") |
| 10 | + corda_gradle_plugins_version = constants.getProperty("gradlePluginsVersion") |
| 11 | + kotlin_version = constants.getProperty("kotlinVersion") |
| 12 | + junit_version = constants.getProperty("junitVersion") |
| 13 | + quasar_version = constants.getProperty("quasarVersion") |
| 14 | + log4j_version = constants.getProperty("log4jVersion") |
| 15 | + slf4j_version = constants.getProperty("slf4jVersion") |
| 16 | + corda_platform_version = constants.getProperty("platformVersion").toInteger() |
| 17 | + //springboot |
| 18 | + spring_boot_version = '2.0.2.RELEASE' |
| 19 | + spring_boot_gradle_plugin_version = '2.0.2.RELEASE' |
| 20 | + } |
| 21 | + |
| 22 | + repositories { |
| 23 | + mavenLocal() |
| 24 | + mavenCentral() |
| 25 | + jcenter() |
| 26 | + maven { url 'https://software.r3.com/artifactory/corda-releases' } |
| 27 | + } |
| 28 | + |
| 29 | + dependencies { |
| 30 | + classpath "net.corda.plugins:cordapp:$corda_gradle_plugins_version" |
| 31 | + classpath "net.corda.plugins:cordformation:$corda_gradle_plugins_version" |
| 32 | + classpath "net.corda.plugins:quasar-utils:$corda_gradle_plugins_version" |
| 33 | + classpath "org.springframework.boot:spring-boot-gradle-plugin:$spring_boot_gradle_plugin_version" |
| 34 | + } |
| 35 | +} |
| 36 | + |
| 37 | +allprojects {//Properties that you need to compile your project (The application) |
| 38 | + apply from: "${rootProject.projectDir}/repositories.gradle" |
| 39 | + apply plugin: 'java' |
| 40 | + |
| 41 | + repositories { |
| 42 | + mavenLocal() |
| 43 | + jcenter() |
| 44 | + mavenCentral() |
| 45 | + maven { url 'https://software.r3.com/artifactory/corda' } |
| 46 | + maven { url 'https://jitpack.io' } |
| 47 | + } |
| 48 | + |
| 49 | + tasks.withType(JavaCompile) { |
| 50 | + options.compilerArgs << "-parameters" // Required by Corda's serialisation framework. |
| 51 | + } |
| 52 | + |
| 53 | + jar { |
| 54 | + // This makes the JAR's SHA-256 hash repeatable. |
| 55 | + preserveFileTimestamps = false |
| 56 | + reproducibleFileOrder = true |
| 57 | + duplicatesStrategy = DuplicatesStrategy.EXCLUDE |
| 58 | + } |
| 59 | +} |
| 60 | + |
| 61 | +apply plugin: 'net.corda.plugins.cordapp' |
| 62 | +apply plugin: 'net.corda.plugins.cordformation' |
| 63 | +apply plugin: 'net.corda.plugins.quasar-utils' |
| 64 | + |
| 65 | +sourceSets { |
| 66 | + main { |
| 67 | + resources { |
| 68 | + srcDir rootProject.file("config/dev") |
| 69 | + } |
| 70 | + } |
| 71 | +} |
| 72 | +//Module dependencis |
| 73 | +dependencies { |
| 74 | + // Corda dependencies. |
| 75 | + cordaCompile "$corda_core_release_group:corda-core:$corda_core_release_version" |
| 76 | + cordaCompile "$corda_release_group:corda-node-api:$corda_release_version" |
| 77 | + cordaRuntime "$corda_release_group:corda:$corda_release_version" |
| 78 | + |
| 79 | + // CorDapp dependencies. |
| 80 | + cordapp project(":workflows") |
| 81 | + cordapp project(":contracts") |
| 82 | + |
| 83 | + cordaCompile "org.apache.logging.log4j:log4j-slf4j-impl:${log4j_version}" |
| 84 | + cordaCompile "org.apache.logging.log4j:log4j-web:${log4j_version}" |
| 85 | + cordaCompile "org.slf4j:jul-to-slf4j:$slf4j_version" |
| 86 | +} |
| 87 | + |
| 88 | + |
| 89 | +//Task to deploy the nodes in order to bootstrap a network |
| 90 | +task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar']) { |
| 91 | + |
| 92 | + /* This property will load the CorDapps to each of the node by default, including the Notary. You can find them |
| 93 | + * in the cordapps folder of the node at build/nodes/Notary/cordapps. However, the notary doesn't really understand |
| 94 | + * the notion of cordapps. In production, Notary does not need cordapps as well. This is just a short cut to load |
| 95 | + * the Corda network bootstrapper. |
| 96 | + */ |
| 97 | + nodeDefaults { |
| 98 | + projectCordapp { |
| 99 | + deploy = false |
| 100 | + } |
| 101 | + cordapp project(':contracts') |
| 102 | + cordapp project(':workflows') |
| 103 | + runSchemaMigration = true //This configuration is for any CorDapps with custom schema, We will leave this as true to avoid |
| 104 | + //problems for developers who are not familiar with Corda. If you are not using custom schemas, you can change |
| 105 | + //it to false for quicker project compiling time. |
| 106 | + } |
| 107 | + node { |
| 108 | + name "O=Notary,L=London,C=GB" |
| 109 | + notary = [validating : false] |
| 110 | + p2pPort 10002 |
| 111 | + rpcSettings { |
| 112 | + address("localhost:10003") |
| 113 | + adminAddress("localhost:10043") |
| 114 | + } |
| 115 | + } |
| 116 | + node { |
| 117 | + name "O=BankA,L=London,C=GB" |
| 118 | + p2pPort 10005 |
| 119 | + rpcSettings { |
| 120 | + address("localhost:10006") |
| 121 | + adminAddress("localhost:10046") |
| 122 | + } |
| 123 | + rpcUsers = [[ user: "user1", "password": "test", "permissions": ["ALL"]]] |
| 124 | + } |
| 125 | + node { |
| 126 | + name "O=BankB,L=New York,C=US" |
| 127 | + p2pPort 10008 |
| 128 | + rpcSettings { |
| 129 | + address("localhost:10009") |
| 130 | + adminAddress("localhost:10049") |
| 131 | + } |
| 132 | + rpcUsers = [[ user: "user1", "password": "test", "permissions": ["ALL"]]] |
| 133 | + } |
| 134 | + node { |
| 135 | + name "O=Trusted Auditor,L=New York,C=US" |
| 136 | + p2pPort 10011 |
| 137 | + rpcSettings { |
| 138 | + address("localhost:10012") |
| 139 | + adminAddress("localhost:10052") |
| 140 | + } |
| 141 | + rpcUsers = [[ user: "user1", "password": "test", "permissions": ["ALL"]]] |
| 142 | + } |
| 143 | + node { |
| 144 | + name "O=Regulator,L=New York,C=US" |
| 145 | + p2pPort 10014 |
| 146 | + rpcSettings { |
| 147 | + address("localhost:10015") |
| 148 | + adminAddress("localhost:10055") |
| 149 | + } |
| 150 | + rpcUsers = [[ user: "user1", "password": "test", "permissions": ["ALL"]]] |
| 151 | + } |
| 152 | +} |
0 commit comments