diff --git a/settings.gradle b/settings.gradle index 50d2165602..5848cc6751 100644 --- a/settings.gradle +++ b/settings.gradle @@ -11,6 +11,7 @@ include 'netpermission' include 'experimental' include 'experimental:sandbox' include 'test-utils' +include 'tools:demobench' include 'tools:explorer' include 'tools:loadtest' include 'docs/source/example-code' // Note that we are deliberately choosing to use '/' here. With ':' gradle would treat the directories as actual projects. @@ -20,4 +21,5 @@ include 'samples:irs-demo' include 'samples:network-visualiser' include 'samples:simm-valuation-demo' include 'samples:raft-notary-demo' -include 'samples:bank-of-corda-demo' \ No newline at end of file +include 'samples:bank-of-corda-demo' + diff --git a/tools/demobench/build.gradle b/tools/demobench/build.gradle new file mode 100644 index 0000000000..c6dded517b --- /dev/null +++ b/tools/demobench/build.gradle @@ -0,0 +1,30 @@ +group 'net.corda' +version '0.7-SNAPSHOT' + +buildscript { + ext.kotlin_version = '1.0.6' + + repositories { + mavenCentral() + } + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +apply plugin: 'java' +apply plugin: 'kotlin' + +sourceCompatibility = 1.8 + +repositories { + mavenCentral() +} + +dependencies { + compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" + testCompile group: 'junit', name: 'junit', version: '4.11' + + // TornadoFX: A lightweight Kotlin framework for working with JavaFX UI's. + compile 'no.tornado:tornadofx:1.5.7' +} diff --git a/tools/demobench/src/main/kotlin/net/corda/demobench/DemoBench.kt b/tools/demobench/src/main/kotlin/net/corda/demobench/DemoBench.kt new file mode 100644 index 0000000000..84b84da37a --- /dev/null +++ b/tools/demobench/src/main/kotlin/net/corda/demobench/DemoBench.kt @@ -0,0 +1,37 @@ +package net.corda.demobench + +import tornadofx.App + +/** + * README! + * + * + * This tool is intended to become a sales and educational tool for Corda. It is a standalone desktop app that + * comes bundled with an appropriate JVM, and which runs nodes in a local network. It has the following features: + * + * - New nodes can be added at the click of a button. Clicking "Add node" creates new tab that lets you edit the + * most important configuration properties of the node before launch, like the name and what apps will be loaded. + * + * - Each tab contains a terminal emulator, attached to the pty of the node. This lets you see console output and + * (soon) interact with the command shell of the node. See the mike-crshell branch in github. + * + * - An Explorer instance for the node can be launched at the click of a button. Credentials are handed to the + * Explorer so it starts out logged in already. + * + * - Some basic statistics are shown about each node, informed via the RPC connection. + * + * - Another button launches a database viewer (like the H2 web site) for the node. For instance, in an embedded + * WebView, or the system browser. + * + * - It can also run a Jetty instance that can load WARs that come with the bundled CorDapps (eventually). + * + * The app is nicely themed using the Corda branding. It is easy enough to use for non-developers to successfully + * demonstrate some example cordapps and why people should get excited about the platform. There is no setup + * overhead as everything is included: just double click the icon and start going through the script. There are no + * dependencies on external servers or network connections, so flaky conference room wifi should not be an issue. + */ + +class DemoBench : App(DemoBenchView::class) { + init { + } +} \ No newline at end of file diff --git a/tools/demobench/src/main/kotlin/net/corda/demobench/DemoBenchView.kt b/tools/demobench/src/main/kotlin/net/corda/demobench/DemoBenchView.kt new file mode 100644 index 0000000000..e81c5f706e --- /dev/null +++ b/tools/demobench/src/main/kotlin/net/corda/demobench/DemoBenchView.kt @@ -0,0 +1,13 @@ +package net.corda.demobench + +import javafx.scene.Parent +import tornadofx.View +import tornadofx.importStylesheet + +class DemoBenchView : View("Corda Demo Bench") { + override val root: Parent by fxml() + + init { + importStylesheet("/net/corda/demobench/style.css") + } +} diff --git a/tools/demobench/src/main/resources/net/corda/demobench/DemoBenchView.fxml b/tools/demobench/src/main/resources/net/corda/demobench/DemoBenchView.fxml new file mode 100644 index 0000000000..f04e7fe355 --- /dev/null +++ b/tools/demobench/src/main/resources/net/corda/demobench/DemoBenchView.fxml @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/demobench/src/main/resources/net/corda/demobench/mock-term.png b/tools/demobench/src/main/resources/net/corda/demobench/mock-term.png new file mode 100644 index 0000000000..4df6fc8808 Binary files /dev/null and b/tools/demobench/src/main/resources/net/corda/demobench/mock-term.png differ diff --git a/tools/demobench/src/main/resources/net/corda/demobench/style.css b/tools/demobench/src/main/resources/net/corda/demobench/style.css new file mode 100644 index 0000000000..e25cf329c2 --- /dev/null +++ b/tools/demobench/src/main/resources/net/corda/demobench/style.css @@ -0,0 +1,23 @@ +/* + * https://r3-cev.atlassian.net/wiki/display/RH/Color+Palettes + */ + +.header { + -fx-background-color: #505050; + -fx-padding: 15px; +} + +.header Label { + -fx-font-size: 14pt; + -fx-text-fill: white; +} + +.add-node-button { + -fx-base: red; +} + +.big-button { + -fx-base: #009759; + -fx-background-radius: 5px; + -fx-opacity: 80%; +} \ No newline at end of file