Prerequisites

While it would be possible to set up our network manually, it will be cleaner to do so in a separate environment that we can bring up and take down easily.

As a first step we'll need to install the following applications:

VirtualBox is a virtualization application that will let us run our network inside a virtual machine, while Vagrant is a tool that will allow us to configure the environment easily  so that our network can be initialized and run on command. Once the two applications are installed, we can move onto installing our Quorum-related code.

We first want to download the appropriate code from Quorum's GitHub repository. If Git isn't already installed on your system, now would be the time to do so (see https://git-scm.com/downloads):

git clone https://github.com/jpmorganchase/quorum-examples
cd quorum-examples

The quorum-examples/ directory contains a file called Vagrantfile, which will be read by Vagrant when it starts. This file defines the parameters of our VirtualBox VM, and includes the ports that will be associated with each node in our network. It also calls a script, called vagrant/bootstrap.sh, which is run to create the node software from scratch.

Running the following will create a virtual machine in VirtualBox and configure it from the Vagrantfile file:

vagrant up

The first time this is run, it will take somewhere in the order of 5-10 minutes. Vagrantfile defines the image that should be run on our VM—in this case, an Ubuntu Xenial image—which has to be downloaded. On subsequent runs, the startup time will be much quicker. When it has finished, we will have our configured virtual machine. To interact with our new environment, we have to connect to our virtual machine using SSH on the command line:

vagrant ssh

Our instantiated VM comes with a predefined network that we'll use for our examples, which can be found inside our virtual environment under the quorum-examples/7nodes/ directory. As the name suggests, our test network will consist of seven nodes in total.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset