Clarifies how to run a network across machines (#3508)

* Update tutorial-cordapp.rst

* Adds warning box.
This commit is contained in:
Joel Dudley 2018-07-04 10:22:39 +01:00 committed by GitHub
parent 7839d78338
commit 15dea87109
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -411,19 +411,22 @@ For more information on the client RPC interface and how to build an RPC client
Running nodes across machines 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 * Deploy the nodes as usual:
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"``).
These changes require new node-info files to be distributed amongst the nodes. Use the network bootstrapper tool * Unix/Mac OSX: ``./gradlew deployNodes``
(see :doc:`network-bootstrapper` for more information on this and how to built it) to update the files and have * Windows: ``gradlew.bat deployNodes``
them distributed locally.
* 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:
``java -jar network-bootstrapper.jar kotlin-source/build/nodes`` ``java -jar network-bootstrapper.jar kotlin-source/build/nodes``
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 * 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`` nodes - including the notary - end up on more than one machine. Each computer should also have a copy of ``runnodes``
and ``runnodes.bat``. and ``runnodes.bat``.
@ -432,11 +435,14 @@ For example, you may end up with the following layout:
* Machine 1: ``Notary``, ``PartyA``, ``runnodes``, ``runnodes.bat`` * Machine 1: ``Notary``, ``PartyA``, ``runnodes``, ``runnodes.bat``
* Machine 2: ``PartyB``, ``PartyC``, ``runnodes``, ``runnodes.bat`` * Machine 2: ``PartyB``, ``PartyC``, ``runnodes``, ``runnodes.bat``
After starting each node, the nodes will be able to see one another and agree IOUs among themselves. * After starting each node, the nodes will be able to see one another and agree IOUs among themselves
.. note:: If you are using H2 and wish to use the same ``h2port`` value for all the nodes, then only assign them that .. warning:: The bootstrapper must be run **after** the ``node.conf`` files have been modified, but **before** the nodes
value after the nodes have been moved to their machines. The initial bootstrapping process requires access to the nodes' are distributed across machines. Otherwise, the nodes will not be able to communicate.
databases and if they share the same H2 port then the process will fail.
.. 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 Testing and debugging
--------------------- ---------------------