Skip to content

Commit

Permalink
Update CLI related docs
Browse files Browse the repository at this point in the history
This commit updates CLI related docs adding both
forms of chaincode operations (with or without
Function).
[ci skip]

Change-Id: I85ecd24bf644e44c325557c77a88ff55aedc4b60
Signed-off-by: Gabor Hosszu <gabor@digitalasset.com>
  • Loading branch information
gaborh-da committed Sep 20, 2016
1 parent 44e1d30 commit bf1ed41
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
21 changes: 21 additions & 0 deletions docs/API/AttributesUsage.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,13 @@ To deploy a chaincode with attributes "company" and "position" it should be writ
```

Or:

```
./peer chaincode deploy -u userName -n mycc -c '{"Args": ["init"]}' -a '["position", "company"]'
```

#### REST

```
Expand Down Expand Up @@ -145,6 +152,13 @@ To invoke "autorizable counter" with attributes "company" and "position" it shou
```

Or:

```
./peer chaincode invoke -u userName -n mycc -c '{"Args": ["increment"]}' -a '["position", "company"]'
```

#### REST

```
Expand Down Expand Up @@ -202,6 +216,13 @@ To query "autorizable counter" with attributes "company" and "position" it shoul
```

Or:

```
./peer chaincode query -u userName -n mycc -c '{"Args": ["read"]}' -a '["position", "company"]'
```

#### REST

```
Expand Down
8 changes: 8 additions & 0 deletions docs/API/CoreAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,20 @@ Deploy creates the docker image for the chaincode and subsequently deploys the p

`peer chaincode deploy -p github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02 -c '{"Function":"init", "Args": ["a","100", "b", "200"]}'`

Or:

`peer chaincode deploy -p github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02 -c '{"Args": ["init", "a","100", "b", "200"]}'`

The response to the chaincode deploy command will contain the chaincode identifier (hash) which will be required on subsequent `chaincode invoke` and `chaincode query` commands in order to identify the deployed chaincode.

With security enabled, modify the command to include the -u parameter passing the username of a logged in user as follows:

`peer chaincode deploy -u jim -p github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02 -c '{"Function":"init", "Args": ["a","100", "b", "200"]}'`

Or:

`peer chaincode deploy -u jim -p github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02 -c '{"Args": ["init", "a","100", "b", "200"]}'`

**Note:** If your GOPATH environment variable contains more than one element, the chaincode must be found in the first one or deployment will fail.

### Verify Results
Expand Down

0 comments on commit bf1ed41

Please sign in to comment.