You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixed CLI commands and REST API
payloads in chaincode-setup.md
[ci skip]
Change-Id: Ia737638158a519e0f34d03d3895c91af53b112ed
Signed-off-by: Nick Gaski <[email protected]>
Copy file name to clipboardexpand all lines: docs/Setup/Chaincode-setup.md
+18-24
Original file line number
Diff line number
Diff line change
@@ -275,15 +275,15 @@ POST localhost:7050/registrar
275
275
276
276
First, send a chaincode deploy transaction, only once, to the validating peer. The CLI connects to the validating peer using the properties defined in the core.yaml file. **Note:** The deploy transaction typically requires a `path` parameter to locate, build, and deploy the chaincode. However, because these instructions are specific to local development mode and the chaincode is deployed manually, the `name` parameter is used instead.
Alternatively, you can run the chaincode deploy transaction through the REST API.
282
282
283
283
**REST Request:**
284
284
285
285
```
286
-
POST host:port/chaincode
286
+
POST <host:port>/chaincode
287
287
288
288
{
289
289
"jsonrpc": "2.0",
@@ -294,8 +294,7 @@ POST host:port/chaincode
294
294
"name": "mycc"
295
295
},
296
296
"ctorMsg": {
297
-
"function":"init",
298
-
"args":["a", "100", "b", "200"]
297
+
"args":["init", "a", "100", "b", "200"]
299
298
}
300
299
},
301
300
"id": 1
@@ -317,12 +316,12 @@ POST host:port/chaincode
317
316
318
317
**Note:** When security is enabled, modify the CLI command and the REST API payload to pass the `enrollmentID` of a logged in user. To log in a registered user through the CLI or the REST API, follow the instructions in the [note on security functionality](#note-on-security-functionality). On the CLI, the `enrollmentID` is passed with the `-u` parameter; in the REST API, the `enrollmentID` is passed with the `secureContext` element. If you are enabling security and privacy on the peer process with environment variables, it is important to include these environment variables in the command when executing all subsequent peer operations (e.g. deploy, invoke, or query).
@@ -353,15 +351,15 @@ The deploy transaction initializes the chaincode by executing a target initializ
353
351
Run the chaincode invoking transaction on the CLI as many times as desired. The `-n` argument should match the value provided in the chaincode window (started in Vagrant terminal 2):
Alternatively, run the chaincode invoking transaction through the REST API.
360
358
361
359
**REST Request:**
362
360
363
361
```
364
-
POST host:port/chaincode
362
+
POST <host:port>/chaincode
365
363
366
364
{
367
365
"jsonrpc": "2.0",
@@ -372,8 +370,7 @@ POST host:port/chaincode
372
370
"name":"mycc"
373
371
},
374
372
"ctorMsg": {
375
-
"function":"invoke",
376
-
"args":["a", "b", "10"]
373
+
"args":["invoke", "a", "b", "10"]
377
374
}
378
375
},
379
376
"id": 3
@@ -395,12 +392,12 @@ POST host:port/chaincode
395
392
396
393
**Note:** When security is enabled, modify the CLI command and REST API payload to pass the `enrollmentID` of a logged in user. To log in a registered user through the CLI or the REST API, follow the instructions in the [note on security functionality](#note-on-security-functionality). On the CLI, the `enrollmentID` is passed with the `-u` parameter; in the REST API, the `enrollmentID` is passed with the `secureContext` element. If you are enabling security and privacy on the peer process with environment variables, it is important to include these environment variables in the command when executing all subsequent peer operations (e.g. deploy, invoke, or query).
@@ -432,7 +428,7 @@ The invoking transaction runs the specified chaincode function name "invoke" wit
432
428
Run a query on the chaincode to retrieve the desired values. The `-n` argument should match the value provided in the chaincode window (started in Vagrant terminal 2):
@@ -451,7 +447,7 @@ Alternatively, run the chaincode query transaction through the REST API.
451
447
452
448
**REST Request:**
453
449
```
454
-
POST host:port/chaincode
450
+
POST <host:port>/chaincode
455
451
456
452
{
457
453
"jsonrpc": "2.0",
@@ -462,8 +458,7 @@ POST host:port/chaincode
462
458
"name":"mycc"
463
459
},
464
460
"ctorMsg": {
465
-
"function":"query",
466
-
"args":["a"]
461
+
"args":["query", "a"]
467
462
}
468
463
},
469
464
"id": 5
@@ -485,12 +480,12 @@ POST host:port/chaincode
485
480
**Note:** When security is enabled, modify the CLI command and REST API payload to pass the `enrollmentID` of a logged in user. To log in a registered user through the CLI or the REST API, follow the instructions in the [note on security functionality](#note-on-security-functionality). On the CLI, the `enrollmentID` is passed with the `-u` parameter; in the REST API, the `enrollmentID` is passed with the `secureContext` element. If you are enabling security and privacy on the peer process with environment variables, it is important to include these environment variables in the command when executing all subsequent peer operations (e.g. deploy, invoke, or query).
0 commit comments