From a2db6d0f5d5430ce9722b7d7337e03118046bb38 Mon Sep 17 00:00:00 2001 From: Ross Nicoll Date: Fri, 17 Mar 2017 15:45:08 +0000 Subject: [PATCH] Correct code paths in tutorial docs --- docs/source/tutorial-cordapp.rst | 36 ++++++++++++++++---------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/docs/source/tutorial-cordapp.rst b/docs/source/tutorial-cordapp.rst index 1ffde41b45..b2e7e3a776 100644 --- a/docs/source/tutorial-cordapp.rst +++ b/docs/source/tutorial-cordapp.rst @@ -268,8 +268,8 @@ Unix/Mac OSX: ``./gradlew deployNodes`` Windows: ``gradlew.bat deployNodes`` This build process will build the example CorDapp defined in the example CorDapp source. CorDapps can be written in -any language targeting the JVM. In our case, we've provided the example source in both Kotlin (``/kotlin/src``) and -Java (``/java/src``) Since both sets of source files are functionally identical, we will refer to the Kotlin build +any language targeting the JVM. In our case, we've provided the example source in both Kotlin (``/kotlin-source/src``) and +Java (``/java-source/src``) Since both sets of source files are functionally identical, we will refer to the Kotlin build throughout the documentation. For more information on the example CorDapp see "The Example CorDapp" section below. Gradle will then grab all the @@ -278,7 +278,7 @@ dependencies for you and build the example CorDapp. The ``deployNodes`` Gradle task allows you easily create a formation of Corda nodes. In the case of the example CorDapp we are creating ``four`` nodes. -After the building process has finished to see the newly built nodes, you can navigate to the ``kotlin/build/nodes`` folder +After the building process has finished to see the newly built nodes, you can navigate to the ``kotlin-source/build/nodes`` folder located in the ``cordapp-tutorial`` root directory. You can ignore the other folders in ``/build`` for now. The ``nodes`` folder has the following structure: @@ -326,7 +326,7 @@ Running the example CorDapp Running the example CorDapp from the command line ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -To run the sample CorDapp navigate to the ``kotlin/build/nodes`` folder and execute the ``runnodes`` shell script with: +To run the sample CorDapp navigate to the ``kotlin-source/build/nodes`` folder and execute the ``runnodes`` shell script with: Unix: ``./runnodes`` or ``sh runnodes`` @@ -345,7 +345,7 @@ message and some pertinent config information, see below: --- DEVELOPER SNAPSHOT ------------------------------------------------------------ - Logs can be found in : /Users/rogerwillis/Documents/Corda/cordapp-tutorial/kotlin/build/nodes/nodea/logs + Logs can be found in : /Users/rogerwillis/Documents/Corda/cordapp-tutorial/kotlin-source/build/nodes/nodea/logs Database connection URL is : jdbc:h2:tcp://10.18.0.196:50661/node Node listening on address : localhost:10004 Loaded plugins : com.example.plugin.ExamplePlugin @@ -397,7 +397,7 @@ down menu at the top right-hand side of the IDE and press the green arrow to sta .. image:: resources/run-config-drop-down.png :width: 400 -The node driver defined in ``/src/main/kotlin/com/example/Main.kt`` allows you to specify how many nodes you would like +The node driver defined in ``/src/main/kotlin-source/com/example/Main.kt`` allows you to specify how many nodes you would like to run and the various configuration settings for each node. With the example CorDapp, the Node driver starts four nodes and sets up an RPC user for all but the "Controller" node (which hosts the notary Service and network map service): @@ -429,7 +429,7 @@ The CorDapp defines a few HTTP API end-points and also serves some static web co list IOUs and add IOUs. The nodes can be found using the following port numbers, defined in build.gradle and the respective node.conf file for -each node found in `kotlin/build/nodes/NodeX`` etc: +each node found in `kotlin-source/build/nodes/NodeX`` etc: * Controller: ``localhost:10003`` * NodeA: ``localhost:10005`` @@ -575,7 +575,7 @@ query them using SQL. Using the Example RPC client ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The ``/src/main/kotlin/com/example/client/ExampleClientRPC.kt`` file is a simple utility which uses the client RPC library +The ``/src/main/kotlin-source/com/example/client/ExampleClientRPC.kt`` file is a simple utility which uses the client RPC library to connect to a node and log the created IOUs. It will log any existing IOUs and listen for any future IOUs. If you haven't created any IOUs when you connect to one of the Nodes via RPC then the client will log and future IOUs which are agreed. @@ -717,13 +717,13 @@ In the file structure above, the most important files and directories to note ar * **gradle** contains the gradle wrapper, which allows the use of Gradle without installing it yourself and worrying about which version is required. * **lib** contains the Quasar.jar which is required for runtime instrumentation of classes by Quasar. -* **kotlin** contains the source code for the example CorDapp written in Kotlin. - * **kotlin/src/main/kotlin** contains the source code for the example CorDapp. - * **kotlin/src/main/python** contains a python script which accesses nodes via RPC. - * **kotlin/src/main/resources** contains the certificate store, some static web content to be served by the nodes and the +* **kotlin-source** contains the source code for the example CorDapp written in Kotlin. + * **kotlin-source/src/main/kotlin** contains the source code for the example CorDapp. + * **kotlin-source/src/main/python** contains a python script which accesses nodes via RPC. + * **kotlin-source/src/main/resources** contains the certificate store, some static web content to be served by the nodes and the PluginServiceRegistry file. - * **kotlin/src/test/kotlin** contains unit tests for protocols, contracts, etc. -* **java** contains the same source code, but written in java. This is an aid for users who do not want to develop in + * **kotlin-source/src/test/kotlin** contains unit tests for protocols, contracts, etc. +* **java-source** contains the same source code, but written in java. This is an aid for users who do not want to develop in Kotlin, and serves as an example of how CorDapps can be developed in any language targeting the JVM. Some elements are covered in more detail below. @@ -801,7 +801,7 @@ like to deploy for testing. See further details below: .. sourcecode:: groovy task deployNodes(type: com.r3corda.plugins.Cordform, dependsOn: ['build']) { - directory "./kotlin/build/nodes" // The output directory. + directory "./kotlin-source/build/nodes" // The output directory. networkMap "Controller" // The artemis address of the node to be used as the network map. node { name "Controller" // Artemis name of node to be deployed. @@ -846,7 +846,7 @@ Re-Deploying Your Nodes Locally If you need to create any additional nodes you can do it via the ``build.gradle`` file as discussed above in ``the build.gradle file`` and in more detail in the "cordFormation" section. -You may also wish to edit the ``/kotlin/build/nodes//node.conf`` files for your nodes. For more information on +You may also wish to edit the ``/kotlin-source/build/nodes//node.conf`` files for your nodes. For more information on doing this, see the :doc:`Corda configuration file ` page. Once you have made some changes to your CorDapp you can redeploy it with the following command: @@ -861,8 +861,8 @@ Running Nodes Across Machines The nodes can also be set up to communicate between separate machines on the same subnet. -After deploying the nodes, navigate to the build folder (`kotlin/build/ -nodes` or `java/build/nodes`) and move some of the individual node folders to +After deploying the nodes, navigate to the build folder (`kotlin-source/build/ +nodes` or `java-source/build/nodes`) and move some of the individual node folders to separate machines on the same subnet (e.g. using a USB key). It is important that no nodes - including the controller node - end up on more than one machine. Each computer should also have a copy of `runnodes` and