Skip to content

Commit

Permalink
[FAB-7527] Fixes BYFN docs to match latest improvements
Browse files Browse the repository at this point in the history
This changes the Build Your First Network tutorial to refer to the
updated version of the sample.

It also fixes a few unrelated warnings produced when building the doc.

This change depends on change #16371.

Change-Id: I521991793c5138c56dfa694748aa029a541941f3
Signed-off-by: Arnaud J Le Hors <lehors@us.ibm.com>
  • Loading branch information
lehors committed Dec 20, 2017
1 parent ce8c0ab commit 297de6e
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 52 deletions.
2 changes: 1 addition & 1 deletion docs/source/Fabric-FAQ.rst
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ defining that currency will get called) every time a transaction is processed
on its chain.

Differences in Most Recent Releases
-----------
-----------------------------------
Q. As part of the v1.0.0 release, what are the highlight differences between v0.6 and v1.0?

A. The differences between any subsequent releases are provided together with the
Expand Down
84 changes: 36 additions & 48 deletions docs/source/build_network.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,30 +51,32 @@ Here's the help text for the ``byfn.sh`` script:
./byfn.sh --help
Usage:
byfn.sh -m up|down|restart|generate [-c <channel name>] [-t <timeout>] [-d <delay>] [-f <docker-compose-file>] [-s <dbtype>]
byfn.sh up|down|restart|generate [-c <channel name>] [-t <timeout>] [-d <delay>] [-f <docker-compose-file>] [-s <dbtype>]
byfn.sh -h|--help (print this message)
-m <mode> - one of 'up', 'down', 'restart' or 'generate'
<mode> - one of 'up', 'down', 'restart' or 'generate'
- 'up' - bring up the network with docker-compose up
- 'down' - clear the network with docker-compose down
- 'restart' - restart the network
- 'generate' - generate required certificates and genesis block
-c <channel name> - channel name to use (defaults to "mychannel")
-t <timeout> - CLI timeout duration in seconds (defaults to 10000)
-t <timeout> - CLI timeout duration in seconds (defaults to 10)
-d <delay> - delay duration in seconds (defaults to 3)
-f <docker-compose-file> - specify which docker-compose file use (defaults to docker-compose-cli.yaml)
-s <dbtype> - the database backend to use: goleveldb (default) or couchdb
-l <language> - the chaincode language: golang (default) or node
-a - don't ask for confirmation before proceeding
Typically, one would first generate the required certificates and
genesis block, then bring up the network. e.g.:
byfn.sh -m generate -c mychannel
byfn.sh -m up -c mychannel -s couchdb
byfn.sh generate -c mychannel
byfn.sh up -c mychannel -s couchdb
If you choose not to supply a channel name, then the
script will use a default name of ``mychannel``. The CLI timeout parameter
(specified with the -t flag) is an optional value; if you choose not to set
it, then your CLI container will exit after the default setting of 10000 seconds.
it, then the CLI will give up on query requests made after the default
setting of 10 seconds.
Generate Network Artifacts
^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -83,15 +85,15 @@ Ready to give it a go? Okay then! Execute the following command:
.. code:: bash
./byfn.sh -m generate
./byfn.sh generate
You will see a brief description as to what will occur, along with a yes/no command line
prompt. Respond with a ``y`` to execute the described action.
prompt. Respond with a ``y`` or hit the return key to execute the described action.
.. code:: bash
Generating certs and genesis block for with channel 'mychannel' and CLI timeout of '10000'
Continue (y/n)?y
Generating certs and genesis block for with channel 'mychannel' and CLI timeout of '10'
Continue? [Y/n] y
proceeding ...
/Users/xxx/dev/fabric-samples/bin/cryptogen
Expand Down Expand Up @@ -145,7 +147,7 @@ Next, you can bring the network up with one of the following commands:
.. code:: bash
./byfn.sh -m up
./byfn.sh up
The above command will compile Golang chaincode images and spin up the corresponding
containers. Go is the default chaincode language, however there is also support
Expand All @@ -157,18 +159,18 @@ chaincode, pass the following command instead:
# we use the -l flag to specify the chaincode language
# forgoing the -l flag will default to Golang
./byfn.sh -m up -l node
./byfn.sh up -l node
.. note:: View the `Hyperledger Fabric Shim <https://fabric-shim.github.io/ChaincodeStub.html>`__
documentation for more info on the node.js chaincode shim APIs.

Once again, you will be prompted as to whether you wish to continue or abort.
Respond with a ``y``:
Respond with a ``y`` or hit the return key:

.. code:: bash
Starting with channel 'mychannel' and CLI timeout of '10000'
Continue (y/n)?y
Starting with channel 'mychannel' and CLI timeout of '10'
Continue? [Y/n]
proceeding ...
Creating network "net_byfn" with the default driver
Creating peer0.org1.example.com
Expand Down Expand Up @@ -200,7 +202,7 @@ completion, it should report the following in your terminal window:
2017-05-16 17:08:01.367 UTC [msp/identity] Sign -> DEBU 007 Sign: digest: E61DB37F4E8B0D32C9FE10E3936BA9B8CD278FAA1F3320B08712164248285C54
Query Result: 90
2017-05-16 17:08:15.158 UTC [main] main -> INFO 008 Exiting.....
===================== Query on PEER3 on channel 'mychannel' is successful =====================
===================== Query on peer1.org2 on channel 'mychannel' is successful =====================
===================== All GOOD, BYFN execution completed =====================
Expand All @@ -224,14 +226,14 @@ and four artifacts, and delete the chaincode images from your Docker Registry:

.. code:: bash
./byfn.sh -m down
./byfn.sh down
Once again, you will be prompted to continue, respond with a ``y``:
Once again, you will be prompted to continue, respond with a ``y`` or hit the return key:

.. code:: bash
Stopping with channel 'mychannel' and CLI timeout of '10000'
Continue (y/n)?y
Stopping with channel 'mychannel' and CLI timeout of '10'
Continue? [Y/n] y
proceeding ...
WARNING: The CHANNEL_NAME variable is not set. Defaulting to a blank string.
WARNING: The TIMEOUT variable is not set. Defaulting to a blank string.
Expand Down Expand Up @@ -460,40 +462,27 @@ Now, we will define the anchor peer for Org2 on the same channel:
Start the network
-----------------

We will leverage a docker-compose script to spin up our network. The
We will leverage a script to spin up our network. The
docker-compose file references the images that we have previously downloaded,
and bootstraps the orderer with our previously generated ``genesis.block``.

.. note:: Before launching the network, open the ``docker-compose-cli.yaml`` file
and comment out the script.sh in the CLI container. Your docker-compose
should be modified to look like this:
We want to go through the commands manually in order to expose the
syntax and functionality of each call.

.. code:: bash
First let's start your network:

working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
# command: /bin/bash -c './scripts/script.sh ${CHANNEL_NAME}; sleep $TIMEOUT'
volumes
.. code:: bash
If left uncommented, that script will exercise all of the CLI commands when the
network is started, as we describe in the :ref:`behind-scenes` section.
However, we want to go through the commands manually in order
to expose the syntax and functionality of each call.
docker-compose -f docker-compose-cli.yaml up -d
The CLI timeout defaults to 10000 seconds. If you need the container available
for longer, you can overwrite this setting by passing in a value for the ``TIMEOUT``
environment variable.
If you want to see the realtime logs for your network, then do not supply the ``-d`` flag.
If you let the logs stream, then you will need to open a second terminal to execute the CLI calls.

Start your network:
The CLI container will stick around idle for 1000 seconds. If it's gone when you need it you can restart it with a simple command:

.. code:: bash
# if you need the CLI accessible beyond 10000 seconds, pass in TIMEOUT=<your_desired_value>
# after the CHANNEL_NAME variable
CHANNEL_NAME=$CHANNEL_NAME docker-compose -f docker-compose-cli.yaml up -d
If you want to see the realtime logs for your network, then do not supply the ``-d`` flag.
If you let the logs stream, then you will need to open a second terminal to execute the CLI calls.
docker start cli
.. _peerenvvars:

Expand Down Expand Up @@ -762,9 +751,8 @@ What's happening behind the scenes?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. note:: These steps describe the scenario in which
``script.sh`` is not commented out in the
docker-compose-cli.yaml file. Clean your network
with ``./byfn.sh -m down`` and ensure
``script.sh`` is run by './byfn.sh up'. Clean your network
with ``./byfn.sh down`` and ensure
this command is active. Then use the same
docker-compose prompt to launch your network again

Expand Down Expand Up @@ -858,7 +846,7 @@ You should see the following output:
2017-05-16 17:08:01.367 UTC [msp/identity] Sign -> DEBU 007 Sign: digest: E61DB37F4E8B0D32C9FE10E3936BA9B8CD278FAA1F3320B08712164248285C54
Query Result: 90
2017-05-16 17:08:15.158 UTC [main] main -> INFO 008 Exiting.....
===================== Query on PEER3 on channel 'mychannel' is successful =====================
===================== Query on peer1.org2 on channel 'mychannel' is successful =====================
===================== All GOOD, BYFN execution completed =====================
Expand Down Expand Up @@ -942,7 +930,7 @@ the network pass ``docker-compose-couch.yaml`` as well:

.. code:: bash
CHANNEL_NAME=$CHANNEL_NAME TIMEOUT=<pick_a_value> docker-compose -f docker-compose-cli.yaml -f docker-compose-couch.yaml up -d
docker-compose -f docker-compose-cli.yaml -f docker-compose-couch.yaml up -d
**chaincode_example02** should now work using CouchDB underneath.

Expand Down
2 changes: 1 addition & 1 deletion docs/source/chaincode4ade.rst
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ a sample dev network. As such, the user can immediately jump into the process
of compiling chaincode and driving calls.

Install Hyperledger Fabric Samples
----------------------
----------------------------------

If you haven't already done so, please install the :doc:`samples`.

Expand Down
4 changes: 2 additions & 2 deletions docs/source/channel_update.rst
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Org3 entities and the network's ordering node.
Now we're ready to reconfigure...

Start the ``configtxlator`` server
=================================
==================================

The update process makes use of the configuration translator tool - ``configtxlator``.
This tool provides a true stateless REST API, independent of the
Expand Down Expand Up @@ -447,7 +447,7 @@ and reissue the ``peer channel join command``:
peer channel join -b mychannel.block
Upgrade & invoke
===============
================

The final piece of the puzzle is to increment the chaincode version and update
the endorsement policy to include Org3. Stay in the Org3 CLI container and
Expand Down

0 comments on commit 297de6e

Please sign in to comment.