Skip to content

Commit

Permalink
doc edits - preview & starter kit
Browse files Browse the repository at this point in the history
Cherry picked from fac2d2e

clean up video format
change Fabric to fabric
starter kit typos and edits
[ci skip]

Change-Id: I78aa2a9ed2c1e79a18ebcf8a19f27964a5d48959
Signed-off-by: Nick Gaski <ngaski@us.ibm.com>
Signed-off-by: Christopher Ferris <chrisfer@us.ibm.com>
  • Loading branch information
nickgaski authored and christo4ferris committed Nov 2, 2016
1 parent adf1f27 commit 17065f2
Showing 1 changed file with 23 additions and 24 deletions.
47 changes: 23 additions & 24 deletions docs/starter/fabric-starter-kit.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Fabric Starter Kit

This section describes how to set up a self contained environment for
application development with the Hyperledger Fabric. The setup
This section describes how to set up a self-contained environment for
application development with the Hyperledger fabric. The setup
uses **Docker** to provide a controlled environment with all the necessary
Hyperledger fabric components to support a Node.js application built with
the fabric's Node.js SDK, and chaincode written in Go.

There are three Docker images that, when run, will provide a basic
network environment. There is an image to run a single `peer`, one to run
the `membersrvc` and one to run both your Node.js application and the your
chaincode. See [Application Developer's Overview](app-overview.md) on how the
the `membersrvc`, and one to run both your Node.js application and your
chaincode. See [Application Developer's Overview](../nodeSDK/app-overview.md) on how the
components running within the containers will communicate.

The starter kit comes with a sample Node.js application ready to execute and
Expand All @@ -18,7 +18,7 @@ In this mode, the chaincode is built and started prior to the application
making a call to deploy it.

**Note:** The deployment of chaincode in network mode requires that the
Hyperledger Fabric Node.js SDK has access to the chaincode source code and all
Hyperledger fabric Node.js SDK has access to the chaincode source code and all
of its dependencies, in order to properly build a deploy request. It also
requires that the `peer` have access to the Docker daemon to be able to build
and deploy the new Docker image that will run the chaincode. *This is a more
Expand Down Expand Up @@ -46,10 +46,9 @@ If you wish, there are a number of chaincode examples near by.
curl -o docker-compose.yml https://raw.githubusercontent.com/hyperledger/fabric/master/examples/sdk/node/docker-compose.yml
```

The docker compose environment uses three docker images. Two are published to
DockerHub. However, the third, we provide you the source to build your own,
so that you can customize to inject your application code for development,
the following [Dockerfile](https://raw.githubusercontent.com/hyperledger/fabric/master/examples/sdk/node/Dockerfile)
The docker-compose environment uses three Docker images. Two are published to
DockerHub. However, with the third, we provide you the source to build your own,
so that you can customize it to inject your application code for development. The following [Dockerfile](https://raw.githubusercontent.com/hyperledger/fabric/master/examples/sdk/node/Dockerfile)
is used to build the base **fabric-starter-kit** image and may be used as
a starting point for your own customizations.

Expand Down Expand Up @@ -78,14 +77,14 @@ is located, execute one of following `docker-compose` commands.
docker-compose up
```
Both commands will start three docker containers, to view the container
status try `docker ps` command. The first time this is run the Docker
Both commands will start three Docker containers. To view the container
status use the `docker ps` command. The first time this is run, the Docker
images will be downloaded. This may take 10 minutes or more depending on the
network connections of the system running the command.
```
docker ps
```
```
docker ps
```
You should see something like the following:
Expand All @@ -101,34 +100,34 @@ Node.js application is located.
**note:** Be sure to wait 20 seconds after starting the network using the
`docker-compose up` command before executing the following command to allow
the network to initialize.
the network to initialize:
```
docker exec -it starter /bin/bash
```
* From the terminal session in the **starter** container execute the standalone
Node.js application. The docker terminal session should be in the working
Node.js application. The Docker terminal session should be in the working
directory of the sample application called **app.js** (*/opt/gopath/src/github.com/hyperledger/fabric/examples/sdk/node*). Execute
the following Node.js command to run the application.
the following Node.js command to run the application:
```
node app
```
In another terminal session on the host you can view the logs for the peer
by executing the following command (not in the docker shell above, in a new
terminal session of the real system)
terminal session of the real system):
```
docker logs peer
```
* If you wish to run your own Node.js application using the pre build docker
* If you wish to run your own Node.js application using the pre-built Docker
images:
* use the directories in the `volumes` tag under **starter** in the
`docker-compose.yml` file as a place to store your programs from the host
system into the docker container. The first path is the top level system
(host system) and the second is created in the docker container. If you wish
(host system) and the second is created in the Docker container. If you wish
to use a host location that is not under the `/Users` directory (`~` is
under `/Users') then you must add that to the Docker file sharing
under Docker preferences.
Expand All @@ -139,18 +138,18 @@ images:
```
* copy or create and edit your application in the `~/mytest` directory as
stated in the `docker-compose.yml` `volumes` tag under **starter** container.
* run npm to install Hyperledger Fabric Node.js SDK in the `mytest` directory
* run npm to install Hyperledger fabric Node.js SDK in the `mytest` directory:

```
npm install /opt/gopath/src/github.com/hyperledger/fabric/sdk/node
```
* run the application from within the **starter** Docker container using the
commands
following commands:

```
docker exec -it starter /bin/bash
```
once in the shell, and assuming your Node.js application is called `app.js`
once in the shell, and assuming your Node.js application is called `app.js`:

```
cd /user/mytest
Expand All @@ -167,7 +166,7 @@ the containers from Docker:
docker-compose down
```
or if you wish to keep your changes and just stop the containers, which will
be restarted on the next `up` command
be restarted on the next `up` command:

```
docker-compose kill
Expand Down

0 comments on commit 17065f2

Please sign in to comment.