Skip to content

Commit 082991b

Browse files
committed
[FAB-3111] - Additions to getting started
few updates to expedite clean up and fixed an incorrect command that did not specify "export" add to troubleshooting [ci-skip] Change-Id: Ifa83ce6c846e01ac0cbf4690ec970c3995d9e86f Signed-off-by: Nick Gaski <[email protected]>
1 parent 8b3c35c commit 082991b

File tree

1 file changed

+36
-46
lines changed

1 file changed

+36
-46
lines changed

docs/source/getting_started.rst

+36-46
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,8 @@ for the sake of convenience we will also provide them here.
172172

173173
First let's run the cryptogen tool. Our binary is in the ``bin``
174174
directory, so we need to provide the relative path to where the tool resides.
175-
Make sure you are in ``<your_platform>:
175+
Make sure you are in the directory correlated to your platform. For example,
176+
OSX users would be in ``release/darwin-amd64`` when running the following commands:
176177

177178
.. code:: bash
178179
@@ -190,7 +191,7 @@ present working directory:
190191

191192
.. code:: bash
192193
193-
FABRIC_CFG_PATH=$PWD
194+
export FABRIC_CFG_PATH=$PWD
194195
195196
Create the orderer genesis block:
196197

@@ -231,9 +232,13 @@ Run the shell script
231232
^^^^^^^^^^^^^^^^^^^^
232233

233234
You can skip this step if you just manually generated the crypto and artifacts.
234-
However, if you want to see this script in action, delete the ``crypto-config``
235-
folder and remove the four artifacts from your ``channel-artifacts`` folder.
236-
Then proceed...
235+
However, if you want to see this script in action, delete your crypto material
236+
and channel artifacts with the following command:
237+
238+
.. code:: bash
239+
./network_setup.sh down
240+
241+
Now proceed...
237242

238243
Make sure you are in the ``<your_platform>`` directory where the script resides.
239244
Decide upon a unique name for your channel and replace the <channel-ID> parm
@@ -281,7 +286,7 @@ Start the network
281286

282287
We will leverage a docker-compose script to spin up our network. The docker-compose
283288
points to the images that we have already downloaded, and bootstraps the orderer
284-
with our previously generated orderer.block. Before launching the network, open
289+
with our previously generated ``orderer.block``. Before launching the network, open
285290
the ``docker-compose-cli.yaml`` file and comment out the script.sh in the CLI
286291
container. Your docker-compose should look like this:
287292

@@ -405,7 +410,7 @@ container for the targeted peer. Take note of the ``-P`` argument. This is our
405410
level of endorsement for a transaction against this chaincode to be validated.
406411
In the command below you’ll notice that we specify our policy as
407412
``-P "OR ('Org0MSP.member','Org1MSP.member')"``. This means that we need
408-
“endorsement” from a peer belonging to Org1 OR Org2 (i.e. only one endorsement).
413+
“endorsement” from a peer belonging to Org1 **OR** Org2 (i.e. only one endorsement).
409414
If we changed the syntax to ``AND`` then we would need two endorsements.
410415

411416
.. code:: bash
@@ -422,7 +427,7 @@ documentation for more details on policy implementation.
422427
Query
423428
^^^^^
424429

425-
Let's query for the value of “a” to make sure the chaincode was properly
430+
Let's query for the value of ``a`` to make sure the chaincode was properly
426431
instantiated and the state DB was populated. The syntax for query is as follows:
427432

428433
.. code:: bash
@@ -435,7 +440,7 @@ instantiated and the state DB was populated. The syntax for query is as follows:
435440
Invoke
436441
^^^^^^
437442

438-
Now let's move "10" from "a" to "b". This transaction will cut a new block and
443+
Now let's move ``10`` from ``a`` to ``b``. This transaction will cut a new block and
439444
update the state DB. The syntax for invoke is as follows:
440445

441446
.. code:: bash
@@ -448,8 +453,9 @@ Query
448453
^^^^^
449454

450455
Let's confirm that our previous invocation executed properly. We initialized the
451-
key “a” with a value of “100”. Therefore, removing “10” should return a value of
452-
“90” when we query “a”. The syntax for query is as follows.
456+
key ``a`` with a value of ``100`` and just removed ``10`` with our previous
457+
invocation. Therefore, a query against ``a`` should reveal ``90``. The syntax
458+
for query is as follows.
453459

454460
.. code:: bash
455461
@@ -479,40 +485,8 @@ Clean up
479485

480486
Let's clean up first...
481487

482-
Exit the currently-running containers:
483-
484-
.. code:: bash
485-
486-
docker rm -f $(docker ps -aq)
487-
488-
Execute a ``docker images`` command in your terminal to view the
489-
chaincode images. They will look similar to the following:
490-
491-
.. code:: bash
492-
493-
REPOSITORY TAG IMAGE ID CREATED SIZE
494-
dev-peer1.org2.example.com-mycc-1.0 latest 4bc5e9b5dd97 5 seconds ago 176 MB
495-
dev-peer0.org1.example.com-mycc-1.0 latest 6f2aeb032076 22 seconds ago 176 MB
496-
dev-peer0.org2.example.com-mycc-1.0 latest 509b8e393cc6 39 seconds ago 176 MB
497-
498-
Remove these images:
499-
500-
.. code:: bash
501-
502-
docker rmi <IMAGE ID> <IMAGE ID> <IMAGE ID>
503-
504-
For example:
505-
506-
.. code:: bash
507-
508-
docker rmi -f 4bc 6f2 509
509-
510-
Lastly, remove the ``crypto-config`` folder and the four artifacts within the
511-
``channel-artifacts`` folder.
512-
513-
**OR**
514-
515-
You can execute the following command which will do all of the above:
488+
The following script will kill our containers, remove the crypto material and
489+
four artifacts, and remove our three chaincode images:
516490

517491
.. code:: bash
518492
@@ -966,9 +940,25 @@ back and recreate your channel artifacts.
966940
967941
./network_setup.sh down
968942
943+
- If you see an error stating that you still have "active endpoints", then prune
944+
your docker networks. This will wipe your previous networks and start you with a
945+
fresh environment:
946+
947+
.. code:: bash
948+
949+
docker network prune
950+
951+
You will see the following message:
952+
953+
.. code:: bash
954+
955+
WARNING! This will remove all networks not used by at least one container.
956+
Are you sure you want to continue? [y/N]
957+
958+
Select ``y``.
959+
969960
- If you continue to see errors, share your logs on the **# fabric-questions**
970961
channel on `Hyperledger Rocket Chat <https://chat.hyperledger.org/home>`__.
971962

972963
.. Licensed under Creative Commons Attribution 4.0 International License
973964
https://creativecommons.org/licenses/by/4.0/
974-

0 commit comments

Comments
 (0)