Add basic spec for the demobench tool.

This commit is contained in:
Mike Hearn 2017-01-18 15:02:23 +01:00
parent f3f43a0364
commit 906dff1a35
7 changed files with 178 additions and 1 deletions

View File

@ -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'
include 'samples:bank-of-corda-demo'

View File

@ -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'
}

View File

@ -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 {
}
}

View File

@ -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")
}
}

View File

@ -0,0 +1,72 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.Tab?>
<?import javafx.scene.control.TabPane?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.Pane?>
<?import javafx.scene.layout.StackPane?>
<?import javafx.scene.layout.VBox?>
<StackPane xmlns="http://javafx.com/javafx/8.0.111" xmlns:fx="http://javafx.com/fxml/1">
<children>
<TabPane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minHeight="444.0" minWidth="800.0" prefHeight="613.0" prefWidth="1231.0" tabClosingPolicy="UNAVAILABLE" tabMinHeight="30.0">
<tabs>
<Tab text="Bank A">
<content>
<VBox prefHeight="953.0" prefWidth="1363.0">
<children>
<HBox prefHeight="95.0" prefWidth="800.0" spacing="15.0" styleClass="header">
<children>
<VBox prefHeight="66.0" prefWidth="296.0" spacing="20.0">
<children>
<Label style="-fx-font-size: 40; -fx-text-fill: red;" text="Bank A" />
<Label style="-fx-text-fill: white;" text="P2P port: 20004" />
</children>
</VBox>
<VBox prefHeight="93.0" prefWidth="267.0">
<children>
<Label maxWidth="1.7976931348623157E308" text="States in vault: 20" />
<Label text="Known transactions: 45" />
<Label text="Balance: $1024" />
</children>
</VBox>
<Pane prefHeight="200.0" prefWidth="200.0" HBox.hgrow="ALWAYS" />
<Button mnemonicParsing="false" prefHeight="92.0" prefWidth="115.0" styleClass="big-button" text="View&#10;Database" textAlignment="CENTER" />
<Button mnemonicParsing="false" prefHeight="92.0" prefWidth="115.0" styleClass="big-button" text="Launch&#10;Explorer" textAlignment="CENTER" />
</children>
</HBox>
<StackPane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" style="-fx-background-color: black;" VBox.vgrow="ALWAYS">
<children>
<ImageView fitWidth="1000.0" pickOnBounds="true" preserveRatio="true" StackPane.alignment="TOP_LEFT">
<image>
<Image url="@mock-term.png" />
</image>
</ImageView>
</children>
</StackPane>
</children>
</VBox>
</content>
</Tab>
<Tab text="Bank B" />
<Tab text="Bank of Corda">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0" />
</content>
</Tab>
</tabs>
</TabPane>
<Button mnemonicParsing="false" styleClass="add-node-button" text="Add Node" StackPane.alignment="TOP_RIGHT">
<StackPane.margin>
<Insets right="5.0" top="5.0" />
</StackPane.margin>
</Button>
</children>
</StackPane>

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB

View File

@ -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%;
}