Skip to content
This repository has been archived by the owner on Mar 8, 2020. It is now read-only.

Commit

Permalink
Update sample application README to focus on one app (#74)
Browse files Browse the repository at this point in the history
rather than installing all apps at once. Corrected some of the steps to achieve install and removed v0.6 steps as deprecated.
  • Loading branch information
Paul O'M authored and nklincoln committed Aug 15, 2017
1 parent 6f8e8ed commit 4b41927
Showing 1 changed file with 18 additions and 33 deletions.
51 changes: 18 additions & 33 deletions packages/digitalproperty-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

Follow the instructions below to get started by standing up a Hyperledger Fabric, and then getting a simple Hyperledger Composer Business Network deployed and an application running against it. A 'Getting Started' application.

There are two version of Hyperledger Fabric : v0.6 and v1.0-alpha. The default is for v1.0-alpha and we suggest this is the one you use.
This sample application should be run against a v1.0 Hyperledger Fabric (and which the scripts below will stand up as a Dev environment)

## Step 1: Getting Hyperledger Fabric running

These scripts use Node v6, and bash, which are Hyperledger Composer depencies. Choose a directory that you wish to have the setup scripts within.
These scripts use Node v6, and bash, which are Hyperledger Composer dependencies. Choose a directory that you wish to have the setup scripts within.

1. In a directory of your choice (will assume `~/fabric-tools`) get the zip file that contains the tools. There are both .zip and .tar.gz formats
```
Expand All @@ -22,21 +22,9 @@ $ tar xvz fabric-dev-servers.tar.gz
```

2. Choose which version of Fabric to use. For v0.6 this needs to be set explicitly as follows.
2. If this is the first time you've run this tutorial, you'll need to download the fabric first. If you have already downloaded a set of Fabric images then first start the fabric (see below), and create a Composer profile. Make sure you don't have a previous network (digitalproperty-network) docker container left running as 'legacy' - remove legacy containers as necessary using `docker rm`). After that, you can then choose to stop the fabric, and start it again later. Alternatively, to completely clean up, you can 'teardown' the Fabric and the Composer profile / sample credentials (see more below).

```
$ export FABRIC_VERSION=hlfv0.6
```

For v1.0-alpha, there is *nothing to as this the default*. But to 'unset' the v0.6, or to be explicit in using v1 use this command

```
$ export FABRIC_VERSION=hlfv1
```

3. If this is the first time, you'll need to download the fabric first. If you have already downloaded then first start the fabric, and create a Composer profile. After that you can then choose to stop the fabric, and start it again later. Alternatively to completely clean up you can teardown the Fabric and the Composer profile.

All the scripts will be in the directory `~/fabric-tools` A typical sequence for Hyperledger Composer use would be
All the scripts will be in the directory `~/fabric-tools` you created above. A typical sequence for Hyperledger Composer startup would be:

```
$ cd ~/fabric-tools
Expand All @@ -53,8 +41,6 @@ $ ./stopFabric.sh
$ ./teardownFabric.sh
```

*If you want to swap between v0.6 and v1.0, ensure you have issued a `stopFabric.sh` and a `teardownFabric.sh` command first be START on the other version*

## Script details

### Downloading Fabric
Expand All @@ -75,25 +61,25 @@ $ ./startFabric.sh

Issue from the `fabric-tools` directory
```
$ ./stop.sh
$ ./stopFabric.sh
```

By default, this script will pause for 15seconds to let Fabric start - on some systems this isn't enough. If you see fails in running `startFabric.sh` you can alter this value. It's controlled by a environment variable that takes a numeric value representing the number of seconds to wait.
By default, this 'start' script will pause for 15 seconds to let Fabric start - on some systems this isn't enough. If you see fails in running `startFabric.sh` you can alter this value - its controlled by a environment variable that takes a numeric value representing the number of seconds to wait.

```
$ export FABRIC_START_TIMEOUT=30
```

### Create Composer Profile

Issue from the `fabric-tools` directory
Issue this command from the `fabric-tools` directory
```
$ ./createComposerProfile.sh
```

Note: this create a Hyperledger Composer profile specifically to connect to the development fabric you've already started.

### Teardown Fabric
### Teardown Fabric (when you want to 'clean' up and start afresh)

Issue from the `fabric-tools` directory
```
Expand All @@ -103,14 +89,14 @@ $ ./teardownFabric.sh

### Command Ordering

This diagram should to clarify the order in which the scripts can be run. Remember the version will default to hlfv1 if the version command is not run.
This diagram should to clarify the order in which the scripts can be run.

![](CmdOrder.png).


# Step 2: Getting the Hyperledger Composer sample application
# Step 2: Getting the Hyperledger Composer sample application (digital property sample) up and running

0. Make sure you've started Fabric as in Step 1 above. For example, If this is your first time for exaple
0. Make sure you've started Fabric as in Step 1 above. For example, If this is your first time for example

```
$ cd ~/fabric-tools
Expand All @@ -122,9 +108,9 @@ $ ./createComposerProfile.sh
1. Clone the sample application into a directory of your choice - BUT not the same directory as in Step 1. (Assume `~/github')
```
$ mkdir ~/github && cd ~/github
$ git clone https://github.com/mbwhite/composer-sample-applications
$ git clone https://github.com/hyperledger/composer-sample-applications
$ cd composer-sample-applications
$ npm install
$
```

To see a summary of all the sample applications, there's a simple command that will show summary details of the applications
Expand All @@ -133,22 +119,21 @@ A useful information node.js script has been created to show the available sampl
$ node ~/github/composer-sample-applications/info.js
```

2. When you started fabric you will have chosen which version to use. If you have chosen Fabirc v0.6 you will need to suffix the targets in the npm commands below with `:hlfv06`. Both examples are given below - do not issue both commands!
2. When you started fabric you will have chosen which version to use.

*Note: this does not change the application source code or the model, purely the name of the Composer profile to use, and the Fabric's admin indentity*

3. Deploy the business network
3. Deploy the business network (for example - deploying the Digital Property sample application)

```
$ cd packages/getting-started
$ cd packages/digitalproperty-app
$ npm install
$ npm run deployNetwork
$ npm run deployNetwork:hlfv0.6 # if you want to use v0.6
```

5. Run the sample application
5. Run the sample application (Digital Property sample, for example)
```
$ npm test
$ npm test:hlfv0.6 # if you want to use v0.6
```


Expand Down

0 comments on commit 4b41927

Please sign in to comment.