From 15dea871091e451af50b42c80eca85b14c36574a Mon Sep 17 00:00:00 2001 From: Joel Dudley Date: Wed, 4 Jul 2018 10:22:39 +0100 Subject: [PATCH] Clarifies how to run a network across machines (#3508) * Update tutorial-cordapp.rst * Adds warning box. --- docs/source/tutorial-cordapp.rst | 42 ++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/docs/source/tutorial-cordapp.rst b/docs/source/tutorial-cordapp.rst index 961b17c6dd..eba4a85348 100644 --- a/docs/source/tutorial-cordapp.rst +++ b/docs/source/tutorial-cordapp.rst @@ -411,32 +411,38 @@ For more information on the client RPC interface and how to build an RPC client Running nodes across machines ----------------------------- -The nodes can be split across different machines and configured to communicate across the network. +The nodes can be configured to communicate as a network even when distributed across several machines: -After deploying the nodes, navigate to the build folder (``kotlin-source/build/nodes``) and for each node that needs to -be moved to another machine open its config file and change the Artemis messaging address to the IP address of the machine -where the node will run (e.g. ``p2pAddress="10.18.0.166:10007"``). +* Deploy the nodes as usual: -These changes require new node-info files to be distributed amongst the nodes. Use the network bootstrapper tool -(see :doc:`network-bootstrapper` for more information on this and how to built it) to update the files and have -them distributed locally. + * Unix/Mac OSX: ``./gradlew deployNodes`` + * Windows: ``gradlew.bat deployNodes`` -``java -jar network-bootstrapper.jar kotlin-source/build/nodes`` +* Navigate to the build folder (``kotlin-source/build/nodes``) +* For each node, open its ``node.conf`` file and change ``localhost`` in its ``p2pAddress`` to the IP address of the machine + where the node will be run (e.g. ``p2pAddress="10.18.0.166:10007"``) +* These changes require new node-info files to be distributed amongst the nodes. Use the network bootstrapper tool + (see :doc:`network-bootstrapper`) to update the files and have them distributed locally: -Once that's done move the node folders to their designated machines (e.g. using a USB key). It is important that none of the -nodes - including the notary - end up on more than one machine. Each computer should also have a copy of ``runnodes`` -and ``runnodes.bat``. + ``java -jar network-bootstrapper.jar kotlin-source/build/nodes`` -For example, you may end up with the following layout: +* Move the node folders to their individual machines (e.g. using a USB key). It is important that none of the + nodes - including the notary - end up on more than one machine. Each computer should also have a copy of ``runnodes`` + and ``runnodes.bat``. -* Machine 1: ``Notary``, ``PartyA``, ``runnodes``, ``runnodes.bat`` -* Machine 2: ``PartyB``, ``PartyC``, ``runnodes``, ``runnodes.bat`` + For example, you may end up with the following layout: -After starting each node, the nodes will be able to see one another and agree IOUs among themselves. + * Machine 1: ``Notary``, ``PartyA``, ``runnodes``, ``runnodes.bat`` + * Machine 2: ``PartyB``, ``PartyC``, ``runnodes``, ``runnodes.bat`` -.. note:: If you are using H2 and wish to use the same ``h2port`` value for all the nodes, then only assign them that - value after the nodes have been moved to their machines. The initial bootstrapping process requires access to the nodes' - databases and if they share the same H2 port then the process will fail. +* After starting each node, the nodes will be able to see one another and agree IOUs among themselves + +.. warning:: The bootstrapper must be run **after** the ``node.conf`` files have been modified, but **before** the nodes + are distributed across machines. Otherwise, the nodes will not be able to communicate. + +.. note:: If you are using H2 and wish to use the same ``h2port`` value for two or more nodes, you must only assign them that + value after the nodes have been moved to their individual machines. The initial bootstrapping process requires access to the + nodes' databases and if two nodes share the same H2 port, the process will fail. Testing and debugging ---------------------