From ab937f58659c012dda3139db6ed5301428d27ab8 Mon Sep 17 00:00:00 2001 From: Christopher Ferris Date: Fri, 23 Sep 2016 19:03:08 -0400 Subject: [PATCH] FAB-425 - improve initial experience Cherry picked from master 158480cb4cc520ad441991ebc76cebafc50d6be0 Improve the documentation to make it easier to find things, and to make the standalone sample development environment more prominent. Fixed broken link to SystemChaincodes/noop.md so that it is integrated into the documentation. Refactored the standalone doc to read better and to limit line length to 80. Added release notes. Changed to starter-kit Change-Id: Iea7fa205b970dc00014078d5cf4694be0444757b Signed-off-by: Christopher Ferris --- docs/Setup/Chaincode-setup.md | 2 +- .../noop.md => SystemChaincode-noop.md} | 0 docs/index.md | 155 ++++++++---------- docs/nodeSDK/node-sdk-self-contained.md | 99 ----------- docs/releases.md | 62 +++++++ docs/starter/fabric-starter-kit.md | 76 +++++---- examples/sdk/node/docker-compose.yml | 5 +- 7 files changed, 178 insertions(+), 221 deletions(-) rename docs/{SystemChaincodes/noop.md => SystemChaincode-noop.md} (100%) mode change 100755 => 100644 docs/index.md delete mode 100755 docs/nodeSDK/node-sdk-self-contained.md create mode 100644 docs/releases.md diff --git a/docs/Setup/Chaincode-setup.md b/docs/Setup/Chaincode-setup.md index a8b730e5f4c..409486a9602 100644 --- a/docs/Setup/Chaincode-setup.md +++ b/docs/Setup/Chaincode-setup.md @@ -4,7 +4,7 @@ Chaincode developers need a way to test and debug their chaincode without having The following instructions apply to _developing_ chaincode in Go or Java. They do not apply to running in a production environment. However, if _developing_ chaincode in Java, please see the [Java chaincode setup](https://github.com/hyperledger/fabric/blob/master/docs/Setup/JAVAChaincode.md) instructions first, to be sure your environment is properly configured. -**Note:** We have added support for [System chaincode](https://github.com/hyperledger/fabric/blob/master/docs/SystemChaincodes/noop.md). +**Note:** We have added support for [System chaincode](https://github.com/hyperledger/fabric/blob/master/docs/SystemChaincode-noop.md). ## Choices diff --git a/docs/SystemChaincodes/noop.md b/docs/SystemChaincode-noop.md similarity index 100% rename from docs/SystemChaincodes/noop.md rename to docs/SystemChaincode-noop.md diff --git a/docs/index.md b/docs/index.md old mode 100755 new mode 100644 index 8e7630a6bef..b67bf2b8f1b --- a/docs/index.md +++ b/docs/index.md @@ -19,21 +19,25 @@ to host any mainstream language for smart contracts development. ## Releases -The fabric releases are documented -[here](https://github.com/hyperledger/fabric/wiki/Fabric-Releases). We have just -released our first release under the governance of the Hyperledger Project - -v0.5-developer-preview. +The fabric releases are documented [here](releases.md). We have just +released our second release under the governance of the Hyperledger Project - +v0.6-preview. + +## Fabric Starter Kit + +If you'd like to dive right in and get an operational experience on your local +server or laptop to begin development, we have just the thing for you. We have +created a standalone Docker-based [starter kit](Starter/fabric-starter-kit.md) +that leverages the latest published Docker images that you can run on your +laptop and be up and running in no time. That should get you going with a +sample application and some simple chaincode. From there, you can go deeper +by exploring our [developer guides](#developer-guides). ## Contributing to the project We welcome contributions to the Hyperledger Project in many forms. There's always plenty to do! Full details of how to contribute to this project are -documented in the [Fabric developer's guide](#fabric-developer-guide) below. - -To contribute to this documentation, create an issue for any requests for -clarification or to highlight any errors, or you may clone and update the -[source](https://gerrit.hyperledger.org/r/#/admin/projects/fabric), and submit a -Gerrit review (essentially the same process as for fabric development). +documented in the [Fabric developer's guide](#fabric-developer's-guide) below. ## Maintainers @@ -45,40 +49,46 @@ Project's Technical Steering Committee (TSC). ## Communication We use [Hyperledger Slack](https://slack.hyperledger.org/) for communication and -Google Hangouts™ for screen sharing between developers. +Google Hangouts™ for screen sharing between developers. Our development +planning and prioritization is done in [JIRA](https://jira.hyperledger.org), +and we take longer running discussions/decisions to the +[mailing list](http://lists.hyperledger.org/mailman/listinfo/hyperledger-fabric). + +## Still Have Questions? +We try to maintain a comprehensive set of documentation (see below) for various audiences. +However, we realize that often there are questions that remain unanswered. For +any technical questions relating to the Hyperledger Fabric project not answered +in this documentation, please use +[StackOverflow](http://stackoverflow.com/questions/tagged/hyperledger). If you +need help finding things, please don't hesitate to send a note to the +[mailing list](http://lists.hyperledger.org/mailman/listinfo/hyperledger-fabric), +or ask on [Slack]((https://slack.hyperledger.org/)). # Hyperledger Fabric Documentation -The Hyperledger -[fabric](https://gerrit.hyperledger.org/r/#/admin/projects/fabric) is an -implementation of blockchain technology, that has been collaboratively developed -under the Linux Foundation's [Hyperledger Project](http://hyperledger.org). It -leverages familiar and proven technologies, and offers a modular architecture +The Hyperledger fabric is an implementation of blockchain technology, that has +been collaboratively developed under the Linux Foundation's +[Hyperledger Project](http://hyperledger.org). It leverages familiar and +proven technologies, and offers a modular architecture that allows pluggable implementations of various function including membership services, consensus, and smart contracts (Chaincode) execution. It features powerful container technology to host any mainstream language for smart contracts development. -## Still Have Questions? -We try to maintain a comprehensive set of documentation for various audiences. -However, we realize that often there are questions that remain unanswered. For -any technical questions relating to the Hyperledger Fabric project not answered -in this documentation, please use -[StackOverflow](http://stackoverflow.com/questions/tagged/hyperledger). - -## TOC +## Table of Contents Below, you'll find the following sections: -* [Getting started](#getting-started) -* [Quickstart](#quickstart-documentation) -* [Developer guides](#developer-guides) - * [Fabric developer's guide](#fabric-developer-guide) - * [Chaincode developer's guide](#chaincode-developer-guide) - * [API developer's guide](#api-developer-guide) -* [Operations guide](#operations-guide) +- [Read All About It](#read-all-about-it) +- [Developer guides](#developer-guides) + + - [Chaincode developer's guide](#chaincode-developer-guide) + - [Application developer's guide](#application-developer-guide) + - [Fabric developer's guide](#fabric-developer-guide) -# Getting started +- [Operations guide](#operations-guide) + +## Read all about it If you are new to the project, you can begin by reviewing the following links. If you'd prefer to dive right in, see the @@ -94,47 +104,8 @@ where the community is developing use cases and requirements. the Fabric project's documentation. - [Fabric FAQs](https://github.com/hyperledger/fabric/tree/master/docs/FAQ) -# Quickstart documentation - -- [Development environment set-up](dev-setup/devenv.md): if you are considering -helping with development of the Hyperledger Fabric or Fabric-API projects -themselves, this guide will help you install and configure all you'll need. The -development environment is also useful (but, not necessary) for developing -blockchain applications and/or Chaincode. -- [Network setup](Setup/Network-setup.md): This document covers setting up a -network on your local machine for development. -- [Chaincode development environment](Setup/Chaincode-setup.md): Chaincode -developers need a way to test and debug their Chaincode without having to set up -a complete peer network. This document describes how to write, build, and test -Chaincode in a local development environment. -- [APIs](API/CoreAPI.md): This document covers the available APIs for -interacting with a peer node. - # Developer guides -## Fabric developer guide - -When you are ready to start contributing to the Hyperledger fabric project, we -strongly recommend that you read the [protocol specification](protocol-spec.md) -for the technical details so that you have a better understanding of how the -code fits together. - -- [Making code contributions](CONTRIBUTING.md): First, you'll want to familiarize -yourself with the project's contribution guidelines. -- [Setting up the development environment](dev-setup/devenv.md): after that, you -will want to set up your development environment. -- [Building the fabric core](dev-setup/build.md): next, try building the project -in your local development environment to ensure that everything is set up -correctly. -- [Building outside of Vagrant](dev-setup/build.md#building-outside-of-vagrant): -for the adventurous, you might try to build outside of the standard Vagrant -development environment. -- [Logging control](Setup/logging-control.md): describes how to tweak the logging -levels of various components within the fabric. -- [License header](dev-setup/headers.txt): every source file must include this -license header modified to include a copyright statement for the principle -author(s). - ## Chaincode developer guide - [Setting up the development environment](dev-setup/devenv.md): when developing @@ -150,22 +121,40 @@ testing Chaincode. - [Chaincode FAQ](FAQ/chaincode_FAQ.md): a FAQ for all of your burning questions relating to Chaincode. -## API developer guide +## Application developer guide + + - [APIs - CLI, REST, and Node.js](API/CoreAPI.md) + - [CLI](API/CoreAPI.md#cli): working with the command-line interface. + - [REST](API/CoreAPI.md#rest-api): working with the REST API (*deprecated*). + - [Node.js SDK](nodeSDK/node-sdk-guide.md): working with the Node.js SDK. + +## Fabric developer guide -- [APIs - CLI, REST, and Node.js](API/CoreAPI.md) - - [CLI](API/CoreAPI.md#cli): working with the command-line interface. - - [REST](API/CoreAPI.md#rest-api): working with the REST API. - - [Node.js SDK](nodeSDK/node-sdk-guide.md): working with the Node.js SDK. + - [Making code contributions](CONTRIBUTING.md): First, you'll want to familiarize + yourself with the project's contribution guidelines. + - [Setting up the development environment](dev-setup/devenv.md): after that, you + will want to set up your development environment. + - [Building the fabric core](dev-setup/build.md): next, try building the project + in your local development environment to ensure that everything is set up + correctly. + - [Building outside of Vagrant](dev-setup/build.md#building-outside-of-vagrant): + for the *adventurous*, you might try to build outside of the standard Vagrant + development environment. + - [Logging control](Setup/logging-control.md): describes how to tweak the logging + levels of various components within the fabric. + - [License header](dev-setup/headers.txt): every source file must include this + license header modified to include a copyright statement for the principle + author(s). # Operations guide -- [Setting Up a Network](Setup/Network-setup.md): instructions for setting up a -network of fabric peers. -- [Certificate Authority (CA) Setup](Setup/ca-setup.md): setting up a CA to -support identity, security (authentication/authorization), privacy and -confidentiality. -- [Application ACL](tech/application-ACL.md): working with access control lists. + - [Setting Up a Network](Setup/Network-setup.md): instructions for setting up a + network of fabric peers. + - [Certificate Authority (CA) Setup](Setup/ca-setup.md): setting up a CA to + support identity, security (authentication/authorization), privacy and + confidentiality. + - [Application ACL](tech/application-ACL.md): working with access control lists. -## License +# License The Hyperledger Project uses the [Apache License Version 2.0](LICENSE) software license. diff --git a/docs/nodeSDK/node-sdk-self-contained.md b/docs/nodeSDK/node-sdk-self-contained.md deleted file mode 100755 index 08c6e4fac48..00000000000 --- a/docs/nodeSDK/node-sdk-self-contained.md +++ /dev/null @@ -1,99 +0,0 @@ -# Self Contained Node.js Environment - -This section describes how to set up a self contained environment for Node.js application development with the Hyperledger Fabric Node.js SDK. The setup uses **Docker** to provide a controlled environment with all the necessary Hyperledger fabric components to support a Node.js application. There are three **Docker** images that when run will provide a blockchain network environment. There is an image to run a single **Peer**, one to run the **Member Services** and one to run both a Node.js application and the sample chaincode. See [Application Developer's Overview](app-overview.md) on how the components running within the containers will communicate. The sample comes with a sample Node.js application ready to execute and sample chaincode. The sample will be running in developer mode where the chaincode has been built and started prior to the application call to deploy it. The deployment of chaincode in network mode requires that the Hyperledger Fabric Node.js SDK has access to the chaincode source code and all of its dependant code, in order to properly build a deploy request. It also requires that the **peer** have access to **docker** functions to be able to build and deploy the new **docker** image that will run the chaincode. This is a more complicated configuration and not suitable to an introduction to the Hyperledger Fabric Node.js SDK. - -**note:** This sample was prepared using Docker for Mac 1.12.0 - -* Prerequisite software to install: - - * Docker - * docker-compose (may be packaged with Docker) - -* Copy our [docker-compose.yml](https://raw.githubusercontent.com/hyperledger/fabric/master/examples/sdk/node/docker-compose.yml) file to a local directory: - -``` - curl -o docker-compose.yml https://raw.githubusercontent.com/hyperledger/fabric/master/examples/sdk/node/docker-compose.yml -``` -* **Optionally** build your own docker images. - The docker compose environment uses three docker images. If you wish to customize and build your own docker images. The following [Dockerfile](https://raw.githubusercontent.com/hyperledger/fabric/master/examples/sdk/node/Dockerfile) - was used to build the **nodesdk** image and may be used as a starting point to your own customizations. -``` - curl -o Dockerfile https://raw.githubusercontent.com/hyperledger/fabric/master/examples/sdk/node/Dockerfile - docker build -t hyperledger/fabric-node-sdk:latest . -``` - -* Start the fabric network environment using docker-compose. From a terminal session that has the working directory of where the above *docker-compose.yml* is located, execute one of following **docker-compose** commands. - - * to run as detached containers: - ``` - docker-compose up -d - ``` - **note:** to see the logs for the **peer** container use the `docker logs peer` command - - * to run in the foreground and see the log output in the current terminal session: - ``` - 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** images will be downloaded. This may take 10 minutes or more depending on the network connections of the system running the command. - ``` - docker ps - ``` - - You should see something like the following: - ``` - CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES - bb01a2fa96ef hyperledger/fabric-node-sdk "sh -c 'sleep 20; /op" About a minute ago Up 59 seconds nodesdk - ec7572e65f12 hyperledger/fabric-peer "sh -c 'sleep 10; pee" About a minute ago Up About a minute peer - 118ef6da1709 hyperledger/fabric-membersrvc "membersrvc" About a minute ago Up About a minute membersrvc - ``` - -* Start a terminal session in the **nodesdk** container. This is where the 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. - -``` - docker exec -it nodesdk /bin/bash -``` - -* From the terminal session in the **nodesdk** container execute the standalone 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. - -``` - 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) -``` - docker logs peer -``` - -* If you wish to run your own Node.js application using the pre build docker images: - * use the directories in the `volumes` tag under **nodesdk** 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 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. - -```yaml - volumes: - - ~/mytest:/user/mytest -``` - * copy or create and edit your application in the `~/mytest` directory as stated in the `docker-compose.yml` `volumes` tag under **nodesdk** container. - * 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 **nodesdk** docker container using the commands -``` - docker exec -it nodesdk /bin/bash -``` - once in the shell, and assuming your Node.js application is called `app.js` -``` - cd /user/mytest - node app -``` -* To shutdown the environment, execute the following **docker-compose** command in the directory where the *docker-compose.yml* is located. Any changes you made to the sample application or deployment of a chaincode will be lost. Only changes made to the shared area defined in the 'volumes' tag of the **nodesdk** container will persist. This will shutdown each of the containers and remove 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 - -``` - docker-compose kill -``` diff --git a/docs/releases.md b/docs/releases.md new file mode 100644 index 00000000000..51ba90eadfc --- /dev/null +++ b/docs/releases.md @@ -0,0 +1,62 @@ + + +[v0.6-preview](https://github.com/hyperledger/fabric/tree/v0.6) September 16, 2016 + +A developer preview release of the Hyperledger Fabric intended +to exercise the release logistics and stabilize a set of capabilities for +developers to try out. This will be the last release under the original +architecture. All subsequent releases will deliver on the +[v1.0 architecture](TODO). + +Key enhancements: + +* 8de58ed - NodeSDK doc changes -- FAB-146 +* 62d866d - Add flow control to SYNC_STATE_SNAPSHOT +* 4d97069 - Adding TLS changes to SDK +* e9d3ac2 - Node-SDK: add support for fabric events(block, chaincode, transactional) +* 7ed9533 - Allow deploying Java chaincode from remote git repositories +* 4bf9b93 - Move Docker-Compose files into their own folder +* ce9fcdc - Print ChaincodeName when deploy with CLI +* 4fa1360 - Upgrade go protobuf from 3-beta to 3 +* 4b13232 - Table implementation in java shim with example +* df741bc - Add support for dynamically registering a user with attributes +* 4203ea8 - Check for duplicates when adding peers to the chain +* 518f3c9 - Update docker openjdk image +* 47053cd - Add GetTxID function to Stub interface (FAB-306) +* ac182fa - Remove deprecated devops REST API +* ad4645d - Support hyperledger fabric build on ppc64le platform +* 21a4a8a - SDK now properly adding a peer with an invalid URL +* 1d8114f - Fix setting of watermark on restore from crash +* a98c59a - Upgrade go protobuff from 3-beta to 3 +* 937039c - DEVENV: Provide strong feedback when provisioning fails +* d74b1c5 - Make pbft broadcast timeout configurable +* 97ed71f - Java shim/chaincode project reorg, separate java docker env +* a76dd3d - Start container with HostConfig was deprecated since v1.10 and removed since v1.12 +* 8b63a26 - Add ability to unregister for events +* 3f5b2fa - Add automatic peer command detection +* 6daedfd - Re-enable sending of chaincode events +* b39c93a - Update Cobra and pflag vendor libraries +* dad7a9d - Reassign port numbers to 7050-7060 range + +[v0.5-developer-preview](https://github.com/hyperledger-archives/fabric/tree/v0.5-developer-preview) +June 17, 2016 + +A developer preview release of the Hyperledger Fabric intended +to exercise the release logistics and stabilize a set of capabilities for +developers to try out. + +Key features: + +Permissioned blockchain with immediate finality +Chaincode (aka smart contract) execution environments +Docker container (user chaincode) +In-process with peer (system chaincode) +Pluggable consensus with PBFT, NOOPS (development mode), SIEVE (prototype) +Event framework supports pre-defined and custom events +Client SDK (Node.js), basic REST APIs and CLIs +Known Key Bugs and work in progress + +* 1895 - Client SDK interfaces may crash if wrong parameter specified +* 1901 - Slow response after a few hours of stress testing +* 1911 - Missing peer event listener on the client SDK +* 889 - The attributes in the TCert are not encrypted. This work is still on-going diff --git a/docs/starter/fabric-starter-kit.md b/docs/starter/fabric-starter-kit.md index 7d199ad1281..85485680a71 100644 --- a/docs/starter/fabric-starter-kit.md +++ b/docs/starter/fabric-starter-kit.md @@ -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 your -chaincode. See [Application Developer's Overview](../nodeSDK/app-overview.md) on how the +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 components running within the containers will communicate. The starter kit comes with a sample Node.js application ready to execute and @@ -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 @@ -45,9 +45,11 @@ 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, 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) + + 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) is used to build the base **fabric-starter-kit** image and may be used as a starting point for your own customizations. @@ -62,69 +64,71 @@ is located, execute one of following `docker-compose` commands. * to run as detached containers: -``` - docker-compose up -d -``` + ``` + docker-compose up -d + ``` + **note:** to see the logs for the `peer` container use the `docker logs peer` command * to run in the foreground and see the log output in the current terminal session: -``` - docker-compose up -``` + ``` + docker-compose up + ``` - 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 + Both commands will start three docker containers, to view the container + status try `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 -``` - You should see something similar to the following: + ``` + docker ps + ``` -``` - CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES - bb01a2fa96ef hyperledger/fabric-starter-kit "sh -c 'sleep 20; /op" About a minute ago Up 59 seconds starter - ec7572e65f12 hyperledger/fabric-peer "sh -c 'sleep 10; pee" About a minute ago Up About a minute peer - 118ef6da1709 hyperledger/fabric-membersrvc "membersrvc" About a minute ago Up About a minute membersrvc -``` + You should see something like the following: + + ``` + CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES + bb01a2fa96ef hyperledger/fabric-starter-kit "sh -c 'sleep 20; /op" About a minute ago Up 59 seconds starter + ec7572e65f12 hyperledger/fabric-peer "sh -c 'sleep 10; pee" About a minute ago Up About a minute peer + 118ef6da1709 hyperledger/fabric-membersrvc "membersrvc" About a minute ago Up About a minute membersrvc + ``` * Start a terminal session in the **starter** container. This is where the 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-built Docker +* If you wish to run your own Node.js application using the pre build 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. @@ -135,18 +139,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 - following commands: + 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 @@ -163,7 +167,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 diff --git a/examples/sdk/node/docker-compose.yml b/examples/sdk/node/docker-compose.yml index 665be721cd3..64302ade722 100644 --- a/examples/sdk/node/docker-compose.yml +++ b/examples/sdk/node/docker-compose.yml @@ -27,10 +27,11 @@ peer: links: - membersrvc -nodesdk: - container_name: starter-kit +starter: + container_name: starter image: hyperledger/fabric-starter-kit volumes: + # tweak this to map a local developmnt directory tree into the container - ~/mytest:/user/mytest environment: - MEMBERSRVC_ADDRESS=membersrvc:7054