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
Copy file name to clipboardExpand all lines: README.md
+15-15Lines changed: 15 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -247,20 +247,19 @@ func main() {
247
247
```
248
248
249
249
### Need Help?
250
-
If you're stuck or confused at any point, just go check out the `chaincode_finished.go` file. Use this file to validate that the code snippets you're building into chaincode_start.go are correct.
251
250
252
-
#Interacting with Your First Chaincode
253
-
The fastest way to test your chaincode is to use the REST interface on your peers.
254
-
If you're using the blockchain service on Bluemix, you should follow the steps described [here](https://new-console.ng.bluemix.net/docs/services/blockchain/ibmblockchain_tutorials.html). Otherwise, we recommend using a tool like Postman, as described in the [environment setup documentation](docs/setup.md).
255
-
There are two REST endpoints we will be interacting with: `/chaincode` and `/registrar`.
256
-
- `/chaincode` is the endpoint used for deploying, invoking, and querying chaincode. Which operation you perform is controlled by the body of the request that you send.
257
-
- `/registrar` allows you to enroll users. Why does this matter? Read on!
251
+
If you're stuck or confused at any point, just go check out the `chaincode_finished.go` file. Use this file to validate that the code snippets you're building into chaincode_start.go are correct.
252
+
253
+
# Interacting with Your First Chaincode
254
+
The fastest way to test your chaincode is to use the REST interface on your peers. If you're using the blockchain service on Bluemix, you should follow the steps described [here](https://new-console.ng.bluemix.net/docs/services/blockchain/ibmblockchain_tutorials.html). Otherwise, we recommend using a tool like Postman, as described in the [environment setup documentation](docs/setup.md). There are two REST endpoints we will be interacting with: `/chaincode` and `/registrar`.
255
+
- `/chaincode` is the endpoint used for deploying, invoking, and querying chaincode. Which operation you perform is controlled by the body of the request that you send.
256
+
- `/registrar` allows you to enroll users. Why does this matter? Read on!
258
257
259
258
### Secure Enrollment
260
-
Calls to the `/chaincode` endpoint of the REST interface require a secure context ID to be included in the body of the request.
261
-
This means that you must first enroll a user from the user list in the membership service for your network.
262
-
- Find an available user to enroll on one of your peers. This will most likely require you to grab a user from the [membersrvc.yaml](fabric/membersrvc/membersrvc.yaml) file for your network. Look for the section that has a list of users like this:
263
-
259
+
Calls to the `/chaincode` endpoint of the REST interface require a secure context ID to be included in the body of the request. This means that you must first enroll a user from the user list in the membership service for your network.
260
+
261
+
- Find an available user to enroll on one of your peers. This will most likely require you to grab a user from the [membersrvc.yaml](fabric/membersrvc/membersrvc.yaml) file for your network. Look for the section that has a list of users like this:
262
+
264
263
```
265
264
...
266
265
test_user0: 1 MS9qrN8hFjlE bank_a 00001
@@ -295,9 +294,11 @@ This means that you must first enroll a user from the user list in the membershi
295
294
296
295
If you didn't receive a "Login successful" response, go back and make sure you properly copied your enrollment ID and secret. Now, you have an ID that you can use when deploying, invoking, and querying chaincode in the subsequent steps.
297
296
297
+
If you didn't receive a "Login successful" response, go back and make sure you properly copied your enrollment ID and secret. Now, you have an ID that you can use when deploying, invoking, and querying chaincode in the subsequent steps.
298
+
298
299
### Deploying the chaincode
299
-
In order to deploy chaincode through the REST interface, you will need to have the chaincode stored in a public git repository.
300
-
When you send a deploy request to a peer, you send it the url to your chaincode repository, as well as the parameters necessary to initialize the chaincode.
300
+
301
+
In order to deploy chaincode through the REST interface, you will need to have the chaincode stored in a public git repository. When you send a deploy request to a peer, you send it the url to your chaincode repository, as well as the parameters necessary to initialize the chaincode.
301
302
302
303
**Before you deploy** the code, make sure it builds locally!
303
304
- Open a terminal
@@ -344,8 +345,7 @@ When you send a deploy request to a peer, you send it the url to your chaincode
The long string response for the deployment will contain an ID that is associated with this chaincode. The ID is a 128 character alphanumeric hash. Copy this ID on your notepad as well. You should now have a set of enrollID credentials and the cryptographic hash representing your chaincode.
348
-
This is how you will reference the chaincode in any future Invoke or Query transactions.
348
+
The long string response for the deployment will contain an ID that is associated with this chaincode. The ID is a 128 character alphanumeric hash. Copy this ID on your notepad as well. You should now have a set of enrollID credentials and the cryptographic hash representing your chaincode. This is how you will reference the chaincode in any future Invoke or Query transactions.
0 commit comments