Skip to content

Commit bf1ed41

Browse files
committed
Update CLI related docs
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 <[email protected]>
1 parent 44e1d30 commit bf1ed41

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

docs/API/AttributesUsage.md

+21
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,13 @@ To deploy a chaincode with attributes "company" and "position" it should be writ
9393
9494
```
9595

96+
Or:
97+
98+
```
99+
./peer chaincode deploy -u userName -n mycc -c '{"Args": ["init"]}' -a '["position", "company"]'
100+
101+
```
102+
96103
#### REST
97104

98105
```
@@ -145,6 +152,13 @@ To invoke "autorizable counter" with attributes "company" and "position" it shou
145152
146153
```
147154

155+
Or:
156+
157+
```
158+
./peer chaincode invoke -u userName -n mycc -c '{"Args": ["increment"]}' -a '["position", "company"]'
159+
160+
```
161+
148162
#### REST
149163

150164
```
@@ -202,6 +216,13 @@ To query "autorizable counter" with attributes "company" and "position" it shoul
202216
203217
```
204218

219+
Or:
220+
221+
```
222+
./peer chaincode query -u userName -n mycc -c '{"Args": ["read"]}' -a '["position", "company"]'
223+
224+
```
225+
205226
#### REST
206227

207228
```

docs/API/CoreAPI.md

+8
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,20 @@ Deploy creates the docker image for the chaincode and subsequently deploys the p
7070

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

73+
Or:
74+
75+
`peer chaincode deploy -p github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02 -c '{"Args": ["init", "a","100", "b", "200"]}'`
76+
7377
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.
7478

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

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

83+
Or:
84+
85+
`peer chaincode deploy -u jim -p github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02 -c '{"Args": ["init", "a","100", "b", "200"]}'`
86+
7987
**Note:** If your GOPATH environment variable contains more than one element, the chaincode must be found in the first one or deployment will fail.
8088

8189
### Verify Results

0 commit comments

Comments
 (0)