Merged in clint-windowsrunnodes (pull request #489)

Can now run nodes via a batch file on windows
This commit is contained in:
Clinton Alexander 2016-11-18 10:39:25 +00:00
commit dede118c58
7 changed files with 17 additions and 8 deletions

View File

@ -245,7 +245,8 @@ You can create more configurations with new tasks that extend Cordform.
New nodes can be added by simply adding another node block and giving it a different name, directory and ports. When you
run this task it will install the nodes to the directory specified and a script will be generated (for UNIX users only
at present) to run the nodes with one command (``runnodes``). On MacOS X this script will run each node in a new
terminal tab, and on Linux it will open up a new XTerm for each node.
terminal tab, and on Linux it will open up a new XTerm for each node. On Windows the (``runnodes.bat``) script will run
one node per window.
Other cordapps can also be specified if they are already specified as classpath or compile dependencies in your
``build.gradle``.

View File

@ -69,5 +69,5 @@ Run via CLI::
1. Navigate to the `cordapp-samples` directory in your shell
2. Run the gradle target `deployNodes` (ie; ./gradlew deployNodes for Unix or gradlew.bat on Windows)
1. Unix: `cd simm-valuation-demo/build/nodes && ./runnodes`.
2. Windows: Open a command line window in each subdirectory of `simm-valuation-demo/build/nodes` and run `java -jar corda.jar`
2. Windows: `cd simm-valuation-demo/build/nodes & runnodes.bat`
4. Browse to http://localhost:10005/web/simmvaluationdemo

View File

@ -67,6 +67,7 @@ class Cordform extends DefaultTask {
protected void installRunScript() {
project.copy {
from Cordformation.getPluginFile(project, "net/corda/plugins/runnodes")
from Cordformation.getPluginFile(project, "net/corda/plugins/runnodes.bat")
filter { String line -> line.replace("JAR_NAME", Node.JAR_NAME) }
// Replaces end of line with lf to avoid issues with the bash interpreter and Windows style line endings.
filter(FixCrLfFilter.class, eol: FixCrLfFilter.CrLf.newInstance("lf"))

View File

@ -0,0 +1,7 @@
@echo off
FOR /R ".\" %%G in (.) DO (
Pushd %%G
start java -jar corda.jar
Popd
)

View File

@ -44,8 +44,8 @@ Unix:
Windows:
Windows users currently have to manually enter each directory in `build/nodes` and run `java -jar corda.jar` in each.
This will be updated soon.
cd build/nodes
ruunnodes.bat
This will now have nodes running on your machine running this Cordapp. You can now begin developing your Cordapp.

View File

@ -39,8 +39,8 @@ Unix:
Windows:
Windows users currently have to manually enter each directory in `build/nodes` and run `java -jar corda.jar` in each.
This will be updated soon.
cd build/nodes
ruunnodes.bat
This will now have nodes running on your machine running this Cordapp. You can now begin developing your Cordapp.

View File

@ -54,8 +54,8 @@ Unix:
Windows:
Windows users currently have to manually enter each directory in `build/nodes` and run `java -jar corda.jar` in each.
This will be updated soon.
cd build/nodes
ruunnodes.bat
This will now have nodes running on your machine running this Cordapp. You can now begin developing your Cordapp.