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
fix incorrect chaincode signatures
in REST API and CLI
[ci skip]
Change-Id: I9ecbb3c4fe0b82ce1b22a6cf5cc34629e353da3e
Signed-off-by: Nick Gaski <[email protected]>
Copy file name to clipboardexpand all lines: docs/Setup/Chaincode-setup.md
+19-25
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).
The deploy transaction initializes the chaincode by executing a target initializing function. Though the example shows "init", the name could be arbitrarily chosen by the chaincode developer. You should see the following output in the chaincode window:
346
344
```
347
-
2015/11/15 15:19:31 Received INIT(uuid:005dea42-d57f-4983-803e-3232e551bf61), initializing chaincode
345
+
<TIMESTAMP_SIGNATURE> Received INIT(uuid:005dea42-d57f-4983-803e-3232e551bf61), initializing chaincode
348
346
Aval = 100, Bval = 200
349
347
```
350
348
@@ -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
@@ -400,7 +397,7 @@ POST host:port/chaincode
400
397
**REST Request:**
401
398
402
399
```
403
-
POST host:port/chaincode
400
+
POST <host:port>/chaincode
404
401
405
402
{
406
403
"jsonrpc": "2.0",
@@ -411,8 +408,7 @@ POST host:port/chaincode
411
408
"name":"mycc"
412
409
},
413
410
"ctorMsg": {
414
-
"function":"invoke",
415
-
"args":["a", "b", "10"]
411
+
"args":["invoke", "a", "b", "10"]
416
412
},
417
413
"secureContext": "jim"
418
414
},
@@ -423,7 +419,7 @@ POST host:port/chaincode
423
419
The invoking transaction runs the specified chaincode function name "invoke" with the arguments. This transaction transfers 10 units from A to B. You should see the following output in the chaincode window:
424
420
425
421
```
426
-
2015/11/15 15:39:11 Received RESPONSE. Payload 200, Uuid 075d72a4-4d1f-4a1d-a735-4f6f60d597a9
422
+
<TIMESTAMP_SIGNATURE> Received RESPONSE. Payload 200, Uuid 075d72a4-4d1f-4a1d-a735-4f6f60d597a9
427
423
Aval = 90, Bval = 210
428
424
```
429
425
@@ -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