@@ -172,7 +172,8 @@ for the sake of convenience we will also provide them here.
172
172
173
173
First let's run the cryptogen tool. Our binary is in the ``bin ``
174
174
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:
176
177
177
178
.. code :: bash
178
179
@@ -190,7 +191,7 @@ present working directory:
190
191
191
192
.. code :: bash
192
193
193
- FABRIC_CFG_PATH=$PWD
194
+ export FABRIC_CFG_PATH=$PWD
194
195
195
196
Create the orderer genesis block:
196
197
@@ -231,9 +232,13 @@ Run the shell script
231
232
^^^^^^^^^^^^^^^^^^^^
232
233
233
234
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...
237
242
238
243
Make sure you are in the ``<your_platform> `` directory where the script resides.
239
244
Decide upon a unique name for your channel and replace the <channel-ID> parm
@@ -281,7 +286,7 @@ Start the network
281
286
282
287
We will leverage a docker-compose script to spin up our network. The docker-compose
283
288
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
285
290
the ``docker-compose-cli.yaml `` file and comment out the script.sh in the CLI
286
291
container. Your docker-compose should look like this:
287
292
@@ -405,7 +410,7 @@ container for the targeted peer. Take note of the ``-P`` argument. This is our
405
410
level of endorsement for a transaction against this chaincode to be validated.
406
411
In the command below you’ll notice that we specify our policy as
407
412
``-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).
409
414
If we changed the syntax to ``AND `` then we would need two endorsements.
410
415
411
416
.. code :: bash
@@ -422,7 +427,7 @@ documentation for more details on policy implementation.
422
427
Query
423
428
^^^^^
424
429
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
426
431
instantiated and the state DB was populated. The syntax for query is as follows:
427
432
428
433
.. code :: bash
@@ -435,7 +440,7 @@ instantiated and the state DB was populated. The syntax for query is as follows:
435
440
Invoke
436
441
^^^^^^
437
442
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
439
444
update the state DB. The syntax for invoke is as follows:
440
445
441
446
.. code :: bash
@@ -448,8 +453,9 @@ Query
448
453
^^^^^
449
454
450
455
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.
453
459
454
460
.. code :: bash
455
461
@@ -479,40 +485,8 @@ Clean up
479
485
480
486
Let's clean up first...
481
487
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:
516
490
517
491
.. code :: bash
518
492
@@ -966,9 +940,25 @@ back and recreate your channel artifacts.
966
940
967
941
./network_setup.sh down
968
942
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
+
969
960
- If you continue to see errors, share your logs on the **# fabric-questions **
970
961
channel on `Hyperledger Rocket Chat <https://chat.hyperledger.org/home >`__.
971
962
972
963
.. Licensed under Creative Commons Attribution 4.0 International License
973
964
https://creativecommons.org/licenses/by/4.0/
974
-
0 commit comments