From dca94df500461440da165066a7cacc3f1580b811 Mon Sep 17 00:00:00 2001 From: "Binh Q. Nguyen" Date: Sun, 15 Jan 2017 23:41:13 -0500 Subject: [PATCH] Fix error in channel setup instruction Rework some text and invoke transaction sample Change-Id: Ie6927316494cace186fdac4f14e7443e1779c692 Signed-off-by: Binh Q. Nguyen --- docs/channel-setup.md | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/docs/channel-setup.md b/docs/channel-setup.md index 21f64dc7e00..f0655fb3eae 100644 --- a/docs/channel-setup.md +++ b/docs/channel-setup.md @@ -14,23 +14,22 @@ The commands are work in progress. In particular, there will be more configurati https://jira.hyperledger.org/browse/FAB-1639 https://jira.hyperledger.org/browse/FAB-1580 ``` +Assuming the orderer and peer have been built, and the executables are available in build/bin directory. Switch to build/bin directory. ## Create a channel ### Using CLI in Vagrant environment _Vagrant window 1 - start orderer_ ``` -cd orderer ORDERER_GENERAL_LOGLEVEL=debug ./orderer ``` _Vagrant window 2 - ask orderer to create a chain_ ``` -cd peer -peer channel create -c mychannel +peer channel create -c myc1 ``` -On successful creation, a genesis block mychannel.block is saved in the same directory. +On successful creation, a genesis block myc1.block is saved in build/bin directory. ### Using docker environment TODO @@ -40,23 +39,21 @@ TODO _Vagrant window 3 - start the peer in a "chainless" mode_ ``` -#NOTE - clear the environment with rm -rf /var/hyperledger/* after updating fabric to get channel support. +#NOTE - clear the environment with rm -rf /var/hyperledger/* after updating fabric to get channel support. -cd peer peer node start --peer-defaultchain=false ``` ``` -"--peer-defaultchain=true" is the default. It allow users continue to work with the default **TEST_CHAINID** without having to join a chain. +"--peer-defaultchain=true" is the default. It allow users continue to work with the default **TEST_CHAINID** without having to join a chain. -"--peer-defaultchain=false" starts the peer with only the channels that were joined by the peer. If the peer never joined a channel it would start up without any channels. In particular, it does not have the default **TEST_CHAINID** support. +"--peer-defaultchain=false" starts the peer with only the channels that were joined by the peer. If the peer never joined a channel it would start up without any channels. In particular, it does not have the default **TEST_CHAINID** support. -To join channels, a peer MUST be started with the "--peer-defaultchain=false" option. +To join channels, a peer MUST be started with the "--peer-defaultchain=false" option. ``` -_Vagrant window 4 - peer to join a channel_ +_Vagrant window 2 - peer to join a channel_ ``` -cd peer peer channel join -b myc1.block ``` @@ -71,7 +68,6 @@ At this point we can issue transactions. _Vagrant window 2 - deploy a chaincode to myc1_ ``` -cd peer peer chaincode deploy -C myc1 -n mycc -p github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02 -c '{"Args":["init","a","100","b","200"]}' ``` @@ -82,8 +78,7 @@ Wait for the deploy to get committed (e.g., by default the `solo orderer` can ta _Vagrant window 2 - invoke chaincode_ ``` - cd peer - peer chaincode query -C myc1 -n mycc -c '{"Args":["invoke","a","b","10"]}' +peer chaincode invoke -C myc1 -n mycc -c '{"Args":["invoke","a","b","10"]}' ``` Wait for upto 10 seconds for the invoke to get committed. @@ -91,9 +86,9 @@ Wait for upto 10 seconds for the invoke to get committed. _Vagrant window 2 - query chaincode_ ``` - cd peer - peer chaincode query -C myc1 -n mycc -c '{"Args":["query","a"]}' +peer chaincode query -C myc1 -n mycc -c '{"Args":["query","a"]}' ``` ### Using docker environment TODO +To reset, clear out the `fileSystemPath` directory (defined in core.yaml) and myc1.block.