@@ -375,27 +375,29 @@ in this sample network.
375
375
2017-06-12 21:01:37.562 EDT [msp] getMspConfig -> INFO 003 crls folder not found at [/Users/xxx/dev/byfn/crypto-config/ordererOrganizations/example.com/msp/intermediatecerts]. Skipping.: [stat /Users/xxx/dev/byfn/crypto-config/ordererOrganizations/example.com/msp/crls: no such file or directory]
376
376
2017-06-12 21:01:37.562 EDT [msp] getMspConfig -> INFO 004 MSP configuration file not found at [/Users/xxx/dev/byfn/crypto-config/ordererOrganizations/example.com/msp/config.yaml]: [stat /Users/xxx/dev/byfn/crypto-config/ordererOrganizations/example.com/msp/config.yaml: no such file or directory]
377
377
378
- Next, we need to create the channel transaction artifact. Be sure to set the
379
- <channel-ID> parameter ::
378
+ Next, we need to create the channel transaction artifact. Be sure to replace $CHANNEL_NAME or
379
+ set CHANNEL_NAME as an environment variable that can be used throughout these instructions ::
380
380
381
381
.. code :: bash
382
382
383
+ export CHANNEL_NAME=mychannel
384
+
383
385
# this file contains the definitions for our sample channel
384
- ../bin/configtxgen -profile TwoOrgsChannel -outputCreateChannelTx ./channel-artifacts/channel.tx -channelID < channel-ID >
386
+ ../bin/configtxgen -profile TwoOrgsChannel -outputCreateChannelTx ./channel-artifacts/channel.tx -channelID $CHANNEL_NAME
385
387
386
388
Next, we will define the anchor peer for Org1 on the channel that we are
387
- constructing. Again, be sure to set the <channel-ID> parameter as appropriate
389
+ constructing. Again, be sure to replace $CHANNEL_NAME or set the environment variable
388
390
for the following commands:
389
391
390
392
.. code :: bash
391
393
392
- ../bin/configtxgen -profile TwoOrgsChannel -outputAnchorPeersUpdate ./channel-artifacts/Org1MSPanchors.tx -channelID < channel-ID > -asOrg Org1MSP
394
+ ../bin/configtxgen -profile TwoOrgsChannel -outputAnchorPeersUpdate ./channel-artifacts/Org1MSPanchors.tx -channelID $CHANNEL_NAME -asOrg Org1MSP
393
395
394
396
Now, we will define the anchor peer for Org2 on the same channel:
395
397
396
398
.. code :: bash
397
399
398
- ../bin/configtxgen -profile TwoOrgsChannel -outputAnchorPeersUpdate ./channel-artifacts/Org2MSPanchors.tx -channelID < channel-ID > -asOrg Org2MSP
400
+ ../bin/configtxgen -profile TwoOrgsChannel -outputAnchorPeersUpdate ./channel-artifacts/Org2MSPanchors.tx -channelID $CHANNEL_NAME -asOrg Org2MSP
399
401
400
402
Start the network
401
403
-----------------
@@ -426,7 +428,7 @@ Start your network:
426
428
427
429
.. code :: bash
428
430
429
- CHANNEL_NAME=< channel-id > TIMEOUT=< pick_a_value> docker-compose -f docker-compose-cli.yaml up -d
431
+ CHANNEL_NAME=$CHANNEL_NAME TIMEOUT=< pick_a_value> docker-compose -f docker-compose-cli.yaml up -d
430
432
431
433
If you want to see the realtime logs for your network, then do not supply the ``-d `` flag.
432
434
If you let the logs stream, then you will need to open a second terminal to execute the CLI calls.
@@ -487,7 +489,7 @@ you can mount your own configuration transaction with a different name.
487
489
# we also pass the path for the orderer ca-cert in order to verify the TLS handshake
488
490
# be sure to replace the $CHANNEL_NAME variable appropriately
489
491
490
- peer channel create -o orderer.example.com:7050 -c $CHANNEL_NAME -f ./channel-artifacts/channel.tx --tls $CORE_PEER_TLS_ENABLED --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/cacerts/ca .example.com-cert.pem
492
+ peer channel create -o orderer.example.com:7050 -c $CHANNEL_NAME -f ./channel-artifacts/channel.tx --tls $CORE_PEER_TLS_ENABLED --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca .example.com-cert.pem
491
493
492
494
This command returns a genesis block - ``<channel-ID.block> `` - which we will use to join the channel.
493
495
It contains the configuration information specified in ``channel.tx ``.
@@ -541,7 +543,7 @@ If we changed the syntax to ``AND`` then we would need two endorsements.
541
543
# be sure to replace the $CHANNEL_NAME environment variable
542
544
# if you did not install your chaincode with a name of mycc, then modify that argument as well
543
545
544
- peer chaincode instantiate -o orderer.example.com:7050 --tls $CORE_PEER_TLS_ENABLED --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/cacerts/ca .example.com-cert.pem -C $CHANNEL_NAME -n mycc -v 1.0 -c ' {"Args":["init","a", "100", "b","200"]}' -P " OR ('Org1MSP.member','Org2MSP.member')"
546
+ peer chaincode instantiate -o orderer.example.com:7050 --tls $CORE_PEER_TLS_ENABLED --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca .example.com-cert.pem -C $CHANNEL_NAME -n mycc -v 1.0 -c ' {"Args":["init","a", "100", "b","200"]}' -P " OR ('Org1MSP.member','Org2MSP.member')"
545
547
546
548
See the `endorsement
547
549
policies <http://hyperledger-fabric.readthedocs.io/en/latest/endorsement-policies.html> `__
@@ -570,7 +572,7 @@ update the state DB. The syntax for invoke is as follows:
570
572
571
573
# be sure to set the -C and -n flags appropriately
572
574
573
- peer chaincode invoke -o orderer.example.com:7050 --tls $CORE_PEER_TLS_ENABLED --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/cacerts/ca .example.com-cert.pem -C $CHANNEL_NAME -n mycc -c ' {"Args":["invoke","a","b","10"]}'
575
+ peer chaincode invoke -o orderer.example.com:7050 --tls $CORE_PEER_TLS_ENABLED --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca .example.com-cert.pem -C $CHANNEL_NAME -n mycc -c ' {"Args":["invoke","a","b","10"]}'
574
576
575
577
Query
576
578
^^^^^
@@ -781,7 +783,7 @@ the network pass the couchdb docker-compose as well:
781
783
782
784
.. code :: bash
783
785
784
- CHANNEL_NAME=< channel-id > TIMEOUT=< pick_a_value> docker-compose -f docker-compose-cli.yaml -f docker-compose-couch.yaml up -d
786
+ CHANNEL_NAME=$CHANNEL_NAME TIMEOUT=< pick_a_value> docker-compose -f docker-compose-cli.yaml -f docker-compose-couch.yaml up -d
785
787
786
788
**chaincode_example02 ** should now work using CouchDB underneath.
787
789
@@ -809,21 +811,21 @@ channel, use the following steps to interact with the **marbles02** chaincode:
809
811
810
812
# be sure to modify the $CHANNEL_NAME variable accordingly for the instantiate command
811
813
812
- peer chaincode install -o orderer.example.com:7050 - n marbles -v 1.0 -p github.com/hyperledger/fabric/examples/chaincode/go/marbles02
813
- peer chaincode instantiate -o orderer.example.com:7050 --tls $CORE_PEER_TLS_ENABLED --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/cacerts/ca .example.com-cert.pem -C $CHANNEL_NAME -n marbles -v 1.0 -c ' {"Args":["init"]}' -P " OR ('Org0MSP.member','Org1MSP.member')"
814
+ peer chaincode install -n marbles -v 1.0 -p github.com/hyperledger/fabric/examples/chaincode/go/marbles02
815
+ peer chaincode instantiate -o orderer.example.com:7050 --tls $CORE_PEER_TLS_ENABLED --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca .example.com-cert.pem -C $CHANNEL_NAME -n marbles -v 1.0 -c ' {"Args":["init"]}' -P " OR ('Org0MSP.member','Org1MSP.member')"
814
816
815
817
- Create some marbles and move them around:
816
818
817
819
.. code :: bash
818
820
819
821
# be sure to modify the $CHANNEL_NAME variable accordingly
820
822
821
- peer chaincode invoke -o orderer.example.com:7050 --tls $CORE_PEER_TLS_ENABLED --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/cacerts/ca .example.com-cert.pem -C $CHANNEL_NAME -n marbles -c ' {"Args":["initMarble","marble1","blue","35","tom"]}'
822
- peer chaincode invoke -o orderer.example.com:7050 --tls $CORE_PEER_TLS_ENABLED --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/cacerts/ca .example.com-cert.pem -C $CHANNEL_NAME -n marbles -c ' {"Args":["initMarble","marble2","red","50","tom"]}'
823
- peer chaincode invoke -o orderer.example.com:7050 --tls $CORE_PEER_TLS_ENABLED --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/cacerts/ca .example.com-cert.pem -C $CHANNEL_NAME -n marbles -c ' {"Args":["initMarble","marble3","blue","70","tom"]}'
824
- peer chaincode invoke -o orderer.example.com:7050 --tls $CORE_PEER_TLS_ENABLED --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/cacerts/ca .example.com-cert.pem -C $CHANNEL_NAME -n marbles -c ' {"Args":["transferMarble","marble2","jerry"]}'
825
- peer chaincode invoke -o orderer.example.com:7050 --tls $CORE_PEER_TLS_ENABLED --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/cacerts/ca .example.com-cert.pem -C $CHANNEL_NAME -n marbles -c ' {"Args":["transferMarblesBasedOnColor","blue","jerry"]}'
826
- peer chaincode invoke -o orderer.example.com:7050 --tls $CORE_PEER_TLS_ENABLED --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/cacerts/ca .example.com-cert.pem -C $CHANNEL_NAME -n marbles -c ' {"Args":["delete","marble1"]}'
823
+ peer chaincode invoke -o orderer.example.com:7050 --tls $CORE_PEER_TLS_ENABLED --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca .example.com-cert.pem -C $CHANNEL_NAME -n marbles -c ' {"Args":["initMarble","marble1","blue","35","tom"]}'
824
+ peer chaincode invoke -o orderer.example.com:7050 --tls $CORE_PEER_TLS_ENABLED --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca .example.com-cert.pem -C $CHANNEL_NAME -n marbles -c ' {"Args":["initMarble","marble2","red","50","tom"]}'
825
+ peer chaincode invoke -o orderer.example.com:7050 --tls $CORE_PEER_TLS_ENABLED --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca .example.com-cert.pem -C $CHANNEL_NAME -n marbles -c ' {"Args":["initMarble","marble3","blue","70","tom"]}'
826
+ peer chaincode invoke -o orderer.example.com:7050 --tls $CORE_PEER_TLS_ENABLED --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca .example.com-cert.pem -C $CHANNEL_NAME -n marbles -c ' {"Args":["transferMarble","marble2","jerry"]}'
827
+ peer chaincode invoke -o orderer.example.com:7050 --tls $CORE_PEER_TLS_ENABLED --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca .example.com-cert.pem -C $CHANNEL_NAME -n marbles -c ' {"Args":["transferMarblesBasedOnColor","blue","jerry"]}'
828
+ peer chaincode invoke -o orderer.example.com:7050 --tls $CORE_PEER_TLS_ENABLED --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca .example.com-cert.pem -C $CHANNEL_NAME -n marbles -c ' {"Args":["delete","marble1"]}'
827
829
828
830
- If you chose to map the CouchDB ports in docker-compose, you can now view
829
831
the state database through the CouchDB web interface (Fauxton) by opening
0 commit comments