Updated Azure documentation to better describe new Azure multi node offering (#709)

* Intro changes for multi node Azure deployment, more to do

* Updated text on running Azure wizard and starting writing how to use Yo CorDapp

* All text updated for Corda multi node offering in Azure

* Images for Azure multi node documentation

* Update link to Yo CorDapp video

* Fixed some typos

* Added further info on validating notary

* Changed Yo CorDapp info to manually load it since it is not pre-loaded

* Updated screenshot for Azure multi node step 2

* Uploaded yo_peers screenshot for Azure documentation

* Corda banner screenshot

* Screen shot of Corda syslog

* updated screenshot for Azure setup step3

* Updated text to account for M10 and improved notes on using Yo CorDapp

* typos fixed

* screenshot of api/yo/yos output

* Removed section on using shell because appears to crash to API

* New yo peers output screenshot

* Updated peers screenshot and example

* Minor changes following review by Joel

* Added guidance to login to portal.azure.com first
This commit is contained in:
Gavin Thomas 2017-05-19 17:15:54 +01:00 committed by Clinton
parent 7244f2eeea
commit 1bc4c490bc
13 changed files with 115 additions and 85 deletions

View File

@ -1,175 +1,205 @@
Working with the Corda Demo on Azure Marketplace
================================================
Building a Corda Network on Azure Marketplace
=============================================
Corda ships with a VM image which can be used to deploy a pre-configured virtual machine on the `Microsoft Azure Marketplace <https://azure.microsoft.com/en-gb/overview/what-is-azure>`_
To help you design, build and test applications on Corda, called CorDapps, a Corda network can be deployed on the `Microsoft Azure Marketplace <https://azure.microsoft.com/en-gb/overview/what-is-azure>`_
This Corda Demo VM is an easy option for running the demos; it is *NOT* a development environment. When you are ready to get developing on Corda and start making contributions to the project please clone the `GitHub Repos <https://github.com/corda/>`_ instead.
This Corda network offering builds a pre-configured network of Corda nodes as Ubuntu virtual machines (VM). The network comprises of a Network Map Service node, a Notary node and up to nine Corda nodes using a version of Corda of your choosing. The following guide will also show you how to load a simple Yo! CorDapp which demonstrates the basic principles of Corda. When you are ready to go further with developing on Corda and start making contributions to the project head over to the `Corda.net <https://www.corda.net/>`_.
Pre-requisites
--------------
* Ensure you have a registered Microsoft Azure account and are logged on to the Azure portal.
* Ensure you have a registered Microsoft Azure account which can create virtual machines under your subscription(s) and you are logged on to the Azure portal (portal.azure.com)
* It is recommended you generate a private-public SSH key pair (see `here <https://www.digitalocean.com/community/tutorials/how-to-set-up-ssh-keys--2/>`_)
Deploying the VM
----------------
Deploying the Corda Network
---------------------------
Browse to portal.azure.com, login and search the Azure Marketplace for Corda and select 'Corda Single Ledger Network'.
Search the Azure Marketplace for Corda.
Click the 'Create' button.
STEP 1: Basics
* **Name**: Choose an appropriate descriptive name for the VM
* **VM Disk Type**: Select 'SSD'
* **Username**: Your preferred user name for the administrator account when accessing via SSH
* **Authentication type**: Select 'SSH public key', then paste the contents of your SSH public key file (see pre-requisites, above) into the box below. Alternatively select 'Password' to use a password of your choice to administer the VM
Define the basic parameters which will be used to pre-configure your Corda nodes.
* **Subscription**: Select your subscription name
* **Resource group**: Select 'Use existing'. From the drop-down menu, select your account group
* **Resource prefix**: Choose an appropriate descriptive name for your Corda nodes. This name will prefix the node hostnames
* **VM user name**: This is the user login name on the Ubuntu VMs. Leave it as azureuser or define your own
* **Authentication type**: Select 'SSH public key', then paste the contents of your SSH public key file (see pre-requisites, above) into the box. Alternatively select 'Password' to use a password of your choice to administer the VM
* **Restrict access by IP address**: Leave this as 'No' to allow access from any internet host, or provide an IP address or a range of IP addresses to limit access
* **Subscription**: Select which of your Azure subscriptions you want to use
* **Resource group**: Choose to 'Create new' and provide a useful name of your choice
* **Location**: Select the geographical location physically closest to you
.. image:: resources/azure_vm_10_00_1.png
.. image:: resources/azure_multi_node_step1.png
:width: 300px
Click 'OK'
STEP 2: Size
STEP 2: Network Size and Performance
A range of available hardware configurations will be presented, along with estimated costs. For the purposes of running the demos, a configuration of 2 cores and at least 14GB is recommended
Define the number of Corda nodes in your network and the size of VM.
.. image:: resources/azure_vm_10_05_1.png
* **Number of Network Map nodes**: There can only be one Network Map node in this network. Leave as '1'
* **Number of Notary nodes**: There can only be one Notary node in this network. Leave as '1'
* **Number of participant nodes**: This is the number of Corda nodes in your network. At least 2 nodes in your network is recommended (so you can send transactions between them). You can specific 1 participant node and use the Notary node as a second node. There is an upper limit of 9
* **Storage performance**: Leave as 'Standard'
* **Virtual machine size**: The size of the VM is automatically adjusted to suit the number of participant nodes selected. It is recommended to use the suggested values
.. image:: resources/azure_multi_node_step2.png
:width: 300px
Choose the required configuration and click 'Select'.
Click 'OK'
STEP 3: Settings
STEP 3: Corda Specific Options
Adjust any configuration settings required. For the purposes of running the Corda demos, all settings may be left as default.
Define the version of Corda you want on your nodes and the type of notary.
.. image:: resources/azure_vm_10_16_1.png
* **Corda version (as seen in Maven Central)**: Select the version of Corda you want your nodes to use from the drop down list. The version numbers can be seen in `Maven Central <http://repo1.maven.org/maven2/net/corda/corda/>`_, for example 0.11.0
* **Notary type**: Select either 'Non Validating' (notary only checks whether a state has been previously used and marked as historic) or 'Validating' (notary performs transaction verification by seeing input and output states, attachments and other transaction information). More information on notaries can be found `here <https://vimeo.com/album/4555732/video/214138458>`_
.. image:: resources/azure_multi_node_step3.png
:width: 300px
Click 'OK'
STEP 4: Summary
The banner at the top of the dialog should read 'Validation passed' otherwise go back and adjust settings where needed.
A summary of your selections is shown.
.. image:: resources/azure_vm_10_19.png
.. image:: resources/azure_multi_node_step4.png
:width: 300px
Click 'OK' to proceed.
Click 'OK' for your selection to be validated. If everything is ok you will see the message 'Validation passed'
Click 'OK'
STEP 5: Buy
Click 'Purchase' to complete the configuration and start the VM deployment.
Review the Azure Terms of Use and Privacy Policy and click 'Purchase' to buy the Azure VMs which will host your Corda nodes.
The VM will begin the deployment process, which typically takes 4-5 minutes to complete. To see progress, click on the "Deploying" icon displayed.
The deployment process will start and typically takes 8-10 minutes to complete.
.. image:: resources/azure_vm_10_20.png
Once deployed click 'Resources Groups', select the resource group you defined in Step 1 above and click 'Overview' to see the virtual machine details. The names of your VMs will be pre-fixed with the resource prefix value you defined in Step 1 above.
The Newtork Map Service node is suffixed nm0. The Notary node is suffixed not0. Your Corda participant nodes are suffixed node0, node1, node2 etc. Note down the **Public IP address** for your Corda nodes. You will need these to connect to UI screens via your web browser:
.. image:: resources/azure_ip.png
:width: 300px
Once deployed, click 'Overview' to see the virtual machine details. Note down the **Public IP address**. You will need this to connect to the demo screens via your web browser:
Using the Yo! CorDapp
---------------------
Loading the Yo! CordDapp on your Corda nodes lets you send simple Yo! messages to other Corda nodes on the network. A Yo! message is a very simple transaction. The Yo! CorDapp demonstrates:
.. image:: resources/azure_vm_10_26.png
:width: 300px
- how transactions are only sent between Corda nodes which they are intended for and are not shared across the entire network by using the network map
- uses a pre-defined flow to orchestrate the ledger update automatically
- the contract imposes rules on the ledger updates
Viewing the SIMM Valuation demo
-------------------------------
The SIMM Valuation demo creates three nodes, representing three parties in the example workflow (Bank A, Bank B, Bank C). Each node listens on a different port - those used by the demo are:
* **Loading the Yo! CorDapp onto your nodes**
**SIMM Valuation Demo ports:** **12005 (node A for Bank A)**, **12007 (node B for Bank B)**, **12009 (node C for Bank C)**
The nodes you will use to send and receive Yo messages require the Yo! CorDapp jar file to be saved to their plugins directory.
Open three browser tabs and direct each one to
Connect to one of your Corda nodes (make sure this is not the Notary node) using an SSH client of your choice (e.g. Putty) and log into the virtual machine using the public IP address and your SSH key or username / password combination you defined in Step 1 of the Azure build process. Type the following command:
For Corda nodes running release M10
.. sourcecode:: shell
http://(public IP address):(port)/web/simmvaluationdemo
cd /opt/corda/plugins
wget http://downloads.corda.net/cordapps/net/corda/yo/0.10.1/yo-0.10.1.jar
specifying each of the three ports above in different windows, e.g.
For Corda nodes running release M11
.. sourcecode:: shell
http://51.140.41.48/12005/web/simmvaluationdemo
cd /opt/corda/plugins
wget http://downloads.corda.net/cordapps/net/corda/yo/0.11.0/yo-0.11.0.jar
You will be able to view the basic web interface identifying the different banks.
Now restart Corda and the Corda webserver using the following commands or restart your Corda VM from the Azure portal:
Now let's take a look at a transaction between Bank A and B which is not visible to Bank C. This illustrates the restricted data sharing feature of Corda, i.e. data is shared on a need-to-know basis. Nodes provide the dependency graph of a transaction they are sending to another node on demand, but there is no global broadcast of all transactions.
.. sourcecode:: shell
1. In the browser tab for Bank A (the top right hand corner shows which bank you are administering) click 'Create New Trade' from the top navigation bar
2. Select to trade with Bank B
3. Select 'EUR Fixed 1y EURIBOR 3m' from the drop down
4. Click 'Submit' to create the trade
5. In the browser tab for Bank B click 'View Portfolio' from the top navigation bar to see this new trade
6. In the browser tab for Bank C click 'View Portfolio' from the top navigation bar and you will not be able to see the trade, as expected
sudo systemctl restart corda
sudo systemctl restart corda-webserver
.. image:: resources/azure_vm_10_51.png
Repeat these steps on other Corda nodes on your network which you want to send or receive Yo messages.
* **Verify the Yo! CorDapp is running**
Open a browser tab and browse to the following URL:
.. sourcecode:: shell
http://(public IP address):(port)/web/yo
where (public IP address) is the public IP address of one of your Corda nodes on the Azure Corda network and (port) is the web server port number for your Corda node, 10004 by default
You will now see the Yo! CordDapp web interface:
.. image:: resources/Yo_web_ui.png
:width: 300px
.. note:: There is a known issue whereby some users may see a 400 error when navigating the SIMM Valuation demo. If you encounter this error, simply navigate back to the root page (http://*(public IP address)*:*(port)*/*web*/*simmvaluationdemo*) in the browser before continuing.
* **Sending a Yo message via the web interface**
Viewing the IRS demo
--------------------
The IRS demo creates three nodes: Bank A, Bank B and a node that runs a notary, a network map and an interest rates oracle together. The two banks agree on an interest rate swap, and then do regular fixings of the deal as the time on a simulated clock passes. Each bank node listens on a different port - those used by the demo are:
**IRS demo ports:** **11005 (node A for Bank A)**, **11007 (node B for Bank B)**
Open two browser tabs and direct one to each of the following:
In the browser window type the following URL to send a Yo message to a target node on your Corda network:
.. sourcecode:: shell
http://localhost:11005/web/irsdemo
http://localhost:11007/web/irsdemo
http://(public IP address):(port)/api/yo/yo?target=(legalname of target node)
You will be able to see the nodes' view of the ledger.
where (public IP address) is the public IP address of one of your Corda nodes on the Azure Corda network and (port) is the web server port number for your Corda node, 10004 by default and (legalname of target node) is the Legal Name for the target node as defined in the node.conf file, for example:
.. image:: resources/azure_vm_10_52.png
.. sourcecode:: shell
http://40.69.40.42:10004/api/yo/yo?target=Corda 0.10.1 Node 1 in tstyo2
An easy way to see the Legal Names of Corda nodes on the network is to use the peers screen:
.. sourcecode:: shell
http://(public IP address):(port)/api/yo/peers
.. image:: resources/yo_peers2.png
:width: 300px
Now let's take a look at how the interest rates oracle provides interest rates for a deal with a semi-annual payment frequency, and how the two counterparties to the trade see the same deal information on their own nodes, i.e. you see what I see.
* **Viewing Yo messages**
1. In the browser tab for Bank A click 'Create Deal' from the top navigation bar
2. Modify the terms of the IRS deal, or leave as default
3. Click 'Submit' to create the deal
4. In the browser tab for Bank A click 'Recent Deals' from the top navigation bar to view the deal
5. In the browser tab for Bank B click 'Recent Deals' from the top navigation bar to view the deal. Compare the economic details to those shown in the Bank A tab
To see Yo! messages sent to a particular node open a browser window and browse to the following URL:
.. image:: resources/azure_vm_10_54.png
.. sourcecode:: shell
http://(public IP address):(port)/api/yo/yos
.. image:: resources/azure_yos.png
:width: 300px
Viewing logs (advanced users)
-----------------------------
Viewing logs
------------
Users may wish to view the raw logs generated by each node, which contain more information about the operations performed by each node.
You can access these using an SSH client of your choice (e.g. Putty) and logging into the virtual machine using the public IP address.
Once logged in, navigate to
Once logged in, navigate to the following directory for Corda logs (node-xxxxxx):
.. sourcecode:: shell
/opt/simm-nodes/
/opt/corda/logs
for the SIMM Valuation demo logs and
And navigate to the following directory for system logs (syslog):
.. sourcecode:: shell
/opt/irs-nodes/
for the IRS demo logs.
There are separate sub-directories for each of the three nodes (*nodea*, *nodeb*, *nodec*), each containing a */logs* sub-directory.
The name of the log file will follow the name given to the service it reflects, e.g. *node-clint-vm-test.log*.
.. image:: resources/azure_vm_10_47.png
:width: 300px
/var/log
You can open log files with any text editor.
.. image:: resources/azure_vm_10_49.png
:width: 300px
.. image:: resources/azure_syslog.png
:width: 300px
Next Steps
----------
Now you have taken a look at two Corda demos do go and visit the `dedicated Corda website <https://www.corda.net>`_
Now you have built a Corda network and used a basic Corda CorDapp do go and visit the `dedicated Corda website <https://www.corda.net>`_
Or to get straight into the Corda open source codebase, head over to the `Github Corda repo <https://www.github.com/corda>`_
Or to join the growing Corda community and get straight into the Corda open source codebase, head over to the `Github Corda repo <https://www.github.com/corda>`_

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1012 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 213 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 229 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 782 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB