Skip to content

Commit

Permalink
Fix error in channel setup instruction
Browse files Browse the repository at this point in the history
Rework some text and invoke transaction sample

Change-Id: Ie6927316494cace186fdac4f14e7443e1779c692
Signed-off-by: Binh Q. Nguyen <binhn@us.ibm.com>
  • Loading branch information
binhn committed Jan 16, 2017
1 parent ad02d0c commit dca94df
Showing 1 changed file with 11 additions and 16 deletions.
27 changes: 11 additions & 16 deletions docs/channel-setup.md
Original file line number Diff line number Diff line change
@@ -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,18 +78,17 @@ 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.

_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.

0 comments on commit dca94df

Please sign in to comment.